2 %define apxs /usr/sbin/apxs
3 Summary: Apache module: Monitoring Interface for MRTG
4 Summary(pl): Modu³ do apache: Interfejs do monitorowania za pomoc± MRTG
5 Name: apache-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: 89ca8cee3315d8073359d47104583aee
13 URL: http://www.snert.com/Software/mod_watch/
14 BuildRequires: %{apxs}
15 BuildRequires: apache-devel >= 2
16 Requires(post,preun): %{apxs}
17 Requires(post,preun): grep
18 Requires(preun): fileutils
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
23 %define _sysconfdir /etc/httpd
26 This module will watch and collect the bytes, requests, and documents
27 in & out per virtual host, file owner, remote-ip address, directory or
28 location, and the web server as a whole. This module was designed for
29 use with MRTG, which will make nice graphical representations of the
30 data, but is general enough that it can be applied to other purposes,
31 as the raw data is accessed by a URL. This module supports
32 mod_vhost_alias and mod_gzip.
35 Ten modu³ kontroluje i zbiera informacje na temat ilo¶ci przes³anych
36 bajtów (przychodz±cych i wychodz±cych) wg. serwera wirtualnego, w³a¶ciciela
37 plików, zdalnego adresu ip, katalogu lub lokacji oraz serwera jako ca³o¶ci.
38 Modu³ zosta³ zaprojektowany do pracy z MRTG, dziêki czemu otrzymamy ³adn±,
39 graficzn± reprezentacje danych. Modu³ wspiera mod_vhost_alias oraz mod_gzip.
42 %setup -q -n mod_%{mod_name}-%{version}
45 %{__make} build-dynamic
48 rm -rf $RPM_BUILD_ROOT
49 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
51 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
52 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_watch.conf
54 mv mod_watch.html mod_watch_pl.html
55 sed -e 's/<!--#/<!--/g' index.shtml > mod_watch.html
58 rm -rf $RPM_BUILD_ROOT
61 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
62 if [ -f %{_sysconfdir}/httpd.conf ] && \
63 ! grep -q "^Include.*mod_watch.conf" %{_sysconfdir}/httpd.conf; then
64 echo "Include %{_sysconfdir}/mod_watch.conf" >> %{_sysconfdir}/httpd.conf
66 if [ -f /var/lock/subsys/httpd ]; then
67 /etc/rc.d/init.d/httpd restart 1>&2
69 echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache http daemon."
73 if [ "$1" = "0" ]; then
74 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
76 grep -v "^Include.*mod_watch.conf" %{_sysconfdir}/httpd.conf > \
77 %{_sysconfdir}/httpd.conf.tmp
78 mv -f %{_sysconfdir}/httpd.conf.tmp %{_sysconfdir}/httpd.conf
79 if [ -f /var/lock/subsys/httpd ]; then
80 /etc/rc.d/init.d/httpd restart 1>&2
85 %defattr(644,root,root,755)
87 %attr(755,root,root) %{_pkglibdir}/*
88 %{_sysconfdir}/mod_watch.conf