You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
139 lines
4.5 KiB
139 lines
4.5 KiB
## |
|
## softflowd.spec -- OpenPKG RPM Package Specification |
|
## Copyright (c) 2000-2022 OpenPKG Project <http://openpkg.org/> |
|
## |
|
## 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: softflowd |
|
Summary: NetFlow-capable Network Traffic Analyser |
|
URL: http://www.mindrot.org/softflowd.html |
|
Vendor: Damien Miller |
|
Packager: OpenPKG Project |
|
Distribution: OpenPKG Community |
|
Class: PLUS |
|
Group: Auditing |
|
License: BSD |
|
Version: 0.9.8 |
|
Release: 20080101 |
|
|
|
# package options |
|
%option with_fsl yes |
|
|
|
# list of sources |
|
Source0: http://www.mindrot.org/files/softflowd/softflowd-%{version}.tar.gz |
|
Source1: rc.softflowd |
|
Source2: fsl.softflowd |
|
|
|
# build information |
|
BuildPreReq: OpenPKG, openpkg >= 20160101, gcc, make |
|
PreReq: OpenPKG, openpkg >= 20160101 |
|
%if "%{with_fsl}" == "yes" |
|
BuildPreReq: fsl |
|
PreReq: fsl |
|
%endif |
|
BuildPreReq: libpcap |
|
PreReq: libpcap |
|
|
|
%description |
|
Softflowd is flow-based network traffic analyser capable of Cisco |
|
NetFlow data export. softflowd supports data export using versions |
|
1, 5 or 9 of the NetFlow protocol. Softflowd semi-statefully tracks |
|
traffic flows recorded by listening on a network interface or by |
|
reading a packet capture file. These flows may be reported via |
|
NetFlow to a collecting host or summarised within Softflowd itself. |
|
|
|
%track |
|
prog softflowd = { |
|
version = %{version} |
|
url = http://www.mindrot.org/softflowd.html |
|
regex = softflowd-(__VER__)\.tar\.gz |
|
} |
|
|
|
%prep |
|
%setup -q |
|
|
|
%build |
|
# configure program |
|
%{l_shtool} subst \ |
|
-e 's;/var/run/;%{l_prefix}/var/softflowd/;g' \ |
|
common.h |
|
%{l_shtool} subst \ |
|
-e 's;/var/empty;%{l_prefix}/var/softflowd/empty;g' \ |
|
-e 's;nobody;%{l_nusr};g' \ |
|
softflowd.h |
|
CC="%{l_cc}" \ |
|
CFLAGS="%{l_cflags -O}" \ |
|
CPPFLAGS="%{l_cppflags}" \ |
|
LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \ |
|
LIBS="%{l_fsl_libs}" \ |
|
./configure \ |
|
--prefix=%{l_prefix} |
|
|
|
# build program |
|
%{l_make} %{l_mflags -O} |
|
|
|
%install |
|
# create installation hierarchy |
|
%{l_shtool} mkdir -f -p -m 755 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
|
$RPM_BUILD_ROOT%{l_prefix}/etc/fsl \ |
|
$RPM_BUILD_ROOT%{l_prefix}/sbin \ |
|
$RPM_BUILD_ROOT%{l_prefix}/man/man8 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/var/softflowd/empty |
|
|
|
# install program and manual pages |
|
%{l_shtool} install -c -s -m 755 \ |
|
softflowd softflowctl $RPM_BUILD_ROOT%{l_prefix}/sbin/ |
|
%{l_shtool} install -c -m 644 \ |
|
softflowd.8 softflowctl.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ |
|
|
|
# install run-command script |
|
%{l_shtool} install -c -m 755 %{l_value -s -a} \ |
|
%{SOURCE rc.softflowd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
|
|
|
# install OSSP fsl configuration |
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \ |
|
%{SOURCE fsl.softflowd} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ |
|
|
|
# determine installation files |
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
|
%{l_files_std} \ |
|
'%config %{l_prefix}/etc/fsl/fsl.softflowd' \ |
|
'%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/softflowd/empty' |
|
|
|
%files -f files |
|
|
|
%clean |
|
|
|
%post |
|
# after upgrade, restart service |
|
[ $1 -eq 2 ] || exit 0 |
|
eval `%{l_rc} softflowd status 2>/dev/null` |
|
[ ".$softflowd_active" = .yes ] && %{l_rc} softflowd restart |
|
exit 0 |
|
|
|
%preun |
|
# before erase, stop service and remove log files |
|
[ $1 -eq 0 ] || exit 0 |
|
%{l_rc} softflowd stop 2>/dev/null |
|
rm -f $RPM_INSTALL_PREFIX/var/softflowd/* >/dev/null 2>&1 || true |
|
exit 0 |
|
|
|
|