3 Summary: Shaperd - bandwidth limiting
4 Summary(pl.UTF-8): Shaperd - dzielenie łącza
9 Group: Networking/Admin
10 #Source0: http://sp9wun.republika.pl/prg/%{name}.%{version}.tar.gz
11 # Changed source to decrease traffic at republika.pl
12 Source0: http://www.cbq.trzepak.net/prg/%{name}.%{version}.tar.gz
13 # Source0-md5: d501a4a8238fd993f0d863747886cca4
16 Patch0: %{name}-fhs.patch
17 Patch1: %{name}-iptables_path.patch
18 #URL: http://sp9wun.republika.pl/linux/shaperd_cbq.html
19 URL: http://www.cbq.trzepak.net/linux/shaperd_cbq.html
20 BuildRequires: rpmbuild(macros) >= 1.268
21 Requires(post,preun): /sbin/chkconfig
22 Requires: firewall-userspace-tool
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 %define _phpdir %{_datadir}/%{name}
27 %define _sysconfdir /etc/shaper
28 %define _apache1dir /etc/apache
29 %define _apache2dir /etc/httpd
32 This program limits bandwidth on the ethernet/ppp interface and
33 divides it between the hosts in the local network.
35 %description -l pl.UTF-8
36 Program potrafi ograniczać przepustowość interfejsu ethernet/ppp oraz
37 dzielić dostępne pasmo pomiędzy komputery w sieci lokalnej.
40 Summary: PHP script for shaperd
41 Summary(pl.UTF-8): Skrypt PHP dla shaperd
42 Group: Networking/Admin
43 Requires: %{name} = %{version}-%{release}
45 Requires: webserver(php)
48 PHP script for shaperd.
50 %description php -l pl.UTF-8
51 Skrypt PHP dla shaperd.
63 rm -rf $RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir},/etc/rc.d/init.d,/var/lib/shaper,%{_phpdir},/etc/httpd}
66 install src/shaperd $RPM_BUILD_ROOT%{_sbindir}
67 install scripts/kto-daemon $RPM_BUILD_ROOT%{_sbindir}
68 install config/* $RPM_BUILD_ROOT%{_sysconfdir}
69 install scripts/kto.php $RPM_BUILD_ROOT%{_phpdir}/shaperd.php
70 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/shaperd
71 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache-%{name}.conf
74 rm -rf $RPM_BUILD_ROOT
77 /sbin/chkconfig --add shaperd
78 %service shaperd restart "shaperd daemon"
81 if [ "$1" = "0" ]; then
83 /sbin/chkconfig --del shaperd
88 if [ -d %{_apache1dir}/conf.d ]; then
89 ln -sf %{_sysconfdir}/apache-%{name}.conf %{_apache1dir}/conf.d/99_%{name}.conf
90 %service -q apache restart
93 if [ -d %{_apache2dir}/httpd.conf ]; then
94 ln -sf %{_sysconfdir}/apache-%{name}.conf %{_apache2dir}/httpd.conf/99_%{name}.conf
95 %service -q httpd restart
99 if [ "$1" = "0" ]; then
101 if [ -d %{_apache1dir}/conf.d ]; then
102 rm -f %{_apache1dir}/conf.d/99_%{name}.conf
103 %service -q apache reload
106 if [ -d %{_apache2dir}/httpd.conf ]; then
107 rm -f %{_apache2dir}/httpd.conf/99_%{name}.conf
108 %service -q httpd reload
113 %defattr(644,root,root,755)
114 %doc doc/shaperd_cbq.html
115 %doc doc/shaperd_cbq_en.html
117 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/[iqs]*
118 %attr(755,root,root) %{_sbindir}/shaperd
119 %attr(754,root,root) /etc/rc.d/init.d/shaperd
123 %defattr(644,root,root,755)
124 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache-%{name}.conf
126 %attr(755,root,root) %{_sbindir}/kto-daemon
127 %{_phpdir}/shaperd.php