]> git.pld-linux.org Git - packages/smokeping.git/blob - smokeping.spec
e5e774e8ac82e07fe3b3500cc9aab659f900be04
[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.6.11
6 Release:        0.3
7 License:        GPL v2+
8 Group:          Networking/Utilities
9 Source0:        http://oss.oetiker.ch/smokeping/pub/%{name}-%{version}.tar.gz
10 # Source0-md5:  702392f5f3599f7eb1cc47eb2d192cb9
11 Source1:        %{name}.init
12 Source2:        %{name}-apache.conf
13 Source3:        %{name}-config
14 Source4:        %{name}-lighttpd.conf
15 Source5:        %{name}.tmpfiles
16 Source6:        %{name}-httpd.conf
17 Patch0:         fix-paths.patch
18 Patch1:         high_precision_sleep_timer.patch
19 URL:            http://oss.oetiker.ch/smokeping/
20 BuildRequires:  perl-Config-Grammar
21 BuildRequires:  perl-rrdtool
22 BuildRequires:  perl-tools-pod
23 BuildRequires:  rpm-perlprov >= 4.1-13
24 BuildRequires:  rpmbuild(macros) >= 1.268
25 BuildRequires:  sed >= 4.0
26 Requires(post): sed >= 4.0
27 Requires(post,preun):   /sbin/chkconfig
28 Requires(postun):       /usr/sbin/groupdel
29 Requires(postun):       /usr/sbin/userdel
30 Requires(pre):  /bin/id
31 Requires(pre):  /usr/bin/getgid
32 Requires(pre):  /usr/lib/rpm/user_group.sh
33 Requires(pre):  /usr/sbin/groupadd
34 Requires(pre):  /usr/sbin/useradd
35 Requires(pre):  /usr/sbin/usermod
36 Requires(triggerpostun):        findutils
37 Requires:       perl-Config-Grammar
38 Requires:       rc-scripts >= 0.4.1.23
39 Requires:       rrdtool >= 1.2
40 Suggests:       bind-utils
41 Suggests:       curl
42 Suggests:       echoping
43 Suggests:       fping
44 Suggests:       openssh-clients
45 Suggests:       traceroute
46 Provides:       group(%{name})
47 Provides:       user(%{name})
48 BuildArch:      noarch
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %define         _noautoprovfiles        %{_datadir}/%{name}
52 %define         _noautoreq_perl         BER CGI::Session::Driver CGI::Session::Driver::DBI CGI::Session::ErrorHandler Config::Grammar Digest::HMAC Digest::HMAC_MD5 JSON JSON::Converter JSON::Parser Smokeping Smokeping::ciscoRttMonMIB Smokeping::Colorspace Smokeping::Config Smokeping::Examples Smokeping::Graphs Smokeping::Master Smokeping::matchers::Avgratio Smokeping::matchers::base Smokeping::probes::base Smokeping::probes::basefork Smokeping::probes::basevars Smokeping::probes::EchoPing Smokeping::probes::EchoPingHttp Smokeping::probes::EchoPingPlugin Smokeping::probes::FPing Smokeping::probes::passwordchecker Smokeping::RRDhelpers Smokeping::RRDtools Smokeping::Slave Smokeping::sorters::base SNMP_Session SNMP_util
53
54 # How to obtain _noautoreq:
55 # 1. comment out _noauto* macros
56 # 2. repackage smokeping
57 # 3. select Provides from repackage output
58 # 4. xclip -o | sed 's/ perl/\nperl/g' | awk '{print $1}' | sort -u > perlprov
59 # 5. select Requires from repackage output
60 # 6. xclip -o | sed 's/ perl/\nperl/g' | awk '{print $1}' | sort -u > perlreq
61 # 7. cat perlprov perlprov perlreq | awk '{print $1}' | sort | uniq -c | grep '^      2 ' | awk '{print $2}' | tr '\n' ' '
62
63 %define         _sysconfdir     /etc/%{name}
64 %define         _webapps        /etc/webapps
65 %define         _webapp         %{name}
66 %define         _wwwconfdir     %{_webapps}/%{_webapp}
67 %define         _cgi_bindir     %{_prefix}/share/%{name}
68
69 %description
70 SmokePing is a ICMP latency logging and graphing system. It consists
71 of a daemon process which organizes the latency measurements and a CGI
72 which presents the graphs with interesting smoke-like effects.
73
74 %description -l pl.UTF-8
75 Smokeping jest narzędziem do tworzenia wykresów aktywności sieci.
76 Używając pakietów ICMP zapisuje czas odpowiedzi poszczególnych hostów
77 i wyświetla je w postaci czytelnego wykresu.
78
79 %package cgi
80 Summary:        CGI webinterface for smokeping
81 Summary(pl.UTF-8):      Interfejs WWW (CGI) do smokepinga
82 Group:          Applications/WWW
83 Requires:       %{name} = %{version}-%{release}
84 Requires:       webapps
85 Requires:       webserver(access)
86 Requires:       webserver(alias)
87 Requires:       webserver(cgi)
88 Conflicts:      apache-base < 2.4.0-1
89
90 %description cgi
91 CGI webinterface for smokeping.
92
93 %description cgi -l pl.UTF-8
94 Interfejs WWW (CGI) do smokepinga.
95
96 %prep
97 %setup -q
98
99 %patch0 -p1
100 %patch1 -p1
101
102 #sed -i -e 's,^Net::.*$,,' PERL_MODULES
103
104 sed -i -e 's#@prefix@/etc/\(.*\).dist#/etc/smokeping/\1#' etc/config.dist.in
105 sed -i -e 's#@prefix@/etc/#/etc/smokeping/#' etc/config.dist.in
106
107 %build
108 %configure \
109         --enable-pkgonly
110 %{__make}
111
112 %install
113 rm -rf $RPM_BUILD_ROOT
114 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir},%{_wwwconfdir}} \
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         $RPM_BUILD_ROOT%{systemdtmpfilesdir}
118
119 %{__make} install DESTDIR=$RPM_BUILD_ROOT
120
121 # start of fixing paths
122 for f in basepage.html smokemail smokeping_secrets tmail; do
123     mv $RPM_BUILD_ROOT/etc/smokeping/{$f.dist,$f}
124 done
125
126 rm -rf $RPM_BUILD_ROOT/etc/smokeping/examples
127
128 mv $RPM_BUILD_ROOT%{_prefix}/lib/{*.pm,Smokeping} $RPM_BUILD_ROOT%{_datadir}/%{name}
129
130 mv $RPM_BUILD_ROOT{%{_prefix}/htdocs/cropper,%{_cgi_bindir}}
131 mv $RPM_BUILD_ROOT%{_bindir}/smokeping_cgi $RPM_BUILD_ROOT%{_cgi_bindir}/smokeping.cgi
132
133 mv $RPM_BUILD_ROOT%{_mandir}/man1/{smokeping_cgi.1,smokeping.cgi.1}
134 # end of fixing paths
135
136 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
137 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_wwwconfdir}/apache.conf
138 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_wwwconfdir}/httpd.conf
139 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_wwwconfdir}/lighttpd.conf
140 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/config
141 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
142
143
144 %clean
145 rm -rf $RPM_BUILD_ROOT
146
147 %pre
148 %groupadd -g 207 %{name}
149 %useradd -u 207 -d /var/lib/%{name} -g %{name} -s /bin/false -c "Smokeping User" %{name}
150 %addusertogroup smokeping adm
151
152 %post
153 /sbin/chkconfig --add %{name}
154
155 %preun
156 if [ "$1" = 0 ]; then
157         %service %{name} stop
158         /sbin/chkconfig --del %{name}
159 fi
160
161 %postun
162 if [ "$1" = 0 ]; then
163         %userremove %{name}
164         %groupremove %{name}
165 fi
166
167 %triggerin cgi -- apache1 < 1.3.37-3, apache1-base
168 %webapp_register apache %{_webapp}
169
170 %triggerun cgi -- apache1 < 1.3.37-3, apache1-base
171 %webapp_unregister apache %{_webapp}
172
173 %triggerin cgi -- apache-base
174 %webapp_register httpd %{_webapp}
175
176 %triggerun cgi -- apache-base
177 %webapp_unregister httpd %{_webapp}
178
179 %triggerin cgi -- lighttpd
180 %webapp_register lighttpd %{_webapp}
181
182 %triggerun cgi -- lighttpd
183 %webapp_unregister lighttpd %{_webapp}
184
185 %triggerpostun -- %{name} < 2.0.5-0.3
186 # we put trigger on main package, because we can't trigger in new package
187 # this will create .rpmnew files when one installs -cgi package. but that's more than okay
188 if [ -f /etc/httpd/httpd.conf/99_%{name}.conf.rpmsave ]; then
189         install -d %{_wwwconfdir}
190         mv -f /etc/httpd/httpd.conf/99_%{name}.conf.rpmsave %{_wwwconfdir}/httpd.conf
191 fi
192
193 %service -q httpd reload
194
195 %banner -e %{name} << EOF
196 The CGI program is available as %{name}-cgi package.
197 EOF
198
199 %triggerpostun -- %{name} < 2.4.2-3
200 find /var/lib/smokeping/rrd -type f -user root -group root -name \*.rrd -mtime -7 -exec chown smokeping \{\} \;
201 find /var/lib/smokeping/rrd -type d -user root -group root -exec chown smokeping \{\} \;
202
203 %files
204 %defattr(644,root,root,755)
205 %doc CHANGES CONTRIBUTORS COPYRIGHT README TODO doc/*.txt doc/examples
206 %attr(755,root,root) %{_bindir}/smokeinfo
207 %attr(755,root,root) %{_bindir}/smokeping
208 %attr(755,root,root) %{_bindir}/tSmoke
209 %{_datadir}/smokeping
210 %exclude %{_cgi_bindir}/cropper
211 %exclude %{_datadir}/smokeping/smokeping.*cgi
212 %{_mandir}/man1/smokeping.1*
213 %{_mandir}/man1/smokeping.cgi.1*
214 %{_mandir}/man1/tSmoke.1*
215 %{_mandir}/man3/*.3*
216 %{_mandir}/man5/*.5*
217 %{_mandir}/man7/*.7*
218 %dir %{_sysconfdir}
219 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/basepage.html
220 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config
221 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.dist
222 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/smokemail
223 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/smokeping_secrets
224 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tmail
225 %attr(754,root,root) /etc/rc.d/init.d/smokeping
226 %dir %{_sharedstatedir}/%{name}
227 %dir %attr(775,root,smokeping) %{_sharedstatedir}/%{name}/rrd
228 %dir %attr(775,root,http) %{_sharedstatedir}/%{name}/img
229 %dir %attr(770,root,smokeping) /var/run/%{name}
230 %{systemdtmpfilesdir}/%{name}.conf
231
232 %files cgi
233 %defattr(644,root,root,755)
234 %dir %attr(750,root,http) %{_wwwconfdir}
235 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_wwwconfdir}/apache.conf
236 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_wwwconfdir}/httpd.conf
237 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_wwwconfdir}/lighttpd.conf
238 %{_cgi_bindir}/cropper
239 %attr(755,root,root) %{_cgi_bindir}/smokeping.cgi
This page took 0.036357 seconds and 3 git commands to generate.