OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 23-May-2006 15:34:05
Branch: HEAD Handle: 2006052314340101
Added files:
openpkg-src/arpalert arpalert.conf arpalert.patch arpalert.spec
rc.arpalert
Log:
new package: arpalert 1.0.2 (ARP Network Monitoring & Alerting)
Summary:
Revision Changes Path
1.1 +60 -0 openpkg-src/arpalert/arpalert.conf
1.1 +79 -0 openpkg-src/arpalert/arpalert.patch
1.1 +118 -0 openpkg-src/arpalert/arpalert.spec
1.1 +56 -0 openpkg-src/arpalert/rc.arpalert
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/arpalert/arpalert.conf
============================================================================
$ cvs diff -u -r0 -r1.1 arpalert.conf
--- /dev/null 2006-05-23 15:33:40 +0200
+++ arpalert.conf 2006-05-23 15:34:04 +0200
@@ -0,0 +1,60 @@
+##
+## arpalert.conf -- ARPAlert server configuration
+##
+
+maclist file = @l_prefix@/etc/arpalert/arpalert.allow
+maclist alert file = @l_prefix@/etc/arpalert/arpalert.deny
+auth request file = @l_prefix@/etc/arpalert/arpalert.authreq
+
+maclist leases file = @l_prefix@/var/arpalert/db/arpalert.leases
+lock file = @l_prefix@/var/arpalert/run/arpalert.pid
+log file = @l_prefix@/var/arpalert/log/arpalert.log
+log level = 6
+use syslog = false
+
+daemon = true
+user = @l_rusr@
+umask = 0177
+
+#interface = eth0
+dump paquet = false
+
+action on detect = ""
+ignore me = true
+max alert = 20
+execution timeout = 10
+
+dump black list = false
+dump white list = false
+dump new address = true
+
+mac timeout = 259200
+max entry = 1000000
+anti flood interval = 5
+anti flood global = 50
+ignore unknown sender = false
+ignore self test = false
+unauth ignore time method = 2
+max request = 1000000
+
+log referenced address = false
+alert on referenced address = false
+log deny address = true
+alert on deny address = false
+log new address = true
+alert on new address = false
+log new mac address = true
+alert on new mac address = false
+log ip change = true
+alert on ip change = false
+log mac change = true
+alert on mac change = false
+log unauth request = false
+alert on unauth request = false
+log request abus = true
+alert on request abus = false
+log mac error = true
+alert on mac error = false
+log flood = true
+alert on flood = false
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/arpalert/arpalert.patch
============================================================================
$ cvs diff -u -r0 -r1.1 arpalert.patch
--- /dev/null 2006-05-23 15:33:40 +0200
+++ arpalert.patch 2006-05-23 15:34:04 +0200
@@ -0,0 +1,79 @@
+Index: Makefile.in
+--- Makefile.in.orig 2006-05-10 23:46:41 +0200
++++ Makefile.in 2006-05-23 15:19:34 +0200
+@@ -17,9 +17,9 @@
+ mandir = @mandir@
+ includedir = @includedir@
+ config_dir = @sysconfdir@/arpalert
+-leases_dir = @localstatedir@/lib/arpalert
+-lock_dir = @localstatedir@/run
+-log_dir = @localstatedir@/log
++leases_dir = @localstatedir@/arpalert/db
++lock_dir = @localstatedir@/arpalert/run
++log_dir = @localstatedir@/arpalert/log
+ src_dir = .
+
+ CC = @CC@
+@@ -90,17 +90,17 @@
+ mkdir -p $(DESTDIR)$(mandir)/man8
+ cp -f doc/arpalert.8 $(DESTDIR)$(mandir)/man8
+ cp -f arpalert $(DESTDIR)$(sbindir)
+- test ! -f $(DESTDIR)$(config_dir)/maclist.allow && >
$(DESTDIR)$(config_dir)/maclist.allow || /bin/true
+- test ! -f $(DESTDIR)$(config_dir)/maclist.deny && >
$(DESTDIR)$(config_dir)/maclist.deny || /bin/true
++ test ! -f $(DESTDIR)$(config_dir)/arpalert.allow && >
$(DESTDIR)$(config_dir)/arpalert.allow || /bin/true
++ test ! -f $(DESTDIR)$(config_dir)/arpalert.deny && >
$(DESTDIR)$(config_dir)/arpalert.deny || /bin/true
+ if test ! -f $(DESTDIR)$(config_dir)/arpalert.conf; \
+ then \
+ > $(DESTDIR)$(config_dir)/arpalert.conf; \
+ echo "# white list" >> $(DESTDIR)$(config_dir)/arpalert.conf; \
+- echo "Maclist file = $(config_dir)/maclist.allow" >>
$(DESTDIR)$(config_dir)/arpalert.conf; \
++ echo "Maclist file = $(config_dir)/arpalert.allow" >>
$(DESTDIR)$(config_dir)/arpalert.conf; \
+ echo >> $(DESTDIR)$(config_dir)/arpalert.conf; \
+ \
+ echo "# black list" >> $(DESTDIR)$(config_dir)/arpalert.conf; \
+- echo "Maclist alert file = $(config_dir)/maclist.deny" >>
$(DESTDIR)$(config_dir)/arpalert.conf; \
++ echo "Maclist alert file = $(config_dir)/arpalert.deny" >>
$(DESTDIR)$(config_dir)/arpalert.conf; \
+ echo >> $(DESTDIR)$(config_dir)/arpalert.conf; \
+ \
+ echo "# dump file" >> $(DESTDIR)$(config_dir)/arpalert.conf; \
+Index: doc/arpalert.8
+--- doc/arpalert.8.orig 2006-05-10 23:46:42 +0200
++++ doc/arpalert.8 2006-05-23 15:21:39 +0200
+@@ -82,16 +82,16 @@
+ \fBuse syslog\fR = true
+ If this option is false, the syslog system is disabled
+ .TP
+-\fBmaclist file\fR = /etc/arpalert/maclist.allow
++\fBmaclist file\fR = /etc/arpalert/arpalert.allow
+ white list
+ .TP
+-\fBmaclist alert file\fR = /etc/arpalert/maclist.deny
++\fBmaclist alert file\fR = /etc/arpalert/arpalert.deny
+ black list
+ .TP
+ \fBmaclist leases file\fR = /var/lib/arpalert/arpalert.leases
+ dump fil
+ .TP
+-\fBauth request file\fR = /etc/arpalert/authrq.conf
++\fBauth request file\fR = /etc/arpalert/arpalert.authreq
+ list of authorized request"
+ .TP
+ \fBLock file\fR = /var/run/arpalert.lock
+@@ -228,7 +228,7 @@
+ .\"
+ .SH DATA FILES FORMATS
+ .TP
+-\fB/etc/arpalert/maclist.allow\fR and \fB/etc/arpalert/maclist.deny\fR:
++\fB/etc/arpalert/arpalert.allow\fR and \fB/etc/arpalert/arpalert.deny\fR:
+ all the line with # as a \fBfirst\fR caracter are ignored
+ .br
+ The data on this file take this form
+@@ -249,7 +249,7 @@
+ .br
+ \fBmac_change:\fR Ignore mac change for this mac address
+ .TP
+-\fB/etc/arpalert/authrq.conf\fR:
++\fB/etc/arpalert/arpalert.authreq\fR:
+ all the word after # caracter are ignored
+ .br
+ all the blank characters are ignored
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/arpalert/arpalert.spec
============================================================================
$ cvs diff -u -r0 -r1.1 arpalert.spec
--- /dev/null 2006-05-23 15:33:40 +0200
+++ arpalert.spec 2006-05-23 15:34:04 +0200
@@ -0,0 +1,118 @@
+##
+## arpalert.spec -- OpenPKG RPM Package Specification
+## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
+## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
+##
+## Permission to use, copy, modify, and distribute this software for
+## any purpose with or without fee is hereby granted, provided that
+## the above copyright notice and this permission notice appear in all
+## copies.
+##
+## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+## SUCH DAMAGE.
+##
+
+# package information
+Name: arpalert
+Summary: ARP Network Monitoring & Alerting
+URL: http://www.arpalert.org/
+Vendor: Thierry FOURNIER
+Packager: OpenPKG
+Distribution: OpenPKG
+Class: EVAL
+Group: Network
+License: GPL
+Version: 1.0.2
+Release: 20060523
+
+# list of sources
+Source0:
http://perso.numericable.fr/~fourthie/arpalert/src/arpalert-%{version}.tar.gz
+Source1: arpalert.conf
+Source2: rc.arpalert
+Patch0: arpalert.patch
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make
+PreReq: OpenPKG, openpkg >= 20040130
+BuildPreReq: libpcap
+PreReq: libpcap
+AutoReq: no
+AutoReqProv: no
+
+%description
+ ARPAlert listens on a network interface (without using 'promiscuous'
+ mode) and catches all requests for MAC address to IP conversion. It
+ then compares the MAC addresses it detected with a pre-configured
+ list of authorized MAC addresses. If the MAC is not in list,
+ ARPAlert launches a pre-defined user script with the MAC address and
+ IP address as parameters.
+
+%track
+ prog arpalert = {
+ version = %{version}
+ url =
http://perso.numericable.fr/~fourthie/arpalert/index.php?page=download
+ regex = arpalert-(__VER__)\.tar\.gz
+ }
+
+%prep
+ %setup -q
+ %patch -p0
+
+%build
+ CC="%{l_cc}" \
+ CFLAGS="%{l_cflags -O}" \
+ CPPFLAGS="%{l_cppflags}" \
+ LDFLAGS="%{l_ldflags}" \
+ ./configure \
+ --prefix=%{l_prefix}
+ %{l_make} %{l_mflags -O}
+
+%install
+ rm -rf $RPM_BUILD_ROOT
+ %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
+ strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ %{SOURCE arpalert.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/arpalert/
+ %{l_shtool} install -c -m 644 \
+ /dev/null $RPM_BUILD_ROOT%{l_prefix}/etc/arpalert/arpalert.authreq
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
+ %{SOURCE rc.arpalert} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+ %{l_files_std} \
+ '%config %{l_prefix}/etc/arpalert/*' \
+ '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/arpalert/*'
+
+%files -f files
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
+%post
+ # after upgrade, restart service
+ [ $1 -eq 2 ] || exit 0
+ eval `%{l_rc} arpalert status 2>/dev/null`
+ [ ".$arpalert_active" = .yes ] && %{l_rc} arpalert restart
+ exit 0
+
+%preun
+ # before erase, stop service and remove log files
+ [ $1 -eq 0 ] || exit 0
+ %{l_rc} arpalert stop 2>/dev/null
+ rm -f $RPM_INSTALL_PREFIX/var/arpalert/run/* >/dev/null 2>&1 || true
+ rm -f $RPM_INSTALL_PREFIX/var/arpalert/log/* >/dev/null 2>&1 || true
+ exit 0
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/arpalert/rc.arpalert
============================================================================
$ cvs diff -u -r0 -r1.1 rc.arpalert
--- /dev/null 2006-05-23 15:33:40 +0200
+++ rc.arpalert 2006-05-23 15:34:05 +0200
@@ -0,0 +1,56 @@
[EMAIL PROTECTED]@/lib/openpkg/bash @l_prefix@/etc/rc
+##
+## rc.arpalert -- Run-Commands
+##
+
+%config
+ arpalert_enable="$openpkg_rc_def"
+ arpalert_flags=""
+ arpalert_log_prolog="true"
+ arpalert_log_epilog="true"
+ arpalert_log_numfiles="10"
+ arpalert_log_minsize="1M"
+ arpalert_log_complevel="9"
+
+%common
+ arpalert_pidfile="@l_prefix@/var/arpalert/run/arpalert.pid"
+ arpalert_logfile="@l_prefix@/var/arpalert/log/arpalert.log"
+ arpalert_signal () {
+ [ -f $arpalert_pidfile ] && kill -$1 `cat $arpalert_pidfile`
+ }
+
+%status -u @l_susr@ -o
+ arpalert_usable="unknown"
+ arpalert_active="no"
+ rcService arpalert enable yes && \
+ arpalert_signal 0 && arpalert_active="yes"
+ echo "arpalert_enable=\"$arpalert_enable\""
+ echo "arpalert_usable=\"$arpalert_usable\""
+ echo "arpalert_active=\"$arpalert_active\""
+
+%start -u @l_susr@
+ rcService arpalert enable yes || exit 0
+ rcService arpalert active yes && exit 0
+ @l_prefix@/sbin/arpalert ${arpalert_flags}
+
+%stop -u @l_susr@
+ rcService arpalert enable yes || exit 0
+ rcService arpalert active no && exit 0
+ arpalert_signal TERM
+ sleep 2
+ rm -f $arpalert_pidfile >/dev/null 2>&1 || true
+
+%restart -u @l_susr@
+ rcService arpalert enable yes || exit 0
+ rcService arpalert active no && exit 0
+ rc arpalert stop start
+
+%daily -u @l_susr@
+ rcService arpalert enable yes || exit 0
+ shtool rotate -f \
+ -n ${arpalert_log_numfiles} -s ${arpalert_log_minsize} -d \
+ -z ${arpalert_log_complevel} -m 664 -o @l_susr@ -g @l_mgrp@ \
+ -P "${arpalert_log_prolog}" \
+ -E "${arpalert_log_epilog}; rc arpalert restart" \
+ $arpalert_logfile
+
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]