]> git.pld-linux.org Git - packages/smokeping.git/blame - smokeping.spec
changed scripts used to generate _noautoreq
[packages/smokeping.git] / smokeping.spec
CommitLineData
559caf24 1%include /usr/lib/rpm/macros.perl
388ebc7d 2Summary: Smokeping - a latency grapher that uses rrdtool
6ad512fc 3Summary(pl.UTF-8): Smokeping - narzędzie do tworzenia wykresów opóźnień sieci
5ea8c23d 4Name: smokeping
c235887a 5Version: 2.6.11
bc6b2938 6Release: 0.3
5efe153e 7License: GPL v2+
1a299ecf 8Group: Networking/Utilities
7def40dd 9Source0: http://oss.oetiker.ch/smokeping/pub/%{name}-%{version}.tar.gz
0c2fb5b2 10# Source0-md5: 702392f5f3599f7eb1cc47eb2d192cb9
5431036c 11Source1: %{name}.init
bbd49942 12Source2: %{name}-apache.conf
388ebc7d 13Source3: %{name}-config
62d6eb9b 14Source4: %{name}-lighttpd.conf
72621b83 15Source5: %{name}.tmpfiles
bbd49942 16Source6: %{name}-httpd.conf
d5cdab74
SS
17Patch0: fix-paths.patch
18Patch1: high_precision_sleep_timer.patch
7def40dd 19URL: http://oss.oetiker.ch/smokeping/
27055652
SS
20BuildRequires: perl-Config-Grammar
21BuildRequires: perl-rrdtool
388ebc7d 22BuildRequires: perl-tools-pod
559caf24 23BuildRequires: rpm-perlprov >= 4.1-13
98129fad 24BuildRequires: rpmbuild(macros) >= 1.268
da8c17bb 25BuildRequires: sed >= 4.0
7fda5b3d 26Requires(post): sed >= 4.0
2dd8d950 27Requires(post,preun): /sbin/chkconfig
c60e181b
TP
28Requires(postun): /usr/sbin/groupdel
29Requires(postun): /usr/sbin/userdel
30Requires(pre): /bin/id
31Requires(pre): /usr/bin/getgid
32Requires(pre): /usr/lib/rpm/user_group.sh
33Requires(pre): /usr/sbin/groupadd
34Requires(pre): /usr/sbin/useradd
35Requires(pre): /usr/sbin/usermod
36Requires(triggerpostun): findutils
bc6b2938 37Requires: perl-Config-Grammar
3da53bc0 38Requires: rc-scripts >= 0.4.1.23
d79c57a4 39Requires: rrdtool >= 1.2
d90df462
TP
40Suggests: bind-utils
41Suggests: curl
42Suggests: echoping
1ff53abc 43Suggests: fping
d90df462
TP
44Suggests: openssh-clients
45Suggests: traceroute
1ff53abc 46Provides: group(%{name})
47Provides: user(%{name})
5ea8c23d 48BuildArch: noarch
49BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
09be0bea 50
1ff53abc 51%define _noautoprovfiles %{_datadir}/%{name}
c29706c3 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
1ff53abc 53
54# How to obtain _noautoreq:
55# 1. comment out _noauto* macros
56# 2. repackage smokeping
57# 3. select Provides from repackage output
3129493b 58# 4. xclip -o | sed 's/ perl/\nperl/g' | awk '{print $1}' | sort -u > perlprov
1ff53abc 59# 5. select Requires from repackage output
3129493b
SS
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' ' '
1ff53abc 62
7fda5b3d
ER
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}
09be0bea 68
69%description
5ea8c23d 70SmokePing is a ICMP latency logging and graphing system. It consists
71of a daemon process which organizes the latency measurements and a CGI
72which presents the graphs with interesting smoke-like effects.
09be0bea 73
18270cb4
JR
74%description -l pl.UTF-8
75Smokeping jest narzędziem do tworzenia wykresów aktywności sieci.
76Używając pakietów ICMP zapisuje czas odpowiedzi poszczególnych hostów
77i wyświetla je w postaci czytelnego wykresu.
09be0bea 78
7fda5b3d
ER
79%package cgi
80Summary: CGI webinterface for smokeping
6ad512fc 81Summary(pl.UTF-8): Interfejs WWW (CGI) do smokepinga
7fda5b3d
ER
82Group: Applications/WWW
83Requires: %{name} = %{version}-%{release}
84Requires: webapps
619f950a
SS
85Requires: webserver(access)
86Requires: webserver(alias)
87Requires: webserver(cgi)
bbd49942 88Conflicts: apache-base < 2.4.0-1
7fda5b3d
ER
89
90%description cgi
02ab651c
JB
91CGI webinterface for smokeping.
92
18270cb4 93%description cgi -l pl.UTF-8
02ab651c 94Interfejs WWW (CGI) do smokepinga.
7fda5b3d 95
09be0bea 96%prep
97%setup -q
98
c235887a
MM
99%patch0 -p1
100%patch1 -p1
388ebc7d 101
c235887a 102#sed -i -e 's,^Net::.*$,,' PERL_MODULES
d90df462 103
c235887a
MM
104sed -i -e 's#@prefix@/etc/\(.*\).dist#/etc/smokeping/\1#' etc/config.dist.in
105sed -i -e 's#@prefix@/etc/#/etc/smokeping/#' etc/config.dist.in
d90df462 106
7fda5b3d 107%build
7571f360
SS
108%configure \
109 --enable-pkgonly
7fda5b3d
ER
110%{__make}
111
09be0bea 112%install
5ea8c23d 113rm -rf $RPM_BUILD_ROOT
c235887a 114install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir},%{_wwwconfdir}} \
388ebc7d 115 $RPM_BUILD_ROOT{%{_datadir}/%{name},%{_sharedstatedir}/%{name}/{img,rrd},%{_cgi_bindir}} \
72621b83 116 $RPM_BUILD_ROOT{%{_mandir}/man{1,3,5,7},/var/run/%{name}} \
d5cdab74 117 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
388ebc7d 118
c235887a
MM
119%{__make} install DESTDIR=$RPM_BUILD_ROOT
120
121# start of fixing paths
122for f in basepage.html smokemail smokeping_secrets tmail; do
123 mv $RPM_BUILD_ROOT/etc/smokeping/{$f.dist,$f}
124done
125
126rm -rf $RPM_BUILD_ROOT/etc/smokeping/examples
127
d5cdab74 128mv $RPM_BUILD_ROOT%{_prefix}/lib/{*.pm,Smokeping} $RPM_BUILD_ROOT%{_datadir}/%{name}
c235887a 129
d5cdab74 130mv $RPM_BUILD_ROOT{%{_prefix}/htdocs/cropper,%{_cgi_bindir}}
c235887a
MM
131mv $RPM_BUILD_ROOT%{_bindir}/smokeping_cgi $RPM_BUILD_ROOT%{_cgi_bindir}/smokeping.cgi
132
133mv $RPM_BUILD_ROOT%{_mandir}/man1/{smokeping_cgi.1,smokeping.cgi.1}
134# end of fixing paths
135
d5cdab74
SS
136cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
137cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_wwwconfdir}/apache.conf
138cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_wwwconfdir}/httpd.conf
139cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_wwwconfdir}/lighttpd.conf
140cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/config
141cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
72621b83 142
c235887a 143
09be0bea 144%clean
5ea8c23d 145rm -rf $RPM_BUILD_ROOT
09be0bea 146
60368a9c 147%pre
148%groupadd -g 207 %{name}
149%useradd -u 207 -d /var/lib/%{name} -g %{name} -s /bin/false -c "Smokeping User" %{name}
c60e181b 150%addusertogroup smokeping adm
a1505cfd 151
60368a9c 152%post
66b16793 153/sbin/chkconfig --add %{name}
aeac0cba 154
09be0bea 155%preun
98129fad
ER
156if [ "$1" = 0 ]; then
157 %service %{name} stop
66b16793 158 /sbin/chkconfig --del %{name}
7fda5b3d 159fi
aeac0cba 160
60368a9c 161%postun
162if [ "$1" = 0 ]; then
163 %userremove %{name}
164 %groupremove %{name}
165fi
166
479f93eb 167%triggerin cgi -- apache1 < 1.3.37-3, apache1-base
7fda5b3d
ER
168%webapp_register apache %{_webapp}
169
479f93eb 170%triggerun cgi -- apache1 < 1.3.37-3, apache1-base
7fda5b3d
ER
171%webapp_unregister apache %{_webapp}
172
bbd49942 173%triggerin cgi -- apache-base
7fda5b3d
ER
174%webapp_register httpd %{_webapp}
175
bbd49942 176%triggerun cgi -- apache-base
7fda5b3d
ER
177%webapp_unregister httpd %{_webapp}
178
60368a9c 179%triggerin cgi -- lighttpd
62d6eb9b
PG
180%webapp_register lighttpd %{_webapp}
181
60368a9c 182%triggerun cgi -- lighttpd
62d6eb9b
PG
183%webapp_unregister lighttpd %{_webapp}
184
7fda5b3d
ER
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
7fda5b3d
ER
188if [ -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
09be0bea 191fi
192
98129fad 193%service -q httpd reload
7fda5b3d
ER
194
195%banner -e %{name} << EOF
196The CGI program is available as %{name}-cgi package.
197EOF
198
c9922ec4
TP
199%triggerpostun -- %{name} < 2.4.2-3
200find /var/lib/smokeping/rrd -type f -user root -group root -name \*.rrd -mtime -7 -exec chown smokeping \{\} \;
201find /var/lib/smokeping/rrd -type d -user root -group root -exec chown smokeping \{\} \;
202
09be0bea 203%files
5ea8c23d 204%defattr(644,root,root,755)
c235887a
MM
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
388ebc7d 209%{_datadir}/smokeping
d90df462 210%exclude %{_cgi_bindir}/cropper
c235887a 211%exclude %{_datadir}/smokeping/smokeping.*cgi
438c4131 212%{_mandir}/man1/smokeping.1*
213%{_mandir}/man1/smokeping.cgi.1*
214%{_mandir}/man1/tSmoke.1*
d90df462
TP
215%{_mandir}/man3/*.3*
216%{_mandir}/man5/*.5*
217%{_mandir}/man7/*.7*
7fda5b3d 218%dir %{_sysconfdir}
438c4131 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
d90df462
TP
223%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/smokeping_secrets
224%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tmail
438c4131 225%attr(754,root,root) /etc/rc.d/init.d/smokeping
388ebc7d 226%dir %{_sharedstatedir}/%{name}
60368a9c 227%dir %attr(775,root,smokeping) %{_sharedstatedir}/%{name}/rrd
559caf24 228%dir %attr(775,root,http) %{_sharedstatedir}/%{name}/img
4f54d60d 229%dir %attr(770,root,smokeping) /var/run/%{name}
d5cdab74 230%{systemdtmpfilesdir}/%{name}.conf
7fda5b3d
ER
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
62d6eb9b 237%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_wwwconfdir}/lighttpd.conf
d90df462 238%{_cgi_bindir}/cropper
438c4131 239%attr(755,root,root) %{_cgi_bindir}/smokeping.cgi
This page took 0.068573 seconds and 4 git commands to generate.