]> git.pld-linux.org Git - packages/smokeping.git/blob - smokeping.spec
- noautoreq perl(Smokeping)
[packages/smokeping.git] / smokeping.spec
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
4 Name:           smokeping
5 Version:        2.4.2
6 Release:        9
7 License:        GPL v2+
8 Group:          Networking/Utilities
9 Source0:        http://oss.oetiker.ch/smokeping/pub/%{name}-%{version}.tar.gz
10 # Source0-md5:  eb8e7679fcad35e59d7c51f2328250a2
11 Source1:        %{name}.init
12 Source2:        %{name}.conf
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
33 Suggests:       bind-utils
34 Suggests:       curl
35 Suggests:       echoping
36 Suggests:       echoping
37 Suggests:       fping
38 Suggests:       openssh-clients
39 Suggests:       traceroute
40 Provides:       group(%{name})
41 Provides:       user(%{name})
42 BuildArch:      noarch
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
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)
47
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' ' '
56
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}
62
63 %description
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.
67
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.
72
73 %package cgi
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}
78 Requires:       webapps
79
80 %description cgi
81 CGI webinterface for smokeping.
82
83 %description cgi -l pl.UTF-8
84 Interfejs WWW (CGI) do smokepinga.
85
86 %prep
87 %setup -q
88
89 decruft() { grep -lr "$1" . | xargs %{__sed} -i -e "s|$1|$2|g"; }
90
91 # eliminate Tobi's quirks
92 decruft /usr/sepp/bin %{_bindir}
93
94 # rrdtool package goes into standard perl tree
95 decruft '^use lib .*rrdtool.*;' ''
96
97 decruft /usr/bin/speedy-5.8.8 %{_bindir}/speedy
98
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"
104
105 sed -i -e 's#use lib qw(lib);#use lib qw(%{_datadir}/%{name});#' bin/smokeping.dist
106
107 sed -i -e 's#"cropper/#"/smokeping/cropper/#' etc/basepage.html.dist
108
109 %build
110 %{__make}
111
112 %install
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}}
117
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
139
140 %clean
141 rm -rf $RPM_BUILD_ROOT
142
143 %pre
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
147
148 %post
149 /sbin/chkconfig --add %{name}
150
151 %preun
152 if [ "$1" = 0 ]; then
153         %service %{name} stop
154         /sbin/chkconfig --del %{name}
155 fi
156
157 %postun
158 if [ "$1" = 0 ]; then
159         %userremove %{name}
160         %groupremove %{name}
161 fi
162
163 %triggerin cgi -- apache1 < 1.3.37-3, apache1-base
164 %webapp_register apache %{_webapp}
165
166 %triggerun cgi -- apache1 < 1.3.37-3, apache1-base
167 %webapp_unregister apache %{_webapp}
168
169 %triggerin cgi -- apache < 2.2.0, apache-base
170 %webapp_register httpd %{_webapp}
171
172 %triggerun cgi -- apache < 2.2.0, apache-base
173 %webapp_unregister httpd %{_webapp}
174
175 %triggerin cgi -- lighttpd
176 %webapp_register lighttpd %{_webapp}
177
178 %triggerun cgi -- lighttpd
179 %webapp_unregister lighttpd %{_webapp}
180
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
187 fi
188
189 %service -q httpd reload
190
191 %banner -e %{name} << EOF
192 The CGI program is available as %{name}-cgi package.
193 EOF
194
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 \{\} \;
198
199 %files
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*
214 %{_mandir}/man3/*.3*
215 %{_mandir}/man5/*.5*
216 %{_mandir}/man7/*.7*
217 %dir %{_sysconfdir}
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}
229
230 %files cgi
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
This page took 0.046336 seconds and 4 git commands to generate.