]> git.pld-linux.org Git - packages/bandwidthd.git/blob - bandwidthd.spec
a79de3c5605ea58e48410e7338a0726a625cbe9a
[packages/bandwidthd.git] / bandwidthd.spec
1 Summary:        Network traffic tracking tool
2 Summary(pl):    Narzêdzie do ¶ledzenia ruchu sieciowego
3 Name:           bandwidthd
4 Version:        2.0.1
5 Release:        0.1
6 License:        GPL
7 Group:          Networking/Admin
8 Source0:        http://dl.sourceforge.net/bandwidthd/%{name}-%{version}.tgz
9 # Source0-md5:  aa79aad7bd489fd2cae1f7dc086ca8b6
10 Source1:        %{name}.init
11 Source2:        %{name}.sysconfig
12 Source3:        %{name}.conf
13 Patch0:         %{name}-makefile.patch
14 Patch1:         %{name}-pgsql.patch
15 Patch2:         %{name}-path.patch
16 URL:            http://bandwidthd.sourceforge.net/
17 BuildRequires:  autoconf
18 BuildRequires:  gd-devel
19 BuildRequires:  libpcap-devel
20 BuildRequires:  libpng-devel
21 PreReq:         rc-scripts
22 Requires(post,preun):   /sbin/chkconfig
23 Requires:       webserver
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %define         _htmldir        /home/services/httpd/html/bandwidthd
27
28 %description
29 BandwidthD tracks usage of TCP/IP network subnets and builds html
30 files with graphs to display utilization. Charts are built by
31 individual IPs, and by default display utilization over 2 day, 8 day,
32 40 day, and 400 day periods. Furthermore, each ip address's
33 utilization can be logged out at intervals of 3.3 minutes, 10 minutes,
34 1 hour or 12 hours in cdf format, or to a backend database server.
35 HTTP, TCP, UDP, ICMP, VPN, and P2P traffic are color coded.
36
37 %description -l pl
38 BandwidthD ¶ledzi u¿ycie sieci TCP/IP i buduje pliki HTML
39 wy¶wietlaj±ce ruch sieciowy. Wykresy pokazuj± IP u¿ytkowników i
40 domy¶lnie wy¶wietlaj± zu¿ycie na przestrzeni 2, 8, 40 i 400 dni.
41 Ponadto udzia³ ka¿dego adresu IP w ruchu sieciowym mo¿e byæ zapisywany
42 w przedzia³ach 3.3 minut, 10 minut, 1 godziny lub 12 godzin w formacie
43 cdf, albo zapisywany do bazy danych. Ruch HTTP, TCP, UDP, ICMP, VPN, i
44 P2P jest kodowany w ró¿nych kolorach.
45
46 %prep
47 %setup -q
48 %patch0 -p0
49 %patch1 -p0
50 %patch2 -p1
51
52 %build
53 %{__autoconf}
54 %{__autoheader}
55 %configure
56
57 %{__make}
58
59 %install
60 rm -rf $RPM_BUILD_ROOT
61 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},%{_htmldir},/etc/{sysconfig,rc.d/init.d,cron.d}}
62
63 install bandwidthd $RPM_BUILD_ROOT%{_sbindir}
64 install htdocs/* $RPM_BUILD_ROOT%{_htmldir}
65 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/bandwidthd
66 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/bandwidthd
67 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}
68
69 cat  << EOF > $RPM_BUILD_ROOT/etc/cron.d/bandwidthd
70 0 0 * * *      root    /bin/kill -HUP \`cat /var/run/bandwidthd.pid\`
71 EOF
72
73 %clean
74 rm -rf $RPM_BUILD_ROOT
75
76 %post
77 /sbin/chkconfig --add bandwidthd
78 if [ -f /var/lock/subsys/bandwidthd ]; then
79         /etc/rc.d/init.d/bandwidthd restart 1>&2
80 else
81         echo "Run \"/etc/rc.d/init.d/bandwidthd start\" to start bandwidthd."
82 fi
83
84 %preun
85 if [ "$1" = "0" ]; then
86         if [ -f /var/lock/subsys/bandwidthd ]; then
87         /etc/rc.d/init.d/bandwidthd stop 1>&2
88         fi
89         /sbin/chkconfig --del bandwidthd
90 fi
91
92 %files
93 %defattr(644,root,root,755)
94 %doc CHANGELOG README TODO
95 %attr(755,root,root) %{_sbindir}/bandwidthd
96 %dir %{_htmldir}
97 %{_htmldir}/*
98 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}.conf
99 %attr(755,root,root) /etc/rc.d/init.d/bandwidthd
100 %config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/bandwidthd
101 /etc/sysconfig/bandwidthd
This page took 0.048384 seconds and 2 git commands to generate.