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/mod_watch/mod_watch%(echo %{version} | sed -e "s#\.##g").tgz
12 URL: http://www.snert.com/Software/mod_watch/
13 BuildRequires: %{apxs}
14 BuildRequires: apache(EAPI)-devel
15 Prereq: %{_sbindir}/apxs
16 Requires: apache(EAPI)
17 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
19 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
20 %define _sysconfdir /etc/httpd
23 This module will watch and collect the bytes, requests, and documents
24 in & out per virtual host, file owner, remote-ip address, directory or
25 location, and the web server as a whole. This module was designed for
26 use with MRTG, which will make nice graphical representations of the
27 data, but is general enough that it can be applied to other purposes,
28 as the raw data is accessed by a URL. This module supports
29 mod_vhost_alias and mod_gzip.
32 Ten modu³ kontroluje i zbiera informacje na temat ilo¶ci przes³anych
33 bajtów (przychodz±cych i wychodz±cych) wg. serwera wirtualnego, w³a¶ciciela
34 plików, zdalnego adresu ip, katalogu lub lokacji oraz serwera jako ca³o¶ci.
35 Modu³ zosta³ zaprojektowany do pracy z MRTG, dziêki czemu otrzymamy ³adn±,
36 graficzn± reprezentacje danych. Modu³ wspiera mod_vhost_alias oraz mod_gzip.
39 %setup -q -n mod_%{mod_name}-%{version}
42 %{__make} build-dynamic
45 rm -rf $RPM_BUILD_ROOT
46 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
48 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
49 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_watch.conf
51 gzip -9nf CHANGES* apache2mrtg*
54 %{_sbindir}/apxs -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
55 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_watch.conf" /etc/httpd/httpd.conf; then
56 echo "Include /etc/httpd/mod_watch.conf" >> /etc/httpd/httpd.conf
58 if [ -f /var/lock/subsys/httpd ]; then
59 /etc/rc.d/init.d/httpd restart 1>&2
63 if [ "$1" = "0" ]; then
64 %{_sbindir}/apxs -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
65 grep -v "^Include.*mod_watch.conf" /etc/httpd/httpd.conf > \
66 /etc/httpd/httpd.conf.tmp
67 mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
68 if [ -f /var/lock/subsys/httpd ]; then
69 /etc/rc.d/init.d/httpd restart 1>&2
74 rm -rf $RPM_BUILD_ROOT
77 %defattr(644,root,root,755)
79 %attr(755,root,root) %{_pkglibdir}/*