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-Oct-2006 13:11:06
Branch: HEAD Handle: 2006102312110500
Added files:
openpkg-src/fprobe fprobe.spec fsl.fprobe rc.fprobe
Log:
new package: fprobe 1.1 (NetFlow Probe)
Summary:
Revision Changes Path
1.1 +137 -0 openpkg-src/fprobe/fprobe.spec
1.1 +16 -0 openpkg-src/fprobe/fsl.fprobe
1.1 +68 -0 openpkg-src/fprobe/rc.fprobe
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/fprobe/fprobe.spec
============================================================================
$ cvs diff -u -r0 -r1.1 fprobe.spec
--- /dev/null 2006-10-23 13:11:00 +0200
+++ fprobe.spec 2006-10-23 13:11:06 +0200
@@ -0,0 +1,137 @@
+##
+## fprobe.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: fprobe
+Summary: NetFlow Probe
+URL: http://fprobe.sourceforge.net/
+Vendor: Slava Astashonok
+Packager: OpenPKG Foundation e.V.
+Distribution: OpenPKG Community
+Class: EVAL
+Group: Auditing
+License: GPL
+Version: 1.1
+Release: 20061023
+
+# package options
+%option with_fsl yes
+
+# list of sources
+Source0:
http://switch.dl.sourceforge.net/fprobe/fprobe-%{version}.tar.bz2
+Source1: fsl.fprobe
+Source2: rc.fprobe
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20040130
+PreReq: OpenPKG, openpkg >= 20040130
+%if "%{with_fsl}" == "yes"
+BuildPreReq: fsl >= 1.2.0
+PreReq: fsl >= 1.2.0
+%endif
+BuildPreReq: libpcap
+PreReq: libpcap
+AutoReq: no
+AutoReqProv: no
+
+%description
+ fprobe and is a NetFlow probe that collects network traffic data and
+ emits it as NetFlow flows towards a specified collector.
+
+%track
+ prog fprobe = {
+ version = %{version}
+ url = http://prdownloads.sourceforge.net/fprobe/
+ regex = fprobe-(__VER__)\.tar\.bz2
+ }
+
+%prep
+ %setup -q
+
+%build
+ # configure program
+ CC="%{l_cc}" \
+ CFLAGS="%{l_cflags -O}" \
+ CPPFLAGS="%{l_cppflags}" \
+ LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
+ LIBS="%{l_fsl_libs}" \
+ ./configure \
+ --prefix=%{l_prefix} \
+ --with-pcap=%{l_prefix}/include \
+ --with-libpcap=%{l_prefix}/lib \
+ --with-piddir=%{l_prefix}/var/fprobe
+
+ # build program
+ %{l_make} %{l_mflags -O}
+
+%install
+ # create installation hierarchy
+ rm -rf $RPM_BUILD_ROOT
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/fsl \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
+ $RPM_BUILD_ROOT%{l_prefix}/var/fprobe
+
+ # install program and manual pages
+ %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
+
+ # strip down installation
+ strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
+
+ # install run-command script
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
+ %{SOURCE rc.fprobe} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+ # install OSSP fsl configuration
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ %{SOURCE fsl.fprobe} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
+
+ # determine installation files
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+ %{l_files_std} \
+ '%not %dir %{l_prefix}/etc/fsl' \
+ '%config %{l_prefix}/etc/fsl/fsl.fprobe' \
+ '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/fprobe'
+
+%files -f files
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
+%post
+ # after upgrade, restart service
+ [ $1 -eq 2 ] || exit 0
+ eval `%{l_rc} fprobe status 2>/dev/null`
+ [ ".$fprobe_active" = .yes ] && %{l_rc} fprobe restart
+ exit 0
+
+%preun
+ # before erase, stop service and remove log files
+ [ $1 -eq 0 ] || exit 0
+ %{l_rc} fprobe stop 2>/dev/null
+ rm -f $RPM_INSTALL_PREFIX/var/fprobe/* >/dev/null 2>&1 || true
+ exit 0
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/fprobe/fsl.fprobe
============================================================================
$ cvs diff -u -r0 -r1.1 fsl.fprobe
--- /dev/null 2006-10-23 13:11:00 +0200
+++ fsl.fprobe 2006-10-23 13:11:06 +0200
@@ -0,0 +1,16 @@
+##
+## fsl.fprobe -- OSSP fsl configuration
+##
+
+ident (fprobe)/.+ q{
+ prefix(
+ prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+ )
+ -> {
+ debug: file(
+ path="@l_prefix@/var/fprobe/fprobe.log",
+ perm=0664
+ )
+ }
+};
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/fprobe/rc.fprobe
============================================================================
$ cvs diff -u -r0 -r1.1 rc.fprobe
--- /dev/null 2006-10-23 13:11:00 +0200
+++ rc.fprobe 2006-10-23 13:11:06 +0200
@@ -0,0 +1,68 @@
[EMAIL PROTECTED]@/bin/openpkg rc
+##
+## rc.fprobe -- Run-Commands
+##
+
+%config
+ fprobe_enable="$openpkg_rc_def"
+ fprobe_interface=""
+ fprobe_filter=""
+ fprobe_flags=""
+ fprobe_collector="127.0.0.1:4432"
+ fprobe_log_prolog="true"
+ fprobe_log_epilog="true"
+ fprobe_log_numfiles="10"
+ fprobe_log_minsize="1M"
+ fprobe_log_complevel="9"
+
+%common
+ fprobe_pidfile="@l_prefix@/var/fprobe/fprobe.pid"
+ fprobe_signal () {
+ [ -f $fprobe_pidfile ] && kill -$1 `cat $fprobe_pidfile`
+ }
+
+%status -u @l_susr@ -o
+ fprobe_usable="no"
+ fprobe_active="no"
+ [ ".$fprobe_interface" != . ] && fprobe_usable="yes"
+ rcService fprobe enable yes && \
+ fprobe_signal 0 && fprobe_active="yes"
+ echo "fprobe_enable=\"$fprobe_enable\""
+ echo "fprobe_usable=\"$fprobe_usable\""
+ echo "fprobe_active=\"$fprobe_active\""
+
+%start -u @l_susr@
+ rcService fprobe enable yes || exit 0
+ rcService fprobe active yes && exit 0
+ cmd="@l_prefix@/sbin/fprobe"
+ cmd="$cmd -i \"$fprobe_interface\""
+ if [ ".$fprobe_filter" != . ]; then
+ cmd="$cmd -f \"$fprobe_filter\""
+ fi
+ cmd="$cmd -l syslog"
+ cmd="$cmd -u @l_nusr@"
+ cmd="$cmd $fprobe_flags"
+ cmd="$cmd $fprobe_collector"
+ eval $cmd
+
+%stop -u @l_susr@
+ rcService fprobe enable yes || exit 0
+ rcService fprobe active no && exit 0
+ fprobe_signal TERM
+ sleep 2
+ rm -f $fprobe_pidfile >/dev/null 2>&1 || true
+
+%restart -u @l_susr@
+ rcService fprobe enable yes || exit 0
+ rcService fprobe active no && exit 0
+ rc fprobe stop start
+
+%daily -u @l_susr@
+ rcService fprobe enable yes || exit 0
+ shtool rotate -f \
+ -n ${fprobe_log_numfiles} -s ${fprobe_log_minsize} -d \
+ -z ${fprobe_log_complevel} -m 644 -o @l_nusr@ -g @l_ngrp@ \
+ -P "${fprobe_log_prolog}" \
+ -E "${fprobe_log_epilog} && rc fprobe restart" \
+ @l_prefix@/var/fprobe/fprobe.log
+
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]