# You can compile this without postgresql support by running: # rpmbuild -ba bandwidthd.spec --without pgsql Name: bandwidthd Version: 2.0.1.1 Release: 4%{?dist} Summary: Tracks network usage and builds html and graphs Group: System Environment/Daemons License: GPL+ URL: http://bandwidthd.sourceforge.net/ Source0: bandwidthd-2.0.1.1.tgz Source1: %{name} Patch0: bandwidthd-destdir.patch Patch1: bandwidthd-pgsql.patch Patch2: bandwidthd-mysql.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" || "0%{?dist}" == "0.RHL4" BuildRequires: libpcap %else BuildRequires: libpcap-devel %endif BuildRequires: bison, flex BuildRequires: mysql-devel 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 %patch2 -p1 #-b .mysql %build cp -af /usr/lib/rpm/config.{sub,guess} . autoheader autoconf %configure --prefix=%{_prefix} \ --exec_prefix=%{_prefix} \ --sysconfdir=%{_sysconfdir} \ --bindir=%{_bindir} \ --localstatedir=%{_var}/www\ --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/*.gif # prepare for mysql #cp phphtdocs/*.php phphtdocs/*.conf phphtdocs/*.sh $RPM_BUILD_ROOT/var/www/%{name}/htdocs/ cp -a phphtdocs $RPM_BUILD_ROOT/var/www/%{name}/ %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} %attr(755,admin,www) %{_var}/www/%{name}/phphtdocs/*.php %attr(755,admin,www) %{_var}/www/%{name}/phphtdocs/*.conf %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}/* %attr(755,root,root) %{_var}/www/%{name}/phphtdocs/*.sh %changelog * Sat Sep 19 2015 stephane de Labrusse - 2.0.1.1-4 - Initial Import to sme9contribs - corrected the failed patch bandwidthd-mysql.patch * Sun Dec 29 2013 JP Pialasse - 2.0.1.1-2 - adapted for SME8 - initial import * Sat Mar 12 2011 JP Pialasse - 2.0.1.1-1 - updated to CVS on 2005 sep 26 with mysql support patch - added back autoconf and autoheader - cond buid for rhel4 * 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