1 |
brianr |
1.1 |
# You can compile this without postgresql support by running: |
2 |
|
|
# rpmbuild -ba bandwidthd.spec --without pgsql |
3 |
|
|
|
4 |
|
|
Name: bandwidthd |
5 |
|
|
Version: 2.0.1.1 |
6 |
|
|
Release: 4%{?dist} |
7 |
|
|
Summary: Tracks network usage and builds html and graphs |
8 |
|
|
|
9 |
|
|
Group: System Environment/Daemons |
10 |
|
|
License: GPL+ |
11 |
|
|
URL: http://bandwidthd.sourceforge.net/ |
12 |
|
|
Source0: bandwidthd-2.0.1.1.tgz |
13 |
|
|
Source1: %{name} |
14 |
|
|
Patch0: bandwidthd-destdir.patch |
15 |
|
|
Patch1: bandwidthd-pgsql.patch |
16 |
|
|
Patch2: bandwidthd-mysql.patch |
17 |
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
18 |
|
|
BuildRequires: autoconf, gd-devel, libpng-devel |
19 |
|
|
%{?!_without_pgsql:BuildRequires: postgresql-devel} |
20 |
|
|
%if "0%{?dist}" == "0.el4" || "0%{?dist}" == "0.RHL4" |
21 |
|
|
BuildRequires: libpcap |
22 |
|
|
%else |
23 |
|
|
BuildRequires: libpcap-devel |
24 |
|
|
%endif |
25 |
|
|
BuildRequires: bison, flex |
26 |
|
|
BuildRequires: mysql-devel |
27 |
|
|
Requires(post): /sbin/chkconfig |
28 |
|
|
Requires(preun):/sbin/chkconfig |
29 |
|
|
Requires(preun):/sbin/service |
30 |
|
|
|
31 |
|
|
%description |
32 |
|
|
Bandwidthd is a UNIX daemon/Windows service for graphing the traffic |
33 |
|
|
generated by each machine on several configurable subnets. It is much |
34 |
|
|
easier to configure than MRTG, and provides significantly more useful |
35 |
|
|
information. MRTG only tells you how much bandwidth you are using, |
36 |
|
|
Bandwidthd tells you that, and who is using it. |
37 |
|
|
|
38 |
|
|
Each IP address that has moved any significant volume of traffic has its |
39 |
|
|
own graph. The graphs are color coded to help you figure out at a glance |
40 |
|
|
if your user is surfing the web, or surfing Kazaa. |
41 |
|
|
|
42 |
|
|
Bandwidthd is targeted to run on my routing platforms. It is very low |
43 |
|
|
overhead. Easily graphing small business traffic on a 133Mhz Elan 486 |
44 |
|
|
every 2.5 minutes. My entire ISP (2000-3000 IP addresses across 4 states) |
45 |
|
|
is graphed on a Celeron 450 every 10 minutes. |
46 |
|
|
|
47 |
|
|
|
48 |
|
|
%prep |
49 |
|
|
%setup -q |
50 |
|
|
%patch0 -p1 |
51 |
|
|
#-b .dest |
52 |
|
|
%patch1 -p0 |
53 |
|
|
#-b .pgsql |
54 |
|
|
%patch2 -p1 |
55 |
|
|
#-b .mysql |
56 |
|
|
|
57 |
|
|
%build |
58 |
|
|
cp -af /usr/lib/rpm/config.{sub,guess} . |
59 |
|
|
autoheader |
60 |
|
|
autoconf |
61 |
|
|
%configure --prefix=%{_prefix} \ |
62 |
|
|
--exec_prefix=%{_prefix} \ |
63 |
|
|
--sysconfdir=%{_sysconfdir} \ |
64 |
|
|
--bindir=%{_bindir} \ |
65 |
|
|
--localstatedir=%{_var}/www\ |
66 |
|
|
--datadir=%{_var}/www |
67 |
|
|
make %{?_smp_mflags} |
68 |
|
|
|
69 |
|
|
|
70 |
|
|
%install |
71 |
|
|
rm -rf $RPM_BUILD_ROOT |
72 |
|
|
make install DESTDIR=$RPM_BUILD_ROOT |
73 |
|
|
# init script |
74 |
|
|
install -d $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d |
75 |
|
|
install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/ |
76 |
|
|
# install apache configuration |
77 |
|
|
install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d |
78 |
|
|
echo "Alias /%{name} %{_var}/www/%{name}/htdocs" \ |
79 |
|
|
> $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf |
80 |
|
|
# remove execute bit for gif and sh script without #! |
81 |
|
|
chmod -x phphtdocs/*.gif |
82 |
|
|
|
83 |
|
|
# prepare for mysql |
84 |
|
|
#cp phphtdocs/*.php phphtdocs/*.conf phphtdocs/*.sh $RPM_BUILD_ROOT/var/www/%{name}/htdocs/ |
85 |
|
|
cp -a phphtdocs $RPM_BUILD_ROOT/var/www/%{name}/ |
86 |
|
|
|
87 |
|
|
%clean |
88 |
|
|
rm -rf $RPM_BUILD_ROOT |
89 |
|
|
|
90 |
|
|
|
91 |
|
|
%post |
92 |
|
|
/sbin/chkconfig --add bandwidthd |
93 |
|
|
|
94 |
|
|
%preun |
95 |
|
|
if [ $1 = 0 ]; then |
96 |
|
|
/sbin/service bandwidthd stop > /dev/null 2>&1 |
97 |
|
|
/sbin/chkconfig --del bandwidthd |
98 |
|
|
fi |
99 |
|
|
|
100 |
|
|
|
101 |
|
|
%files |
102 |
|
|
%defattr(-,root,root,-) |
103 |
|
|
%doc README CHANGELOG TODO |
104 |
|
|
%{?!_without_pgsql:%doc phphtdocs} |
105 |
|
|
%attr(755,admin,www) %{_var}/www/%{name}/phphtdocs/*.php |
106 |
|
|
%attr(755,admin,www) %{_var}/www/%{name}/phphtdocs/*.conf |
107 |
|
|
%config(noreplace) %{_sysconfdir}/%{name}.conf |
108 |
|
|
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf |
109 |
|
|
%attr(755,root,root) %{_sysconfdir}/rc.d/init.d/%{name} |
110 |
|
|
%{_sbindir}/%{name} |
111 |
|
|
%dir %{_var}/www/%{name} |
112 |
|
|
%{_var}/www/%{name}/* |
113 |
|
|
%attr(755,root,root) %{_var}/www/%{name}/phphtdocs/*.sh |
114 |
|
|
|
115 |
|
|
%changelog |
116 |
|
|
* Sat Sep 19 2015 stephane de Labrusse <stephdl@de-labrusse.fr> - 2.0.1.1-4 |
117 |
|
|
- Initial Import to sme9contribs |
118 |
|
|
- corrected the failed patch bandwidthd-mysql.patch |
119 |
|
|
|
120 |
|
|
* Sun Dec 29 2013 JP Pialasse <tests@pialasse.com> - 2.0.1.1-2 |
121 |
|
|
- adapted for SME8 |
122 |
|
|
- initial import |
123 |
|
|
|
124 |
|
|
* Sat Mar 12 2011 JP Pialasse <tests@pialasse.com> - 2.0.1.1-1 |
125 |
|
|
- updated to CVS on 2005 sep 26 with mysql support patch |
126 |
|
|
- added back autoconf and autoheader |
127 |
|
|
- cond buid for rhel4 |
128 |
|
|
|
129 |
|
|
* Sun Dec 13 2008 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-11 |
130 |
|
|
- updated config.sub and config.guess to build on ppc64 |
131 |
|
|
- added libpng-devel again (required for EPEL-4) |
132 |
|
|
|
133 |
|
|
* Sat Dec 13 2008 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-8 |
134 |
|
|
- removed dependency on gd |
135 |
|
|
- removed one line of autoconf |
136 |
|
|
- removed dependency on libpng-devel |
137 |
|
|
- phphtdocs added for pgsql build, execute bit for gif and sh removed |
138 |
|
|
|
139 |
|
|
* Mon Dec 8 2008 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-7 |
140 |
|
|
- changed License to GPL+ |
141 |
|
|
|
142 |
|
|
* Mon Dec 8 2008 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-6 |
143 |
|
|
- buildroot macro replaced by RPM_BUILD_ROOT variable |
144 |
|
|
- added autoconf into build-requires |
145 |
|
|
- by default compiled with postgresql support |
146 |
|
|
- conditional build without postgresql (--without pgsql) |
147 |
|
|
- libpng removed from requires |
148 |
|
|
|
149 |
|
|
* Mon Dec 8 2008 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-5 |
150 |
|
|
- conditional build for el4 |
151 |
|
|
|
152 |
|
|
* Sun Sep 9 2007 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> - 2.0.1-4 |
153 |
|
|
- updated license and summary |
154 |
|
|
- changed init script permissions |
155 |
|
|
|
156 |
|
|
* Tue Mar 13 2007 Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> |
157 |
|
|
- updated from version by Michal Ambroz <rebus@seznam.cz> |
158 |
|
|
- added apache configuration script |
159 |
|
|
- moved into /var/www/bandwidthd |
160 |
|
|
- spec file name typo fixed |