6a9de42
# You can compile this without postgresql support by running:
6a9de42
# rpmbuild -ba bandwidthd.spec --without pgsql
6a9de42
6a9de42
Name:           bandwidthd
6a9de42
Version:        2.0.1
Jan ONDREJ (SAL) 71eb787
Release:        29%{?dist}
6a9de42
Summary:        Tracks network usage and builds html and graphs
6a9de42
6a9de42
Group:          System Environment/Daemons
6a9de42
License:        GPL+
6a9de42
URL:            http://bandwidthd.sourceforge.net/
6a9de42
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tgz
Jan ONDREJ (SAL) 4dbe46d
Source1:        %{name}
Jan ONDREJ (SAL) 4dbe46d
Source2:        %{name}.service
6a9de42
Patch0:         bandwidthd-destdir.patch
6a9de42
Patch1:         bandwidthd-pgsql.patch
Jan ONDREJ (SAL) 4dbe46d
Patch2:         http://v3.sk/~lkundrak/0001-Gracefuly-exit-upon-pcap_findalldevs-error.patch
Jan ONDREJ (SAL) ad32d18
Patch3:         bandwidthd-gcc5.patch
6a9de42
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
9489057
BuildRequires:  autoconf, gd-devel, libpng-devel
6a9de42
%{?!_without_pgsql:BuildRequires: postgresql-devel}
6a9de42
%if "0%{?dist}" == "0.el4"
6a9de42
BuildRequires:  libpcap
6a9de42
%else
6a9de42
BuildRequires:  libpcap-devel
6a9de42
%endif
Jan ONDREJ (SAL) c804b8c
%if 0%{?fedora} || 0%{?rhel} > 6
Jan ONDREJ (SAL) c804b8c
Requires(post): systemd-units
Jan ONDREJ (SAL) c804b8c
Requires(preun): systemd-units
Jan ONDREJ (SAL) c804b8c
Requires(postun): systemd-units
Jan ONDREJ (SAL) c804b8c
BuildRequires: systemd-units
Jan ONDREJ (SAL) c804b8c
%else
6a9de42
Requires(post): /sbin/chkconfig
6a9de42
Requires(preun):/sbin/chkconfig
6a9de42
Requires(preun):/sbin/service
Jan ONDREJ (SAL) 0ca5e66
%endif
6a9de42
6a9de42
%description
6a9de42
Bandwidthd is a UNIX daemon/Windows service for graphing the traffic
6a9de42
generated by each machine on several configurable subnets.  It is much
6a9de42
easier to configure than MRTG, and provides significantly more useful
6a9de42
information.  MRTG only tells you how much bandwidth you are using,
6a9de42
Bandwidthd tells you that, and who is using it.
6a9de42
6a9de42
Each IP address that has moved any significant volume of traffic has its
6a9de42
own graph.  The graphs are color coded to help you figure out at a glance
6a9de42
if your user is surfing the web, or surfing Kazaa.
6a9de42
6a9de42
Bandwidthd is targeted to run on my routing platforms.  It is very low
6a9de42
overhead.  Easily graphing small business traffic on a 133Mhz Elan 486
6a9de42
every 2.5 minutes. My entire ISP (2000-3000 IP addresses across 4 states)
6a9de42
is graphed on a Celeron 450 every 10 minutes.
6a9de42
6a9de42
6a9de42
%prep
6a9de42
%setup -q
6a9de42
%patch0 -p1 -b .dest
6a9de42
%patch1 -p0 -b .pgsql
08a6ebd
%patch2 -p1 -b .nodevs
Jan ONDREJ (SAL) ad32d18
%patch3 -p1 -b .gcc5
6a9de42
6a9de42
%build
d6a7434
cp -af /usr/lib/rpm/config.{sub,guess} .
6a9de42
autoconf
6a9de42
%configure --prefix=%{_prefix} \
6a9de42
  --exec-prefix=%{_prefix} \
6a9de42
  --sysconfdir=%{_sysconfdir} \
6a9de42
  --bindir=%{_bindir} \
6a9de42
  --datadir=%{_var}/www
Jan ONDREJ (SAL) ad32d18
make %{?_smp_mflags}
6a9de42
6a9de42
6a9de42
%install
6a9de42
rm -rf $RPM_BUILD_ROOT
6a9de42
make install DESTDIR=$RPM_BUILD_ROOT
6a9de42
# init script
6a9de42
install -d $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
Jan ONDREJ (SAL) 0ca5e66
%if 0%{?fedora} || 0%{?rhel} > 6
Jan ONDREJ (SAL) ceae8f1
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
Jan ONDREJ (SAL) 0ca5e66
install %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/
Jan ONDREJ (SAL) 0ca5e66
%else
6a9de42
install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/
Jan ONDREJ (SAL) 0ca5e66
%endif
6a9de42
# install apache configuration
6a9de42
install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
6a9de42
echo "Alias /%{name} %{_var}/www/%{name}/htdocs" \
6a9de42
  > $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf
