2 %define apxs /usr/sbin/apxs1
3 Summary: Apache module: Monitoring Interface for MRTG
4 Summary(pl): Modu³ do apache: Interfejs do monitorowania za pomoc± MRTG
5 Name: apache1-mod_%{mod_name}
9 Group: Networking/Daemons
10 Source0: http://www.snert.com/Software/download/mod_watch%(echo %{version} | tr -d .).tgz
11 # Source0-md5: 1409df800f24214bed16ca753b9967ff
13 Patch0: %{name}-PLD-v6stuff.patch
14 URL: http://www.snert.com/Software/mod_watch/
15 BuildRequires: %{apxs}
16 BuildRequires: apache1-devel
17 Requires(post,preun): %{apxs}
18 Requires(post,preun): grep
19 Requires(preun): fileutils
21 Obsoletes: apache-mod_%{mod_name} <= %{version}
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
25 %define _sysconfdir %(%{apxs} -q SYSCONFDIR)
28 This module will watch and collect the bytes, requests, and documents
29 in & out per virtual host, file owner, remote-ip address, directory or
30 location, and the web server as a whole. This module was designed for
31 use with MRTG, which will make nice graphical representations of the
32 data, but is general enough that it can be applied to other purposes,
33 as the raw data is accessed by a URL. This module supports
34 mod_vhost_alias and mod_gzip.
37 Ten modu³ kontroluje i zbiera informacje na temat ilo¶ci przes³anych
38 bajtów (przychodz±cych i wychodz±cych) wg. serwera wirtualnego, w³a¶ciciela
39 plików, zdalnego adresu ip, katalogu lub lokacji oraz serwera jako ca³o¶ci.
40 Modu³ zosta³ zaprojektowany do pracy z MRTG, dziêki czemu otrzymamy ³adn±,
41 graficzn± reprezentacje danych. Modu³ wspiera mod_vhost_alias oraz mod_gzip.
44 %setup -q -n mod_%{mod_name}-%{version}
48 %{__make} build-dynamic \
52 rm -rf $RPM_BUILD_ROOT
53 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
55 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
56 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_watch.conf
58 mv mod_watch.html mod_watch_pl.html
59 sed -e 's/<!--#/<!--/g' index.shtml > mod_watch.html
62 rm -rf $RPM_BUILD_ROOT
65 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
66 if [ -f %{_sysconfdir}/apache.conf ] && \
67 ! grep -q "^Include.*mod_watch.conf" %{_sysconfdir}/apache.conf; then
68 echo "Include %{_sysconfdir}/mod_watch.conf" >> %{_sysconfdir}/apache.conf
70 if [ -f /var/lock/subsys/apache ]; then
71 /etc/rc.d/init.d/apache restart 1>&2
73 echo "Run \"/etc/rc.d/init.d/apache start\" to start apache HTTP daemon."
77 if [ "$1" = "0" ]; then
78 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
80 grep -v "^Include.*mod_watch.conf" %{_sysconfdir}/apache.conf > \
81 %{_sysconfdir}/apache.conf.tmp
82 mv -f %{_sysconfdir}/apache.conf.tmp %{_sysconfdir}/apache.conf
83 if [ -f /var/lock/subsys/apache ]; then
84 /etc/rc.d/init.d/apache restart 1>&2
89 %defattr(644,root,root,755)
91 %attr(755,root,root) %{_pkglibdir}/*
92 %{_sysconfdir}/mod_watch.conf