2 # - strange error when accessing "/~watch-info":
3 # [Thu Feb 10 03:16:16 2005] [warn] " 1\n\b" concurrency counter went negative; resetting to zero
5 %bcond_without ipv6 # disable IPv6 support
8 %define apxs /usr/sbin/apxs1
9 Summary: Apache module: Monitoring Interface for MRTG
10 Summary(pl.UTF-8): Moduł do apache: Interfejs do monitorowania za pomocą MRTG
11 Name: apache1-mod_%{mod_name}
15 Group: Networking/Daemons
16 Source0: http://www.snert.com/Software/download/mod_watch%(echo %{version} | tr -d .).tgz
17 # Source0-md5: 1409df800f24214bed16ca753b9967ff
19 Patch0: %{name}-PLD-v6stuff.patch
20 URL: http://www.snert.com/Software/mod_watch/
21 BuildRequires: apache1-apxs
22 #{?with_ipv6:BuildRequires: apache1(ipv6)-devel}
23 BuildRequires: apache1-devel >= 1.3.33-2
24 BuildRequires: rpmbuild(macros) >= 1.268
25 Requires: apache1(EAPI)
26 Obsoletes: apache-mod_watch <= 3.18
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
30 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
33 This module will watch and collect the bytes, requests, and documents
34 in & out per virtual host, file owner, remote-ip address, directory or
35 location, and the web server as a whole. This module was designed for
36 use with MRTG, which will make nice graphical representations of the
37 data, but is general enough that it can be applied to other purposes,
38 as the raw data is accessed by a URL. This module supports
39 mod_vhost_alias and mod_gzip.
41 %description -l pl.UTF-8
42 Ten moduł kontroluje i zbiera informacje na temat ilości przesłanych
43 bajtów (przychodzących i wychodzących) wg. serwera wirtualnego,
44 właściciela plików, zdalnego adresu ip, katalogu lub lokacji oraz
45 serwera jako całości. Moduł został zaprojektowany do pracy z MRTG,
46 dzięki czemu otrzymamy ładną, graficzną reprezentacje danych. Moduł
47 wspiera mod_vhost_alias oraz mod_gzip.
50 %setup -q -n mod_%{mod_name}-%{version}
51 %{?with_ipv6:%patch -p0}
53 mv mod_watch.html mod_watch_pl.html
56 %{__make} build-dynamic \
60 rm -rf $RPM_BUILD_ROOT
61 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d}
63 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
64 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
66 sed -e 's/<!--#/<!--/g' index.shtml > mod_watch.html
69 rm -rf $RPM_BUILD_ROOT
72 %service -q apache restart
75 if [ "$1" = "0" ]; then
76 %service -q apache restart
79 %triggerpostun -- %{name} < 3.18-1.1
80 if grep -q '^Include conf\.d/\*\.conf' /etc/apache/apache.conf; then
81 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
83 /^Include.*mod_%{mod_name}\.conf/d
84 ' /etc/apache/apache.conf
86 # they're still using old apache.conf
88 s,^Include.*mod_%{mod_name}\.conf,Include %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf,
89 ' /etc/apache/apache.conf
91 %service -q apache restart
94 %defattr(644,root,root,755)
96 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
97 %attr(755,root,root) %{_pkglibdir}/*