Search
j0ke.net Open Build Service
>
Projects
>
server:monitoring
:
netflow
>
nfsen
> nfsen.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File nfsen.spec of Package nfsen (Revision 26)
Currently displaying revision
26
,
show latest
%define pkgversion 1.3.6p1 %define srcdir /usr/src %if 0%{?suse_version} %define _group www %else %define _group apache %endif Name: nfsen Version: 1.3.6.1 Release: 1 Summary: Netflow Sensor Group: Productivity/Networking Url: http://nfsen.sourceforge.net/ License: BSD Source0: %{name}-%{pkgversion}.tar.bz2 Source1: nfsen-rpm-suse.conf Source2: nfsen-rpm-rh.conf Source3: nfsen.init.suse Source4: nfsen-install-GetPerl.patch Source5: nfsen.init.rh #Patch0: nfsen-no-root.patch #Patch1: nfsen-no-seminit.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildArch: noarch BuildRequires: nfsen_prepare_build >= 0.1 BuildRequires: nfdump >= 1.6.5 BuildRequires: perl-MailTools BuildRequires: rrdtool %if 0%{?suse_version} BuildRequires: apache2-mod_php5 BuildRequires: php-sockets %else BuildRequires: httpd php %endif BuildRequires: perl-Socket6 BuildRequires: -post-build-checks Requires: nfdump >= 1.6.5 Requires: perl-MailTools Requires: rrdtool Requires: patch %if 0%{?suse_version} Requires: apache2-mod_php5 Requires: php-sockets %else Requires: httpd php Requires: rrdtool-perl %endif Requires: perl-Socket6 %description NfSen is a graphical web based front end for the nfdump netflow tools. %prep %setup -c -T %build %install %if 0%{?suse_version} %__install -D -m0755 %{S:3} %{buildroot}%{_sysconfdir}/init.d/nfsen %else %__install -D -m0755 %{S:5} %{buildroot}%{_sysconfdir}/init.d/nfsen %endif %__install -d -m0755 %{buildroot}%{_sbindir} ln -sf ../../%{_sysconfdir}/init.d/nfsen %{buildroot}%{_sbindir}/rcnfsen %__install -d -m0755 %{buildroot}%{srcdir} for src in %{S:0} %{S:1} %{S:2} %{S:4} ; do %__install -m0644 ${src} %{buildroot}%{srcdir}/ done %pre if [ $1 == 1 ] ; then if [ -z "`%__grep "^netflow" /etc/passwd 2>/dev/null`" ]; then %{_sbindir}/useradd -c "netflow" -d %{_datadir}/nfsen -g %{_group} -r -s /bin/false netflow fi fi %post # install if [ "$1" == "1" ] ; then cd %{srcdir} tar xfj %{name}-%{pkgversion}.tar.bz2 cd %{name}-%{pkgversion} patch -p0 < ../nfsen-install-GetPerl.patch %if 0%{?suse_version} ./install.pl ../nfsen-rpm-suse.conf %else ./install.pl ../nfsen-rpm-rh.conf %endif cd .. rm -rf %{name}-%{pkgversion} service nfsen start || : # upgrade elif [ "$1" == "2" ] ; then cd %{srcdir} tar xfj %{name}-%{pkgversion}.tar.bz2 cd %{name}-%{pkgversion} patch -p0 < ../nfsen-install-GetPerl.patch service nfsen stop || : if [ -f /etc/nfsen/nfsen.conf ] ; then ./install.pl /etc/nfsen/nfsen.conf else %if 0%{?suse_version} ./install.pl ../nfsen-rpm-suse.conf %else ./install.pl ../nfsen-rpm-rh.conf %endif fi service nfsen start || : cd .. rm -rf %{name}-%{pkgversion} fi %postun %if 0%{?suse_version} if [ "$1" == "0" ]; then %insserv_cleanup fi %endif %preun # upgrade if [ "$1" == "1" ] ; then : # uninstall elif [ "$1" == "0" ] ; then %if 0%{?suse_version} %stop_on_removal nfsen %else service nfsen stop || : %endif # do not delete profile-data & profile-state rm -rfv %{_datadir}/nfsen/{libexec,plugins} /srv/www/htdocs/nfsen rm -rfv %{_bindir}/nfsen* %{_bindir}/RebuildHierarchy.pl %{_bindir}/testPlugin fi %clean rm -rf %{buildroot} %files %defattr(-,root,root) %{srcdir}/%{name}-%{pkgversion}.tar.bz2 %{srcdir}/%{name}-rpm-*.conf %{srcdir}/nfsen-install-GetPerl.patch %{_sysconfdir}/init.d/nfsen %{_sbindir}/rcnfsen %changelog