# $Id: nmicmpd.spec,v 1.7 2003/11/23 16:16:36 jfontain Exp $ Summary: External ICMP echo/mask/timestamp/traceroute server Name: nmicmpd Version: 0.99 Release: 3.i Epoch: 0 License: BSD Group: System Environment/Daemons Source: ftp://ftp.ibr.cs.tu-bs.de/pub/local/tkined/devel/scotty-00-02-21.tar.gz URL: http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ Packager: Jean-Luc Fontaine BuildRoot: %_tmppath/%name-%version-%release-root-%(%__id_u -n) BuildRequires: tk >= 0:8.3.1 %description External ICMP echo/mask/timestamp/traceroute server found in the network management scotty package for Tcl. This server can be used by other programs as well as long as they use the protocol defined in the nmicmpd(n) man page. This program allows processing of parallel probes which makes ICMP requests to multiple hosts very efficient. %prep %setup -q -n scotty-00-02-21 %build cd unix # replace references to Tcl/Tk 8.2 versions: sed -e 's/8.2/8.3/g;' configure > %_tmppath/configure && mv %_tmppath/configure configure && chmod 755 configure %configure cc -o %name $RPM_OPT_FLAGS -I. %name.c %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%_sbindir install unix/%name $RPM_BUILD_ROOT%_sbindir make -C unix MAN_INSTALL_DIR=$RPM_BUILD_ROOT%_mandir tnm-install-man # remove installed but unpackaged files: cd $RPM_BUILD_ROOT%_mandir && rm -rf man1 mann man8/nmtrapd.* %post [ $1 != 1 ] && exit if [ -f /etc/services ] && ! grep -q '^[[:space:]]*nmicmp[[:space:]]' /etc/services; then # eventually add nmicmp entry to services configuration file echo -e '\nnmicmp 57777/tcp # added by nmicmpd rpm' >> /etc/services fi if [ -f /etc/inetd.conf ] && ! grep -q '^[[:space:]]*nmicmp[[:space:]]' /etc/inetd.conf; then # eventually add nmicmp entry to inetd configuration file echo -e '\n# added by nmicmpd rpm:\nnmicmp stream tcp nowait root %{directory}/sbin/nmicmpd nmicmpd' >> /etc/inetd.conf echo -n "(may fail if inetd not running) " service inetd reload || : fi if [ -d /etc/xinetd.d ] && ! [ -f /etc/xinetd.d/nmicmp ]; then # eventually add nmicmp to xinetd configuration cat > /etc/xinetd.d/nmicmp < %_tmppath/services; mv %_tmppath/services /etc/services fi if [ -f /etc/inetd.conf ]; then # remove nmicmp entries and comments from services and inetd configuration files sed -e '/nmicmp/d' /etc/inetd.conf > %_tmppath/inetd.conf; mv %_tmppath/inetd.conf /etc/inetd.conf echo -n "(may fail if inetd not running) " service inetd reload || : fi if [ -d /etc/xinetd.d ] && [ -f /etc/xinetd.d/nmicmp ]; then # remove nmicmp entry from xinetd configuration rm /etc/xinetd.d/nmicmp echo -n "(may fail if xinetd not running) " service xinetd reload || : fi %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc README license.terms %doc %_mandir/man8/%name.* %_sbindir/%name %changelog * Tue Nov 23 2003 Jean-Luc Fontaine 0:0.99-3.i - improved specification file to Fedora standards