Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2:PowerPC
ntop
ntop.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ntop.spec of Package ntop
# # spec file for package ntop # # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: ntop Version: 4.1.0 Release: 0 Summary: Web-Based Network Traffic Monitor License: GPL-2.0+ Group: Productivity/Networking/Diagnostic Url: http://www.ntop.org %define pkg_user ntop %define pkg_home /var/lib/%{name} %define xorg_libdir %{_libdir} Requires: logrotate # TODO: Use the files from the GeoIP package to avoid duplicate work # and wasting space #TODO: Requires: GeoIP #TODO: BuildRequires: GeoIP BuildRequires: freetype2-devel BuildRequires: gcc-c++ BuildRequires: gd-devel BuildRequires: gdbm-devel BuildRequires: gzip BuildRequires: libart_lgpl-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel BuildRequires: libtool BuildRequires: lsof BuildRequires: lua-devel BuildRequires: mysql-devel BuildRequires: net-snmp-devel BuildRequires: openssl-devel BuildRequires: readline-devel # # openSUSE # %if 0%{?suse_version} BuildRequires: tcpd-devel BuildRequires: xorg-x11-devel PreReq: %fillup_prereq PreReq: %insserv_prereq PreReq: /bin/cat PreReq: sysconfig %if 0%{?suse_version} > 1100 BuildRequires: libevent-devel BuildRequires: libGeoIP-devel %else BuildRequires: libevent %endif %if 0%{?suse_version} > 1020 BuildRequires: fdupes BuildRequires: libpcap-devel BuildRequires: rrdtool-devel %else BuildRequires: libpcap BuildRequires: rrdtool %endif %endif # # Fedora # %if 0%{?fedora_version} BuildRequires: libpcap-devel BuildRequires: rrdtool-devel BuildRequires: xorg-x11-devel PreReq: /bin/cat PreReq: /bin/fillup PreReq: /sbin/insserv PreReq: sysconfig %endif # # Mandriva # %if 0%{?mandriva_version} BuildRequires: libpcap-devel BuildRequires: librrdtool-devel BuildRequires: rrdtool PreReq: /bin/cat PreReq: /bin/fillup PreReq: /sbin/insserv PreReq: sysconfig %endif Source: %{name}-%{version}.tar.bz2 Source1: ntop.logrotate Source2: rcntop Source3: rc.config.ntop Source4: passcheck.c Source5: README.SuSE Source6: etter.finger.os.gz Source10: ntop-rpmlintrc Patch0: ntop-disable_ethernet_fingerprint_database_download.patch Patch1: ntop-disable_darwin.patch Patch2: ntop-fix-manpage-errors.patch Patch3: ntop-dot-path.patch Patch4: ntop-fix-netflow-plugin-links.patch Patch5: ntop-default_user.patch Patch6: ntop-compile-fix.patch Patch7: ntop-python_fix.patch Patch8: ntop-fix-timestamp.patch Patch9: ntop-remove_ntop_safefree.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Ntop is a Web-based traffic monitor that shows network usage. It can be used in both interactive or Web mode using the embedded Web server. %prep %setup -q %patch0 -p1 %patch1 -p1 %patch2 -p0 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p0 %patch7 -p1 %patch8 -p1 %patch9 -p1 cp %{SOURCE6} . # fix/remove files with wrong encoding rm docs/RedHat-rpmbuild-HOWTO.txt rm docs/ntop-autotools.vsd docs/INSTALL rm -f docs/README.Suse cp %{SOURCE5} docs/README.Suse sed -i "s|||g" python/templates/rrdAlarmStart.tmpl chmod -x python/templates/rrdAlarmStart.tmpl # Remove build time references so build-compare can do its work modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")" DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\"" TIME="\"$(date -d "${modified}" "+%%H:%%M:%%S")\"" sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" configure.in %build # ntop wants to setup the files for the newer autoconf itself: ./autogen.sh \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --sysconfdir=%{_sysconfdir} \ --localstatedir=%{_localstatedir}/lib # now we are ready for the real configure... CFLAGS="%{optflags} -DHAVE_NCURSES_H %{?xorg_cflags} -fno-strict-aliasing" \ %configure \ --x-libraries=%{xorg_libdir} \ --disable-static \ --enable-sslv3 \ --enable-jumbo-frames \ --enable-snmp \ --enable-i18n make %{?_smp_mflags} gcc -o passcheck %{optflags} %{SOURCE4} -lgdbm %install %makeinstall install-man chmod 644 %{buildroot}%{_sysconfdir}/ntop/oui.txt.gz chmod 644 %{buildroot}%{_sysconfdir}/ntop/specialMAC.txt.gz # install init file and symlink mkdir -p %{buildroot}%{_sbindir} install -Dm 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/init.d/%{name} ln -sf ../../%{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name} # install fillup template for /etc/sysconfig install -Dm 644 %{SOURCE3} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name} install -m 755 passcheck %{buildroot}%{_sbindir}/passcheck mkdir -p %{buildroot}%{pkg_home}/rrd find %{buildroot}%{_datadir}/ntop/html -type f -print0 | xargs -0 chmod 644 %if 0%{?suse_version} > 1020 %fdupes %{buildroot}%{_datadir}/ntop/html/ %endif find %{buildroot} -name "*.la" -delete find %{buildroot}%{_libdir} -name "*.a" -delete # install /var/lib/ntop, so ntop can store it's databases mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}/rrd/{flows,graphics,interfaces} # install logrotate script install -Dm644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} # TODO: link to GeoIP databases # extract the files in %%{_sysconfdir}/%%{name} as ntop expects them uncompressed gunzip %{buildroot}%{_sysconfdir}/%{name}/*.gz %pre /usr/sbin/groupadd -r %{pkg_user} &>/dev/null ||: /usr/sbin/useradd -g %{pkg_user} -s /bin/false -r -c "user for %{pkg_user}" -d %{pkg_home} %{pkg_user} &>/dev/null ||: %preun %if 0%{?suse_version} > 1020 %stop_on_removal %{name} %endif %post %{fillup_and_insserv ntop} # Are we in update mode? if [ ${1:-0} -gt 1 ]; then if [ -f etc/sysconfig/ntopd -a ! -L etc/sysconfig/ntopd ]; then echo "Renaming config file ntopd to ntop" mv etc/sysconfig/ntopd etc/sysconfig/ntop fi # change user wwwrun to user ntop sed -i -e 's/^[[:space:]]*NTOP_USER=\"wwwrun\"/NTOP_USER=\"ntop\"/' /etc/sysconfig/ntop chown -R %{pkg_user}:%{pkg_user} %{pkg_home}/rrd fi /sbin/ldconfig %postun %{insserv_cleanup} /sbin/ldconfig %files %defattr(-,root,root) %doc docs/* AUTHORS CONTENTS COPYING ChangeLog MANIFESTO NEWS PORTING %doc SUPPORT_NTOP.txt THANKS %{_bindir}/ntop %{_sbindir}/rcntop %{_sbindir}/passcheck %{_libdir}/lib*.so %dir %{_libdir}/ntop %{_libdir}/ntop/plugins %{_mandir}/man8/ntop.8.* %{_localstatedir}/adm/fillup-templates/sysconfig.%{name} # make suggests us to own the directory for the ntop user, # but at the moment everything runs as expected. # do not switch until you really know that you need it: #%%dir %%attr(-,%%{pkg_user},%%{pkg_user}) %%{_datadir}/%%{name} %dir %{_datadir}/%{name} %{_datadir}/ntop/html %{_datadir}/ntop/python %dir %{_sysconfdir}/ntop %config(noreplace) %{_sysconfdir}/%{name}/* %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config %{_sysconfdir}/init.d/ntop %%attr(-,%{pkg_user},%{pkg_user}) %dir %{_localstatedir}/lib/%{name} %%attr(-,%{pkg_user},%{pkg_user}) %dir %{_localstatedir}/lib/%{name}/rrd %%attr(-,%{pkg_user},%{pkg_user}) %dir %{_localstatedir}/lib/%{name}/rrd/* %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor