# You can compile this without postgresql support by running: # rpmbuild -ba bandwidthd.spec --without pgsql Name: bandwidthd Version: 2.0.1 Release: 11%{?dist} Summary: Tracks network usage and builds html and graphs Group: System Environment/Daemons License: GPL+ URL: http://bandwidthd.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tgz Source1: %{name} Patch0: bandwidthd-destdir.patch Patch1: bandwidthd-pgsql.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf, gd-devel, libpng-devel %{?!_without_pgsql:BuildRequires: postgresql-devel} %if "0%{?dist}" == "0.el4" BuildRequires: libpcap %else BuildRequires: libpcap-devel %endif Requires(post): /sbin/chkconfig Requires(preun):/sbin/chkconfig Requires(preun):/sbin/service %description Bandwidthd is a UNIX daemon/Windows service for graphing the traffic generated by each machine on several configurable subnets. It is much easier to configure than MRTG, and provides significantly more useful information. MRTG only tells you how much bandwidth you are using, Bandwidthd tells you that, and who is using it. Each IP address that has moved any significant volume of traffic has its own graph. The graphs are color coded to help you figure out at a glance if your user is surfing the web, or surfing Kazaa. Bandwidthd is targeted to run on my routing platforms. It is very low overhead. Easily graphing small business traffic on a 133Mhz Elan 486 every 2.5 minutes. My entire ISP (2000-3000 IP addresses across 4 states) is graphed on a Celeron 450 every 10 minutes. %prep %setup -q %patch0 -p1 -b .dest %patch1 -p0 -b .pgsql %build cp -af /usr/lib/rpm/config.{sub,guess} . autoconf %configure --prefix=%{_prefix} \ --exec-prefix=%{_prefix} \ --sysconfdir=%{_sysconfdir} \ --bindir=%{_bindir} \ --datadir=%{_var}/www make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT # init script install -d $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/ # install apache configuration install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d echo "Alias /%{name} %{_var}/www/%{name}/htdocs" \ > $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf # remove execute bit for gif and sh script without #! chmod -x phphtdocs/* %clean rm -rf $RPM_BUILD_ROOT %post /sbin/chkconfig --add bandwidthd %preun if [ $1 = 0 ]; then /sbin/service bandwidthd stop > /dev/null 2>&1 /sbin/chkconfig --del bandwidthd fi %files %defattr(-,root,root,-) %doc README CHANGELOG TODO %{?!_without_pgsql:%doc phphtdocs} %config(noreplace) %{_sysconfdir}/%{name}.conf %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf %attr(755,root,root) %{_sysconfdir}/rc.d/init.d/%{name} %{_sbindir}/%{name} %dir %{_var}/www/%{name} %{_var}/www/%{name}/* %changelog * Sun Dec 13 2008 Jan ONDREJ (SAL) - 2.0.1-11 - updated config.sub and config.guess to build on ppc64 - added libpng-devel again (required for EPEL-4) * Sat Dec 13 2008 Jan ONDREJ (SAL) - 2.0.1-8 - removed dependency on gd - removed one line of autoconf - removed dependency on libpng-devel - phphtdocs added for pgsql build, execute bit for gif and sh removed * Mon Dec 8 2008 Jan ONDREJ (SAL) - 2.0.1-7 - changed License to GPL+ * Mon Dec 8 2008 Jan ONDREJ (SAL) - 2.0.1-6 - buildroot macro replaced by RPM_BUILD_ROOT variable - added autoconf into build-requires - by default compiled with postgresql support - conditional build without postgresql (--without pgsql) - libpng removed from requires * Mon Dec 8 2008 Jan ONDREJ (SAL) - 2.0.1-5 - conditional build for el4 * Sun Sep 9 2007 Jan ONDREJ (SAL) - 2.0.1-4 - updated license and summary - changed init script permissions * Tue Mar 13 2007 Jan ONDREJ (SAL) - updated from version by Michal Ambroz - added apache configuration script - moved into /var/www/bandwidthd - spec file name typo fixed