6a9de42
# remove execute bit for gif and sh script without #!
6a9de42
chmod -x phphtdocs/*
6a9de42
6a9de42
6a9de42
%clean
6a9de42
rm -rf $RPM_BUILD_ROOT
6a9de42
6a9de42
6a9de42
%post
Jan ONDREJ (SAL) 92fdd5d
%systemd_post %{name}.service
6a9de42
6a9de42
%preun
Jan ONDREJ (SAL) 92fdd5d
%systemd_preun %{name}.service
6a9de42
Jan ONDREJ (SAL) c804b8c
%postun
Jan ONDREJ (SAL) 92fdd5d
%systemd_postun_with_restart %{name}.service
6a9de42
6a9de42
%files
6a9de42
%defattr(-,root,root,-)
6a9de42
%doc README CHANGELOG TODO
6a9de42
%{?!_without_pgsql:%doc phphtdocs}
6a9de42
%config(noreplace) %{_sysconfdir}/%{name}.conf
6a9de42
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
Jan ONDREJ (SAL) 0ca5e66
%if 0%{?fedora} || 0%{?rhel} > 6
Jan ONDREJ (SAL) 0ca5e66
%{_unitdir}/%{name}.service
Jan ONDREJ (SAL) 0ca5e66
%else
6a9de42
%attr(755,root,root) %{_sysconfdir}/rc.d/init.d/%{name}
Jan ONDREJ (SAL) 0ca5e66
%endif
6a9de42
%{_sbindir}/%{name}
6a9de42
%dir %{_var}/www/%{name}
6a9de42
%{_var}/www/%{name}/*
6a9de42
6a9de42
6a9de42
%changelog
Jan ONDREJ (SAL) 71eb787
* Wed Jun 17 2015 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-29
Jan ONDREJ (SAL) ad32d18
- GCC5 inline compatibility.
Jan ONDREJ (SAL) 71eb787
1c0b648
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-28
1c0b648
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
1c0b648
d17a783
* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-27
d17a783
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
d17a783
317163a
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-26
317163a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
317163a
Jan ONDREJ (SAL) 92fdd5d
* Fri Jan 10 2014 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-25
Jan ONDREJ (SAL) 92fdd5d
- Scriptlets replaced with new systemd macros (#850042)
Jan ONDREJ (SAL) 92fdd5d
  Thanks to Václav Pavlín.
Jan ONDREJ (SAL) 92fdd5d
5d23aad
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-24
5d23aad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
5d23aad
392f591
* Tue Jun 11 2013 Remi Collet <rcollet@redhat.com> - 2.0.1-23
392f591
- rebuild for new GD 2.1.0
392f591
Jan ONDREJ (SAL) 1881328
* Sat Mar 23 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-22
Jan ONDREJ (SAL) 1881328
- added autoreconf to prep section (bz#925079)
Jan ONDREJ (SAL) 1881328
0798812
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-21
0798812
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
0798812
9807068
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-20
9807068
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
9807068
5d9f611
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-19
5d9f611
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
5d9f611
Jan ONDREJ (SAL) 854377b
* Thu Nov 17 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-18
Jan ONDREJ (SAL) 854377b
- systemd pre/post scripts
Jan ONDREJ (SAL) 854377b
Jan ONDREJ (SAL) 6f5ffbb
* Wed Nov 16 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-17
Jan ONDREJ (SAL) 0ca5e66
- added native systemd service (bz#754478)
Jan ONDREJ (SAL) 0ca5e66
9fc75cd
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-16
9fc75cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
9fc75cd
08a6ebd
* Wed Dec 09 2009 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-15
08a6ebd
- Applied patch from lkundrak to do not hang when no devices found. bz#537073
08a6ebd
e9de88d
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-13
e9de88d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
e9de88d
9a071c1
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-12
9a071c1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
9a071c1
Jan ONDREJ (SAL) 92fdd5d
* Sat Dec 13 2008 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-11
d6a7434
- updated config.sub and config.guess to build on ppc64
9489057
- added libpng-devel again (required for EPEL-4)
d6a7434
6a9de42
* Sat Dec 13 2008 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-8
6a9de42
- removed dependency on gd
6a9de42
- removed one line of autoconf
6a9de42
- removed dependency on libpng-devel
6a9de42
- phphtdocs added for pgsql build, execute bit for gif and sh removed
6a9de42
6a9de42
* Mon Dec 8 2008 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-7
6a9de42
- changed License to GPL+
6a9de42
6a9de42
* Mon Dec 8 2008 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-6
6a9de42
- buildroot macro replaced by RPM_BUILD_ROOT variable
6a9de42
- added autoconf into build-requires
6a9de42
- by default compiled with postgresql support
6a9de42
- conditional build without postgresql (--without pgsql)
6a9de42
- libpng removed from requires
6a9de42
6a9de42
* Mon Dec 8 2008 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-5
6a9de42
- conditional build for el4
6a9de42
6a9de42
* Sun Sep 9 2007 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-4
6a9de42
- updated license and summary
6a9de42
- changed init script permissions
6a9de42
6a9de42
* Tue Mar 13 2007 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk>
6a9de42
- updated from version by Michal Ambroz <rebus@seznam.cz>
6a9de42
- added apache configuration script
6a9de42
- moved into /var/www/bandwidthd
6a9de42
- spec file name typo fixed