]>
Commit | Line | Data |
---|---|---|
bc94de1d ER |
1 | # TODO |
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 | |
4 | ||
5 | %bcond_without ipv6 # disable IPv6 support | |
6 | ||
b584562d | 7 | %define mod_name watch |
859ff54a | 8 | %define apxs /usr/sbin/apxs1 |
b584562d | 9 | Summary: Apache module: Monitoring Interface for MRTG |
57d5e51b | 10 | Summary(pl.UTF-8): Moduł do apache: Interfejs do monitorowania za pomocą MRTG |
859ff54a | 11 | Name: apache1-mod_%{mod_name} |
12 | Version: 3.18 | |
a0f01afd | 13 | Release: 4 |
b584562d AM |
14 | License: BSD |
15 | Group: Networking/Daemons | |
859ff54a | 16 | Source0: http://www.snert.com/Software/download/mod_watch%(echo %{version} | tr -d .).tgz |
17 | # Source0-md5: 1409df800f24214bed16ca753b9967ff | |
b584562d | 18 | Source1: %{name}.conf |
38ec6ba3 | 19 | Patch0: %{name}-PLD-v6stuff.patch |
b584562d | 20 | URL: http://www.snert.com/Software/mod_watch/ |
4332eeac | 21 | #{?with_ipv6:BuildRequires: apache1(ipv6)-devel} |
436d9bad | 22 | BuildRequires: apache1-devel >= 1.3.39 |
53eaafcc | 23 | BuildRequires: rpmbuild(macros) >= 1.268 |
a0f01afd | 24 | Requires: apache1(EAPI) |
53eaafcc | 25 | Obsoletes: apache-mod_watch <= 3.18 |
b584562d AM |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
27 | ||
bc94de1d | 28 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) |
97d62378 | 29 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d |
b584562d AM |
30 | |
31 | %description | |
32 | This module will watch and collect the bytes, requests, and documents | |
33 | in & out per virtual host, file owner, remote-ip address, directory or | |
34 | location, and the web server as a whole. This module was designed for | |
35 | use with MRTG, which will make nice graphical representations of the | |
36 | data, but is general enough that it can be applied to other purposes, | |
37 | as the raw data is accessed by a URL. This module supports | |
38 | mod_vhost_alias and mod_gzip. | |
39 | ||
bac4139c JR |
40 | %description -l pl.UTF-8 |
41 | Ten moduł kontroluje i zbiera informacje na temat ilości przesłanych | |
42 | bajtów (przychodzących i wychodzących) wg. serwera wirtualnego, | |
43 | właściciela plików, zdalnego adresu ip, katalogu lub lokacji oraz | |
44 | serwera jako całości. Moduł został zaprojektowany do pracy z MRTG, | |
45 | dzięki czemu otrzymamy ładną, graficzną reprezentacje danych. Moduł | |
4d361588 | 46 | wspiera mod_vhost_alias oraz mod_gzip. |
b584562d AM |
47 | |
48 | %prep | |
49 | %setup -q -n mod_%{mod_name}-%{version} | |
bc94de1d ER |
50 | %{?with_ipv6:%patch -p0} |
51 | ||
52 | mv mod_watch.html mod_watch_pl.html | |
b584562d | 53 | |
97d62378 ER |
54 | sed -e 's/<!--#/<!--/g' index.shtml > mod_watch.html |
55 | ||
b584562d | 56 | %build |
859ff54a | 57 | %{__make} build-dynamic \ |
58 | APXS=%{apxs} | |
b584562d AM |
59 | |
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
97d62378 | 62 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} |
b584562d | 63 | |
97d62378 ER |
64 | install -p mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} |
65 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf | |
cf7f9f5c | 66 | |
c6f9b392 JB |
67 | %clean |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
b584562d | 70 | %post |
53eaafcc | 71 | %service -q apache restart |
b584562d | 72 | |
7427062a | 73 | %postun |
b584562d | 74 | if [ "$1" = "0" ]; then |
53eaafcc | 75 | %service -q apache restart |
b584562d AM |
76 | fi |
77 | ||
bc94de1d | 78 | %triggerpostun -- %{name} < 3.18-1.1 |
932ab3fe | 79 | if grep -q '^Include conf\.d/\*\.conf' /etc/apache/apache.conf; then |
bc94de1d ER |
80 | %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2 |
81 | sed -i -e ' | |
82 | /^Include.*mod_%{mod_name}\.conf/d | |
83 | ' /etc/apache/apache.conf | |
84 | else | |
85 | # they're still using old apache.conf | |
86 | sed -i -e ' | |
97d62378 | 87 | s,^Include.*mod_%{mod_name}\.conf,Include %{_sysconfdir}/*_mod_%{mod_name}.conf, |
bc94de1d ER |
88 | ' /etc/apache/apache.conf |
89 | fi | |
53eaafcc | 90 | %service -q apache restart |
bc94de1d | 91 | |
b584562d AM |
92 | %files |
93 | %defattr(644,root,root,755) | |
38ec6ba3 | 94 | %doc CHANGES* *.html |
97d62378 | 95 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf |
b584562d | 96 | %attr(755,root,root) %{_pkglibdir}/* |