Import new package spec for introduction into repository.

Fri, 09 Jan 2009 19:02:45 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 09 Jan 2009 19:02:45 +0100
changeset 64
6aeed4ef015a
parent 63
a62e2cc5c7be
child 65
caa04e02b103

Import new package spec for introduction into repository.

arpwatch/arpwatch.patch file | annotate | diff | comparison | revisions
arpwatch/arpwatch.spec file | annotate | diff | comparison | revisions
arpwatch/fsl.arpwatch file | annotate | diff | comparison | revisions
arpwatch/rc.arpwatch file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/arpwatch/arpwatch.patch	Fri Jan 09 19:02:45 2009 +0100
     1.3 @@ -0,0 +1,212 @@
     1.4 +Index: configure
     1.5 +--- configure.orig	2006-06-21 22:32:38.000000000 +0200
     1.6 ++++ configure	2006-10-20 15:30:45.862899000 +0200
     1.7 +@@ -5259,11 +5259,7 @@
     1.8 +     echo "$as_me:$LINENO: result: $ac_cv_lbl_have_" >&5
     1.9 + echo "${ECHO_T}$ac_cv_lbl_have_" >&6
    1.10 +     if test $ac_cv_lbl_have_ = no ; then
    1.11 +-
    1.12 +-cat >>confdefs.h <<\_ACEOF
    1.13 +-#define
    1.14 +-_ACEOF
    1.15 +-
    1.16 ++        :
    1.17 +     fi
    1.18 + 
    1.19 + rm -f os-proto.h
    1.20 +Index: Makefile.in
    1.21 +--- Makefile.in.orig	2000-06-15 02:39:55.000000000 +0200
    1.22 ++++ Makefile.in	2006-10-20 17:41:03.246914000 +0200
    1.23 +@@ -31,7 +31,7 @@
    1.24 + # Pathname of directory to install the man page
    1.25 + MANDEST = @mandir@
    1.26 + # Pathname of directory to install database file
    1.27 +-ARPDIR = $(prefix)/arpwatch
    1.28 ++ARPDIR = @localstatedir@
    1.29 + 
    1.30 + # VPATH
    1.31 + srcdir = @srcdir@
    1.32 +@@ -42,16 +42,17 @@
    1.33 + #
    1.34 + 
    1.35 + CC = @CC@
    1.36 ++CFLAGS = @CFLAGS@
    1.37 ++CPPFLAGS = @CPPFLAGS@
    1.38 ++
    1.39 + PROG = arpwatch
    1.40 + CCOPT = @V_CCOPT@
    1.41 + INCLS = -I. @V_INCLS@
    1.42 + DEFS = -DDEBUG @DEFS@ -DARPDIR=\"$(ARPDIR)\" -DPATH_SENDMAIL=\"$(SENDMAIL)\"
    1.43 + 
    1.44 +-# Standard CFLAGS
    1.45 +-CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
    1.46 +-
    1.47 + # Standard LIBS
    1.48 + LIBS = @LIBS@
    1.49 ++LDFLAGS = @LDFLAGS@
    1.50 + # Standard LIBS without libpcap.a
    1.51 + SLIBS = @LBL_LIBS@
    1.52 + 
    1.53 +@@ -63,7 +64,7 @@
    1.54 + # problem if you don't own the file but can write to the directory.
    1.55 + .c.o:
    1.56 + 	@rm -f $@
    1.57 +-	$(CC) $(CFLAGS) -c $(srcdir)/$*.c
    1.58 ++	$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $(srcdir)/$*.c
    1.59 + 
    1.60 + CSRC =	db.c dns.c ec.c file.c intoa.c machdep.c util.c report.c setsignal.c
    1.61 + WSRC =	arpwatch.c
    1.62 +@@ -95,11 +96,11 @@
    1.63 + 
    1.64 + arpwatch: $(WOBJ) @V_PCAPDEP@
    1.65 + 	@rm -f $@
    1.66 +-	$(CC) $(CFLAGS) -o $@ $(WOBJ) $(LIBS)
    1.67 ++	$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -o $@ $(WOBJ) $(LDFLAGS) $(LIBS)
    1.68 + 
    1.69 + arpsnmp: $(SOBJ)
    1.70 + 	@rm -f $@
    1.71 +-	$(CC) $(CFLAGS) -o $@ $(SOBJ) $(SLIBS)
    1.72 ++	$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -o $@ $(SOBJ) $(LDFLAGS) $(SLIBS)
    1.73 + 
    1.74 + version.o: version.c
    1.75 + version.c: $(srcdir)/VERSION
    1.76 +@@ -107,18 +108,22 @@
    1.77 + 	sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $@
    1.78 + 
    1.79 + zap: zap.o intoa.o
    1.80 +-	$(CC) $(CFLAGS) -o $@ zap.o intoa.o -lutil
    1.81 ++	$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -o $@ zap.o intoa.o $(LDFLAGS) -lutil
    1.82 + 
    1.83 + install: force
    1.84 +-	$(INSTALL) -m 555 -o bin -g bin arpwatch $(DESTDIR)$(BINDEST)
    1.85 +-	$(INSTALL) -m 555 -o bin -g bin arpsnmp $(DESTDIR)$(BINDEST)
    1.86 ++	$(INSTALL) -s -m 555 arpwatch $(DESTDIR)$(BINDEST)
    1.87 ++	$(INSTALL) -s -m 555 arpsnmp $(DESTDIR)$(BINDEST)
    1.88 + 
    1.89 + install-man: force
    1.90 +-	$(INSTALL) -m 444 -o bin -g bin $(srcdir)/arpwatch.8 \
    1.91 ++	$(INSTALL) -m 644 $(srcdir)/arpwatch.8 \
    1.92 + 	    $(DESTDIR)$(MANDEST)/man8
    1.93 +-	$(INSTALL) -m 444 -o bin -g bin $(srcdir)/arpsnmp.8 \
    1.94 ++	$(INSTALL) -m 644 $(srcdir)/arpsnmp.8 \
    1.95 + 	    $(DESTDIR)$(MANDEST)/man8
    1.96 + 
    1.97 ++install-data: force
    1.98 ++	$(INSTALL) -m 444 $(srcdir)/ethercodes.dat \
    1.99 ++	    $(DESTDIR)$(ARPDIR)
   1.100 ++
   1.101 + lint:	$(GENSRC) force
   1.102 + 	lint -hbxn $(SRC) | \
   1.103 + 	    grep -v 'struct/union .* never defined' | \
   1.104 +Index: arpwatch.8
   1.105 +--- arpwatch.8.orig	2006-10-20 16:13:53.268590000 +0200
   1.106 ++++ arpwatch.8	2006-10-20 16:15:01.537612000 +0200
   1.107 +@@ -152,9 +152,8 @@
   1.108 + .na
   1.109 + .nh
   1.110 + .nf
   1.111 +-/usr/operator/arpwatch - default directory
   1.112 +-arp.dat - ethernet/ip address database
   1.113 +-ethercodes.dat - vendor ethernet block list
   1.114 ++@l_prefix@/var/arpwatch/arp.dat - ethernet/ip address database
   1.115 ++@l_prefix@/var/arpwatch/ethercodes.dat - vendor ethernet block list
   1.116 + .ad
   1.117 + .hy
   1.118 + .fi
   1.119 +Index: arpsnmp.8
   1.120 +--- arpsnmp.8.orig	2006-10-20 16:14:50.412624000 +0200
   1.121 ++++ arpsnmp.8	2006-10-20 16:14:59.301665000 +0200
   1.122 +@@ -69,9 +69,8 @@
   1.123 + .na
   1.124 + .nh
   1.125 + .nf
   1.126 +-/usr/operator/arpwatch - default directory
   1.127 +-arp.dat - ethernet/ip address database
   1.128 +-ethercodes.dat - vendor ethernet block list
   1.129 ++@l_prefix@/var/arpwatch/arp.dat - ethernet/ip address database
   1.130 ++@l_prefix@/var/arpwatch/ethercodes.dat - vendor ethernet block list
   1.131 + .ad
   1.132 + .hy
   1.133 + .fi
   1.134 +Index: arpwatch.h
   1.135 +--- arpwatch.h.orig	2000-10-01 01:40:55.000000000 +0200
   1.136 ++++ arpwatch.h	2006-10-21 07:41:55.629111000 +0200
   1.137 +@@ -8,6 +8,20 @@
   1.138 + #define BCOPY(a, b, n) memmove((char *)b, (char *)a, n)
   1.139 + #define MEMSET(s, c, n) memset((char *)s, c, n)
   1.140 + 
   1.141 ++/* Repair unportable usage of u_int*_t declarations */
   1.142 ++#ifndef u_int64_t
   1.143 ++#define u_int64_t unsigned long long
   1.144 ++#endif
   1.145 ++#ifndef u_int32_t
   1.146 ++#define u_int32_t unsigned int
   1.147 ++#endif
   1.148 ++#ifndef u_int16_t
   1.149 ++#define u_int16_t unsigned short
   1.150 ++#endif
   1.151 ++#ifndef u_int6_t
   1.152 ++#define u_int8_t unsigned char
   1.153 ++#endif
   1.154 ++
   1.155 + char	*intoa(u_int32_t);
   1.156 + 
   1.157 + #ifndef HAVE_BCOPY
   1.158 +Index: arpwatch.c
   1.159 +--- arpwatch.c.orig	2004-01-22 23:18:20.000000000 +0100
   1.160 ++++ arpwatch.c	2006-10-20 19:28:25.417689000 +0200
   1.161 +@@ -234,8 +234,11 @@
   1.162 + 			if (pid < 0) {
   1.163 + 				syslog(LOG_ERR, "main fork(): %m");
   1.164 + 				exit(1);
   1.165 +-			} else if (pid != 0)
   1.166 ++			} else if (pid != 0) {
   1.167 ++				printf("%d\n", pid);
   1.168 ++				fflush(stdout);
   1.169 + 				exit(0);
   1.170 ++			}
   1.171 + 			(void)close(fileno(stdin));
   1.172 + 			(void)close(fileno(stdout));
   1.173 + 			(void)close(fileno(stderr));
   1.174 +@@ -321,7 +324,6 @@
   1.175 + 
   1.176 + 	(void)setsignal(SIGINT, die);
   1.177 + 	(void)setsignal(SIGTERM, die);
   1.178 +-	(void)setsignal(SIGHUP, die);
   1.179 + 	if (rfilename == NULL) {
   1.180 + 		(void)setsignal(SIGQUIT, checkpoint);
   1.181 + 		(void)setsignal(SIGALRM, checkpoint);
   1.182 +Index: dns.c
   1.183 +--- dns.c.orig	2006-10-20 19:06:40.704886000 +0200
   1.184 ++++ dns.c	2006-10-20 19:20:09.611322000 +0200
   1.185 +@@ -137,7 +137,7 @@
   1.186 + 	return (0);
   1.187 + }
   1.188 +
   1.189 +-/* Return the cannonical name of the host */
   1.190 ++/* Return the canonical name of the host (NULL if not found) */
   1.191 + char *
   1.192 + gethname(u_int32_t a)
   1.193 + {
   1.194 +@@ -150,18 +150,18 @@
   1.195 + 	hp = gethostbyaddr((char *)&a, sizeof(a), AF_INET);
   1.196 + 	_res.options = options;
   1.197 + 	if (hp == NULL)
   1.198 +-		return (intoa(a));
   1.199 ++		return NULL;
   1.200 + 	return (hp->h_name);
   1.201 + }
   1.202 +
   1.203 +-/* Return the simple name of the host */
   1.204 ++/* Return the simple name of the host (NULL if not found) */
   1.205 + char *
   1.206 + getsname(register u_int32_t a)
   1.207 + {
   1.208 + 	register char *s, *cp;
   1.209 +
   1.210 + 	s = gethname(a);
   1.211 +-	if (!isdigit((int)*s)) {
   1.212 ++	if (s != NULL) {
   1.213 + 		cp = strchr(s, '.');
   1.214 + 		if (cp != NULL)
   1.215 + 			*cp = '\0';
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/arpwatch/arpwatch.spec	Fri Jan 09 19:02:45 2009 +0100
     2.3 @@ -0,0 +1,176 @@
     2.4 +##
     2.5 +##  arpwatch.spec -- OpenPKG RPM Specification
     2.6 +##  Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com>
     2.7 +##
     2.8 +##  Permission to use, copy, modify, and distribute this software for
     2.9 +##  any purpose with or without fee is hereby granted, provided that
    2.10 +##  the above copyright notice and this permission notice appear in all
    2.11 +##  copies.
    2.12 +##
    2.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    2.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    2.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    2.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    2.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    2.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    2.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    2.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    2.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    2.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    2.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    2.24 +##  SUCH DAMAGE.
    2.25 +##
    2.26 +
    2.27 +
    2.28 +#   package information
    2.29 +Name:         arpwatch
    2.30 +Summary:      Ethernet Address Monitor Program
    2.31 +URL:          http://ee.lbl.gov/
    2.32 +Vendor:       Craig Leres
    2.33 +Packager:     Michael Schloh von Bennewitz
    2.34 +Distribution: MSvB Recherche Production
    2.35 +Class:        EVAL
    2.36 +Group:        Network
    2.37 +License:      GPL
    2.38 +Version:      2.1a15
    2.39 +Release:      20090106
    2.40 +
    2.41 +#   package options
    2.42 +%option       with_fsl  yes
    2.43 +
    2.44 +#   list of sources
    2.45 +Source0:      ftp://ftp.ee.lbl.gov/arpwatch.tar.gz
    2.46 +Source1:      rc.arpwatch
    2.47 +Source2:      fsl.arpwatch
    2.48 +Patch0:       arpwatch.patch
    2.49 +
    2.50 +#   build information
    2.51 +Prefix:       %{l_prefix}
    2.52 +BuildRoot:    %{l_buildroot}
    2.53 +BuildPreReq:  OpenPKG, openpkg >= 20040130, libpcap
    2.54 +PreReq:       OpenPKG, openpkg >= 20040130, libpcap
    2.55 +%if "%{with_fsl}" == "yes"
    2.56 +BuildPreReq:  fsl >= 1.2.0
    2.57 +PreReq:       fsl >= 1.2.0
    2.58 +%endif
    2.59 +AutoReq:      no
    2.60 +AutoReqProv:  no
    2.61 +
    2.62 +%description
    2.63 +    The arpwatch daemon monitors ethernet or fddi activity
    2.64 +    and maintains a database of ethernet/ip address pairings.
    2.65 +    It reports certain changes via email as well.
    2.66 +
    2.67 +%track
    2.68 +    prog arpwatch = {
    2.69 +        disabled
    2.70 +        comment   = "msvb: tracking is disabled as sources are unversioned"
    2.71 +        version   = %{version}
    2.72 +        url       = ftp://ftp.ee.lbl.gov/
    2.73 +        regex     = arpwatch-\.tar\.gz
    2.74 +    }
    2.75 +
    2.76 +%prep
    2.77 +    %setup -q
    2.78 +
    2.79 +    #   before patching, correct unconsistent file modes
    2.80 +    chmod u+w *
    2.81 +
    2.82 +    %patch -p0
    2.83 +
    2.84 +    #   supply more detailed file path information
    2.85 +    %{l_shtool} subst %{l_value -s l_prefix} \
    2.86 +        arpwatch.8 \
    2.87 +        arpsnmp.8
    2.88 +
    2.89 +%build
    2.90 +    #   query for platform specific libraries
    2.91 +    loclibs=""
    2.92 +    case "%{l_platform -t}" in
    2.93 +        *-sunos* ) loclibs="-lsocket -lnsl" ;;
    2.94 +    esac
    2.95 +
    2.96 +    #   run the autoconf(1) generated configuration logic
    2.97 +    CC="%{l_cc}" \
    2.98 +    CFLAGS="%{l_cflags -O}" \
    2.99 +    CPPFLAGS="%{l_cppflags}" \
   2.100 +    LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
   2.101 +    LIBS="%{l_fsl_libs} $loclibs" \
   2.102 +    ./configure \
   2.103 +        --prefix=%{l_prefix} \
   2.104 +        --localstatedir=%{l_prefix}/var/arpwatch/run
   2.105 +
   2.106 +    #   run the native build logic using parallel make
   2.107 +    %{l_make} %{l_mflags -O}
   2.108 +
   2.109 +%install
   2.110 +    #   remove previously existing installations
   2.111 +    rm -rf $RPM_BUILD_ROOT
   2.112 +
   2.113 +    #   create installation hierarchy
   2.114 +    %{l_shtool} mkdir -f -p -m 755 \
   2.115 +        $RPM_BUILD_ROOT%{l_prefix}/sbin \
   2.116 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
   2.117 +        $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
   2.118 +        $RPM_BUILD_ROOT%{l_prefix}/var/arpwatch/log \
   2.119 +        $RPM_BUILD_ROOT%{l_prefix}/var/arpwatch/run
   2.120 +
   2.121 +    #   run the native installation logic
   2.122 +    %{l_make} %{l_mflags} install install-man install-data DESTDIR=$RPM_BUILD_ROOT
   2.123 +
   2.124 +    #   install runcommand script
   2.125 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   2.126 +        %{SOURCE rc.arpwatch} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   2.127 +
   2.128 +    #   install OSSP fsl configuration
   2.129 +    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
   2.130 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   2.131 +        %{SOURCE fsl.arpwatch} \
   2.132 +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
   2.133 +
   2.134 +    #   determine installation files
   2.135 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   2.136 +        %{l_files_std} \
   2.137 +        '%not %dir %{l_prefix}/etc/fsl' \
   2.138 +        '%config %{l_prefix}/etc/fsl/fsl.arpwatch'
   2.139 +
   2.140 +%files -f files
   2.141 +
   2.142 +%clean
   2.143 +    rm -rf $RPM_BUILD_ROOT
   2.144 +
   2.145 +%pre
   2.146 +    #   before upgrading package, record runtime status and stop service
   2.147 +    [ $1 -eq 2 ] || exit 0
   2.148 +    eval `%{l_rc} arpwatch status 2>/dev/null | tee %{l_tmpfile}`
   2.149 +    %{l_rc} arpwatch stop 2>/dev/null
   2.150 +    exit 0
   2.151 +
   2.152 +%post
   2.153 +    if [ $1 -eq 1 ]; then
   2.154 +        #   after installing package, generate initial arp database
   2.155 +        %{l_shtool} install -c -o %{l_musr} -g %{l_mgrp} -m 644 \
   2.156 +            %{_builddir}/arpwatch-%{version}/arp.dat \
   2.157 +            $RPM_INSTALL_PREFIX/var/arpwatch/run/
   2.158 +
   2.159 +        #   after installing package, announce security provision lo0
   2.160 +        ( echo "Before starting the arpwatch daemon, set the config variables"
   2.161 +          echo "\"arpwatch_iface\" and \"arpwatch_ipnet\" in $RPM_INSTALL_PREFIX/etc/rc.conf to"
   2.162 +          echo "describe the network interface and block(s) to be monitored."
   2.163 +        ) | %{l_rpmtool} msg -b -t notice
   2.164 +    fi
   2.165 +    if [ $1 -eq 2 ]; then
   2.166 +        #   after upgrading package, restore runtime status
   2.167 +        eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} >/dev/null 2>&1 || true
   2.168 +        [ ".$arpwatch_active" = .yes ] && %{l_rc} arpwatch start
   2.169 +    fi
   2.170 +    exit 0
   2.171 +
   2.172 +%preun
   2.173 +    #   before removing package, stop service and remove log files
   2.174 +    [ $1 -eq 0 ] || exit 0
   2.175 +    %{l_rc} arpwatch stop 2>/dev/null
   2.176 +    rm -f $RPM_INSTALL_PREFIX/var/arpwatch/log/* >/dev/null 2>&1 || true
   2.177 +    rm -f $RPM_INSTALL_PREFIX/var/arpwatch/run/* >/dev/null 2>&1 || true
   2.178 +    exit 0
   2.179 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/arpwatch/fsl.arpwatch	Fri Jan 09 19:02:45 2009 +0100
     3.3 @@ -0,0 +1,28 @@
     3.4 +##
     3.5 +##  fsl.arpwatch -- OSSP fsl configuration
     3.6 +##
     3.7 +
     3.8 +ident (arpwatch)/.+ q{
     3.9 +    prefix(
    3.10 +        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
    3.11 +    )
    3.12 +    -> {
    3.13 +        debug: file(
    3.14 +            path="@l_prefix@/var/arpwatch/log/arpwatch.log",
    3.15 +            perm=0644
    3.16 +        )
    3.17 +    }
    3.18 +};
    3.19 +
    3.20 +ident (arpsnmp)/.+ q{
    3.21 +    prefix(
    3.22 +        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
    3.23 +    )
    3.24 +    -> {
    3.25 +        debug: file(
    3.26 +            path="@l_prefix@/var/arpwatch/log/arpsnmp.log",
    3.27 +            perm=0644
    3.28 +        )
    3.29 +    }
    3.30 +};
    3.31 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/arpwatch/rc.arpwatch	Fri Jan 09 19:02:45 2009 +0100
     4.3 @@ -0,0 +1,66 @@
     4.4 +#!@l_prefix@/bin/openpkg rc
     4.5 +##
     4.6 +##  rc.arpwatch -- runcommands
     4.7 +##
     4.8 +
     4.9 +%config
    4.10 +    arpwatch_enable="$openpkg_rc_def"
    4.11 +    arpwatch_log_prolog="true"
    4.12 +    arpwatch_log_epilog="true"
    4.13 +    arpwatch_log_numfiles="10"
    4.14 +    arpwatch_log_minsize="1M"
    4.15 +    arpwatch_log_complevel="9"
    4.16 +    arpwatch_iface="-i lo0"
    4.17 +    arpwatch_ipnet="-n 127.0.0.0/8"
    4.18 +
    4.19 +%common
    4.20 +    arpwatch_pidfile="@l_prefix@/var/arpwatch/run/arpwatch.pid"
    4.21 +    arpwatch_signal () {
    4.22 +        [ -f $arpwatch_pidfile ] && kill -$1 `cat $arpwatch_pidfile`
    4.23 +    }
    4.24 +
    4.25 +%status -u @l_susr@ -o
    4.26 +    arpwatch_usable="no"
    4.27 +    arpwatch_active="no"
    4.28 +    rcService arpwatch enable yes && \
    4.29 +        arpwatch_usable="yes"
    4.30 +    rcService arpwatch enable yes && \
    4.31 +        arpwatch_signal 0 && arpwatch_active="yes"
    4.32 +    echo "arpwatch_enable=\"$arpwatch_enable\""
    4.33 +    echo "arpwatch_usable=\"$arpwatch_usable\""
    4.34 +    echo "arpwatch_active=\"$arpwatch_active\""
    4.35 +
    4.36 +%start -u @l_susr@
    4.37 +    rcService arpwatch enable yes || exit 0
    4.38 +    rcService arpwatch active yes && exit 0
    4.39 +    @l_prefix@/sbin/arpwatch \
    4.40 +        $arpwatch_iface \
    4.41 +        $arpwatch_ipnet \
    4.42 +        >$arpwatch_pidfile 2>&1
    4.43 +
    4.44 +%stop -u @l_susr@
    4.45 +    rcService arpwatch enable yes || exit 0
    4.46 +    rcService arpwatch active no && exit 0
    4.47 +    arpwatch_signal TERM
    4.48 +
    4.49 +%restart -u @l_susr@
    4.50 +    rcService arpwatch enable yes || exit 0
    4.51 +    rcService arpwatch active no && exit 0
    4.52 +    rc arpwatch stop
    4.53 +    sleep 2
    4.54 +    rc arpwatch start
    4.55 +
    4.56 +%reload -u @l_susr@
    4.57 +    rcService arpwatch enable yes || exit 0
    4.58 +    rcService arpwatch active no && exit 0
    4.59 +    arpwatch_signal HUP
    4.60 +
    4.61 +%daily -u @l_susr@
    4.62 +    rcService arpwatch enable yes || exit 0
    4.63 +    shtool rotate -f \
    4.64 +        -n ${arpwatch_log_numfiles} -s ${arpwatch_log_minsize} -d \
    4.65 +        -z ${arpwatch_log_complevel} -o @l_susr@ -g @l_mgrp@ -m 644 \
    4.66 +        -P "${arpwatch_log_prolog}" \
    4.67 +        -E "${arpwatch_log_epilog}; rc arpwatch restart" \
    4.68 +        @l_prefix@/var/arpwatch/log/arpwatch.log \
    4.69 +        @l_prefix@/var/arpwatch/log/arpsnmp.log

mercurial