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