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 22)
Currently displaying revision
22
,
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 #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 BuildRequires: httpd php %endif Requires: perl-Socket6 %description NfSen is a graphical web based front end for the nfdump netflow tools. %prep ##setup -n %{name}-%{pkgversion} ##patch0 ##patch1 %setup -c -T %build # user netflow #if [ -z "`%__grep "^netflow" /etc/passwd 2>/dev/null`" ]; then # %{_sbindir}/useradd -c "netflow" -d %{_datadir}/nfsen -g www -r -s /bin/false netflow #fi %install #mkdir -p %{buildroot}%{_datadir} #mkdir -p %{buildroot}%{_sysconfdir} #mkdir -p %{buildroot}%{_localstatedir} #mkdir -p %{buildroot}/srv/www/htdocs #export DESTDIR=%{buildroot} #./install.pl %{S:1} #rm -f %{buildroot}/srv/www/htdocs/nfsen/nfsen.php.orig #rm -f %{buildroot}/usr/share/nfsen/libexec/NfSenRC.pm.orig # remove buildroot from files #for FILE in %{buildroot}/srv/www/htdocs/nfsen/conf.php %{buildroot}/usr/bin/RebuildHierarchy.pl %{buildroot}/usr/bin/nfsen %{buildroot}/usr/bin/nfsend %{buildroot}/usr/bin/testPlugin %{buildroot}/usr/share/nfsen/libexec/NfConf.pm ; do # sed -i s@"%{buildroot}"@@g $FILE #done %if 0%{?suse_version} %__install -D -m0755 %{S:3} %{buildroot}%{_sysconfdir}/init.d/nfsen %__install -d -m0755 %{buildroot}%{_sbindir} ln -sf ../../%{_sysconfdir}/init.d/nfsen %{buildroot}%{_sbindir}/rcnfsen %endif %__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 -rf %{_datadir}/nfsen/{libexec,plugins} /srv/www/htdocs/nfsen rm -rf %{_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 %if 0%{?suse_version} %{_sysconfdir}/init.d/nfsen %{_sbindir}/rcnfsen %endif ##%dir %{_sysconfdir}/nfsen ##%dir /srv/www/htdocs/nfsen ##%dir /srv/www/htdocs/nfsen/css ##%dir /srv/www/htdocs/nfsen/icons ##%dir /srv/www/htdocs/nfsen/js ##%dir /srv/www/htdocs/nfsen/plugins ##%dir %{_datadir}/nfsen ##%dir %{_datadir}/nfsen/libexec ##%dir %{_datadir}/nfsen/plugins ##%defattr(-,netflow,www) ##%dir %{_datadir}/nfsen/profiles-data ##%dir %{_datadir}/nfsen/profiles-data/live ##%dir %{_datadir}/nfsen/profiles-data/live/rt01 ##%dir %{_datadir}/nfsen/profiles-data/live/rt02 ##%dir %{_datadir}/nfsen/profiles-stat ##%dir %{_datadir}/nfsen/profiles-stat/live ##%defattr(-,root,root) ##%config %{_sysconfdir}/nfsen/nfsen-dist.conf ##%config(noreplace) %{_sysconfdir}/nfsen/nfsen.conf ##/srv/www/htdocs/nfsen/alerting.php ##/srv/www/htdocs/nfsen/colour_palette.html ##/srv/www/htdocs/nfsen/colour_picker.html ##/srv/www/htdocs/nfsen/conf.php ##/srv/www/htdocs/nfsen/css/alerting.css ##/srv/www/htdocs/nfsen/css/detail.css ##/srv/www/htdocs/nfsen/css/lookup.css ##/srv/www/htdocs/nfsen/css/nfsen.css ##/srv/www/htdocs/nfsen/css/profileadmin.css ##/srv/www/htdocs/nfsen/details.php ##/srv/www/htdocs/nfsen/icons/EmptyGraph.png ##/srv/www/htdocs/nfsen/icons/Error.png ##/srv/www/htdocs/nfsen/icons/ErrorGraph.png ##/srv/www/htdocs/nfsen/icons/arrow.blue.down.png ##/srv/www/htdocs/nfsen/icons/arrow.blue.right.png ##/srv/www/htdocs/nfsen/icons/arrow.yellow.down.png ##/srv/www/htdocs/nfsen/icons/arrow.yellow.right.png ##/srv/www/htdocs/nfsen/icons/cancel.png ##/srv/www/htdocs/nfsen/icons/close.png ##/srv/www/htdocs/nfsen/icons/cursor-line.png ##/srv/www/htdocs/nfsen/icons/cursor-start.png ##/srv/www/htdocs/nfsen/icons/cursor-stop.png ##/srv/www/htdocs/nfsen/icons/edit.png ##/srv/www/htdocs/nfsen/icons/help.png ##/srv/www/htdocs/nfsen/icons/invisible.png ##/srv/www/htdocs/nfsen/icons/minus.png ##/srv/www/htdocs/nfsen/icons/ok.png ##/srv/www/htdocs/nfsen/icons/plus.png ##/srv/www/htdocs/nfsen/icons/progress.png ##/srv/www/htdocs/nfsen/icons/save.png ##/srv/www/htdocs/nfsen/icons/shade.gif ##/srv/www/htdocs/nfsen/icons/shade.png ##/srv/www/htdocs/nfsen/icons/shadeactive.png ##/srv/www/htdocs/nfsen/icons/space.png ##/srv/www/htdocs/nfsen/icons/spyglas.png ##/srv/www/htdocs/nfsen/icons/trash.png ##/srv/www/htdocs/nfsen/icons/trigger.png ##/srv/www/htdocs/nfsen/js/ColorPicker2.js ##/srv/www/htdocs/nfsen/js/alerting.js ##/srv/www/htdocs/nfsen/js/detail.js ##/srv/www/htdocs/nfsen/js/global.js ##/srv/www/htdocs/nfsen/js/menu.js ##/srv/www/htdocs/nfsen/js/profileadmin.js ##/srv/www/htdocs/nfsen/lookup.php ##/srv/www/htdocs/nfsen/navigator.php ##/srv/www/htdocs/nfsen/nfsen.php ##/srv/www/htdocs/nfsen/nfsenutil.php ##/srv/www/htdocs/nfsen/overview.php ##/srv/www/htdocs/nfsen/pic.php ##/srv/www/htdocs/nfsen/plugins/demoplugin.php ##/srv/www/htdocs/nfsen/process.php ##/srv/www/htdocs/nfsen/profileadmin.php ##/srv/www/htdocs/nfsen/rrdgraph.php ##%{_bindir}/RebuildHierarchy.pl ##%{_bindir}/nfsen ##%{_bindir}/nfsend ##%{_bindir}/testPlugin ##%{_datadir}/nfsen/libexec/Log.pm ##%{_datadir}/nfsen/libexec/Lookup.pm ##%{_datadir}/nfsen/libexec/NfAlert.pm ##%{_datadir}/nfsen/libexec/NfConf.pm ##%{_datadir}/nfsen/libexec/NfProfile.pm ##%{_datadir}/nfsen/libexec/NfSen.pm ##%{_datadir}/nfsen/libexec/NfSenRC.pm ##%{_datadir}/nfsen/libexec/NfSenRRD.pm ##%{_datadir}/nfsen/libexec/NfSenSim.pm ##%{_datadir}/nfsen/libexec/Nfcomm.pm ##%{_datadir}/nfsen/libexec/Nfsources.pm ##%{_datadir}/nfsen/libexec/Notification.pm ##%{_datadir}/nfsen/libexec/AbuseWhois.pm ##%{_datadir}/nfsen/libexec/Nfsync.pm ##%{_datadir}/nfsen/plugins/demoplugin.pm ##%{_datadir}/nfsen/plugins/smily.jpg ##%defattr(-,netflow,www) ##%{_datadir}/nfsen/profiles-data/live/rt01/.nfstat ##%{_datadir}/nfsen/profiles-data/live/rt02/.nfstat ##%{_datadir}/nfsen/profiles-stat/hints ##%{_datadir}/nfsen/profiles-stat/live/flows-day.png ##%{_datadir}/nfsen/profiles-stat/live/flows-month.png ##%{_datadir}/nfsen/profiles-stat/live/flows-week.png ##%{_datadir}/nfsen/profiles-stat/live/flows-year.png ##%{_datadir}/nfsen/profiles-stat/live/packets-day.png ##%{_datadir}/nfsen/profiles-stat/live/packets-month.png ##%{_datadir}/nfsen/profiles-stat/live/packets-week.png ##%{_datadir}/nfsen/profiles-stat/live/packets-year.png ##%{_datadir}/nfsen/profiles-stat/live/profile.dat ##%{_datadir}/nfsen/profiles-stat/live/rt01.rrd ##%{_datadir}/nfsen/profiles-stat/live/rt02.rrd ##%{_datadir}/nfsen/profiles-stat/live/traffic-day.png ##%{_datadir}/nfsen/profiles-stat/live/traffic-month.png ##%{_datadir}/nfsen/profiles-stat/live/traffic-week.png ##%{_datadir}/nfsen/profiles-stat/live/traffic-year.png %changelog