1 %include /usr/lib/rpm/macros.perl
2 Summary: Smokeping - a latency grapher that uses rrdtool
3 Summary(pl.UTF-8): Smokeping - narzędzie do tworzenia wykresów opóźnień sieci
8 Group: Networking/Utilities
9 Source0: http://oss.oetiker.ch/smokeping/pub/%{name}-%{version}.tar.gz
10 # Source0-md5: eb8e7679fcad35e59d7c51f2328250a2
13 Source3: %{name}-config
14 Source4: %{name}-lighttpd.conf
15 URL: http://oss.oetiker.ch/smokeping/
16 BuildRequires: perl-tools-pod
17 BuildRequires: rpm-perlprov >= 4.1-13
18 BuildRequires: rpmbuild(macros) >= 1.268
19 BuildRequires: sed >= 4.0
20 Requires(post): sed >= 4.0
21 Requires(post,preun): /sbin/chkconfig
22 Requires(postun): /usr/sbin/groupdel
23 Requires(postun): /usr/sbin/userdel
24 Requires(pre): /bin/id
25 Requires(pre): /usr/bin/getgid
26 Requires(pre): /usr/lib/rpm/user_group.sh
27 Requires(pre): /usr/sbin/groupadd
28 Requires(pre): /usr/sbin/useradd
29 Requires(pre): /usr/sbin/usermod
30 Requires(triggerpostun): findutils
31 Requires: rc-scripts >= 0.4.1.23
32 Requires: rrdtool >= 1.2
38 Suggests: openssh-clients
40 Provides: group(%{name})
41 Provides: user(%{name})
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 %define _noautoprovfiles %{_datadir}/%{name}
46 %define _noautoreq perl(BER) perl(CGI::Session::Driver) perl(CGI::Session::Driver::DBI) perl(CGI::Session::ErrorHandler) perl(Config::Grammar) perl(Digest::HMAC) perl(Digest::HMAC_MD5) perl(JSON) perl(JSON::Converter) perl(JSON::Parser) perl(Smokeping) perl(Smokeping::ciscoRttMonMIB) perl(Smokeping::Colorspace) perl(Smokeping::Config) perl(Smokeping::Examples) perl(Smokeping::Graphs) perl(Smokeping::Master) perl(Smokeping::matchers::Avgratio) perl(Smokeping::matchers::base) perl(Smokeping::probes::base) perl(Smokeping::probes::basefork) perl(Smokeping::probes::basevars) perl(Smokeping::probes::EchoPing) perl(Smokeping::probes::EchoPingHttp) perl(Smokeping::probes::EchoPingPlugin) perl(Smokeping::probes::FPing) perl(Smokeping::probes::passwordchecker) perl(Smokeping::RRDhelpers) perl(Smokeping::RRDtools) perl(Smokeping::Slave) perl(Smokeping::sorters::base) perl(SNMP_Session) perl(SNMP_util)
48 # How to obtain _noautoreq:
49 # 1. comment out _noauto* macros
50 # 2. repackage smokeping
51 # 3. select Provides from repackage output
52 # 4. xclip -o | sed 's/ perl/\nperl/' > perlprov
53 # 5. select Requires from repackage output
54 # 6. xclip -o | sed 's/ perl/\nperl/' > perlreq
55 # 7. cat perlprov perlreq | awk '{print $1}' | sort | uniq -c | grep '^ 2 ' | awk '{print $2}' | tr '\n' ' '
57 %define _sysconfdir /etc/%{name}
58 %define _webapps /etc/webapps
59 %define _webapp %{name}
60 %define _wwwconfdir %{_webapps}/%{_webapp}
61 %define _cgi_bindir %{_prefix}/share/%{name}
64 SmokePing is a ICMP latency logging and graphing system. It consists
65 of a daemon process which organizes the latency measurements and a CGI
66 which presents the graphs with interesting smoke-like effects.
68 %description -l pl.UTF-8
69 Smokeping jest narzędziem do tworzenia wykresów aktywności sieci.
70 Używając pakietów ICMP zapisuje czas odpowiedzi poszczególnych hostów
71 i wyświetla je w postaci czytelnego wykresu.
74 Summary: CGI webinterface for smokeping
75 Summary(pl.UTF-8): Interfejs WWW (CGI) do smokepinga
76 Group: Applications/WWW
77 Requires: %{name} = %{version}-%{release}
81 CGI webinterface for smokeping.
83 %description cgi -l pl.UTF-8
84 Interfejs WWW (CGI) do smokepinga.
89 decruft() { grep -lr "$1" . | xargs %{__sed} -i -e "s|$1|$2|g"; }
91 # eliminate Tobi's quirks
92 decruft /usr/sepp/bin %{_bindir}
94 # rrdtool package goes into standard perl tree
95 decruft '^use lib .*rrdtool.*;' ''
97 decruft /usr/bin/speedy-5.8.8 %{_bindir}/speedy
99 sed -i -e '/\/home\/oposs\/smokeping\/software\/lib/d' htdocs/tr.cgi.dist
100 sed -i -e '/\/home\/oetiker\/checkouts\/smokeping\/trunk\/software\/lib/d' htdocs/smokeping.cgi.dist
101 sed -i -e 's|/home/oetiker/checkouts/smokeping/trunk/software/etc/config.dist|%{_sysconfdir}/config|' htdocs/smokeping.cgi.dist
102 # working config in wrong location
103 decruft "etc/config.dist" "%{_sysconfdir}/config"
105 sed -i -e 's#use lib qw(lib);#use lib qw(%{_datadir}/%{name});#' bin/smokeping.dist
107 sed -i -e 's#"cropper/#"/smokeping/cropper/#' etc/basepage.html.dist
113 rm -rf $RPM_BUILD_ROOT
114 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir},%{_wwwconfdir},%{_sbindir}} \
115 $RPM_BUILD_ROOT{%{_datadir}/%{name},%{_sharedstatedir}/%{name}/{img,rrd},%{_cgi_bindir}} \
116 $RPM_BUILD_ROOT{%{_mandir}/man{1,3,5,7},/var/run/%{name}}
118 install etc/basepage.html.dist $RPM_BUILD_ROOT%{_sysconfdir}/basepage.html
119 install etc/config.dist $RPM_BUILD_ROOT%{_sysconfdir}
120 install etc/smokemail.dist $RPM_BUILD_ROOT%{_sysconfdir}/smokemail
121 install etc/smokeping_secrets.dist $RPM_BUILD_ROOT%{_sysconfdir}/smokeping_secrets
122 install etc/tmail.dist $RPM_BUILD_ROOT%{_sysconfdir}/tmail
123 install bin/smokeping.dist $RPM_BUILD_ROOT%{_sbindir}/smokeping
124 install bin/tSmoke.dist $RPM_BUILD_ROOT%{_sbindir}/tSmoke
125 cp -r htdocs/{cropper,resource,script,tr.html} $RPM_BUILD_ROOT%{_cgi_bindir}
126 install htdocs/smokeping.cgi.dist $RPM_BUILD_ROOT%{_cgi_bindir}/smokeping.cgi
127 install htdocs/tr.cgi.dist $RPM_BUILD_ROOT%{_cgi_bindir}/tr.cgi
128 cp -r lib/* $RPM_BUILD_ROOT%{_datadir}/%{name}
129 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
130 install %{SOURCE2} $RPM_BUILD_ROOT%{_wwwconfdir}/httpd.conf
131 install %{SOURCE2} $RPM_BUILD_ROOT%{_wwwconfdir}/apache.conf
132 install %{SOURCE4} $RPM_BUILD_ROOT%{_wwwconfdir}/lighttpd.conf
133 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/config
134 install doc/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
135 # TODO: man(3) pages from subdirectories are packaged in %_docdir too, clean them up
136 install doc/{,Config/,Smokeping/{,matchers/,probes/,sorters/}}*.3 $RPM_BUILD_ROOT%{_mandir}/man3
137 install doc/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
138 install doc/*.7 $RPM_BUILD_ROOT%{_mandir}/man7
141 rm -rf $RPM_BUILD_ROOT
144 %groupadd -g 207 %{name}
145 %useradd -u 207 -d /var/lib/%{name} -g %{name} -s /bin/false -c "Smokeping User" %{name}
146 %addusertogroup smokeping adm
149 /sbin/chkconfig --add %{name}
152 if [ "$1" = 0 ]; then
153 %service %{name} stop
154 /sbin/chkconfig --del %{name}
158 if [ "$1" = 0 ]; then
163 %triggerin cgi -- apache1 < 1.3.37-3, apache1-base
164 %webapp_register apache %{_webapp}
166 %triggerun cgi -- apache1 < 1.3.37-3, apache1-base
167 %webapp_unregister apache %{_webapp}
169 %triggerin cgi -- apache < 2.2.0, apache-base
170 %webapp_register httpd %{_webapp}
172 %triggerun cgi -- apache < 2.2.0, apache-base
173 %webapp_unregister httpd %{_webapp}
175 %triggerin cgi -- lighttpd
176 %webapp_register lighttpd %{_webapp}
178 %triggerun cgi -- lighttpd
179 %webapp_unregister lighttpd %{_webapp}
181 %triggerpostun -- %{name} < 2.0.5-0.3
182 # we put trigger on main package, because we can't trigger in new package
183 # this will create .rpmnew files when one installs -cgi package. but that's more than okay
184 if [ -f /etc/httpd/httpd.conf/99_%{name}.conf.rpmsave ]; then
185 install -d %{_wwwconfdir}
186 mv -f /etc/httpd/httpd.conf/99_%{name}.conf.rpmsave %{_wwwconfdir}/httpd.conf
189 %service -q httpd reload
191 %banner -e %{name} << EOF
192 The CGI program is available as %{name}-cgi package.
195 %triggerpostun -- %{name} < 2.4.2-3
196 find /var/lib/smokeping/rrd -type f -user root -group root -name \*.rrd -mtime -7 -exec chown smokeping \{\} \;
197 find /var/lib/smokeping/rrd -type d -user root -group root -exec chown smokeping \{\} \;
200 %defattr(644,root,root,755)
201 %doc CHANGES CONTRIBUTORS COPYRIGHT README TODO doc/*.html doc/*.txt doc/Config doc/Smokeping doc/examples
202 %attr(755,root,root) %{_sbindir}/smokeping
203 %attr(755,root,root) %{_sbindir}/tSmoke
204 %{_datadir}/smokeping
205 %exclude %{_cgi_bindir}/cropper
206 %exclude %{_datadir}/smokeping/smokeping.cgi
207 %exclude %{_cgi_bindir}/resource
208 %exclude %{_cgi_bindir}/script
209 %exclude %{_datadir}/smokeping/tr.cgi
210 %exclude %{_datadir}/smokeping/tr.html
211 %{_mandir}/man1/smokeping.1*
212 %{_mandir}/man1/smokeping.cgi.1*
213 %{_mandir}/man1/tSmoke.1*
218 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/basepage.html
219 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config
220 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.dist
221 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/smokemail
222 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/smokeping_secrets
223 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tmail
224 %attr(754,root,root) /etc/rc.d/init.d/smokeping
225 %dir %{_sharedstatedir}/%{name}
226 %dir %attr(775,root,smokeping) %{_sharedstatedir}/%{name}/rrd
227 %dir %attr(775,root,http) %{_sharedstatedir}/%{name}/img
228 %dir %attr(770,root,smokeping) /var/run/%{name}
231 %defattr(644,root,root,755)
232 %dir %attr(750,root,http) %{_wwwconfdir}
233 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_wwwconfdir}/apache.conf
234 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_wwwconfdir}/httpd.conf
235 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_wwwconfdir}/lighttpd.conf
236 %{_cgi_bindir}/cropper
237 %attr(755,root,root) %{_cgi_bindir}/smokeping.cgi
238 %{_cgi_bindir}/resource
239 %{_cgi_bindir}/script
240 %attr(755,root,root) %{_cgi_bindir}/tr.cgi
241 %{_cgi_bindir}/tr.html