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