]> git.pld-linux.org Git - packages/apache1-mod_watch.git/blob - apache1-mod_watch.spec
f038e8e17864f41cbd9df7a2160cb0abaa46919f
[packages/apache1-mod_watch.git] / apache1-mod_watch.spec
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
7 %define         mod_name        watch
8 %define         apxs            /usr/sbin/apxs1
9 Summary:        Apache module: Monitoring Interface for MRTG
10 Summary(pl):    Modu³ do apache: Interfejs do monitorowania za pomoc± MRTG
11 Name:           apache1-mod_%{mod_name}
12 Version:        3.18
13 Release:        1.2
14 License:        BSD
15 Group:          Networking/Daemons
16 Source0:        http://www.snert.com/Software/download/mod_watch%(echo %{version} | tr -d .).tgz
17 # Source0-md5:  1409df800f24214bed16ca753b9967ff
18 Source1:        %{name}.conf
19 Patch0:         %{name}-PLD-v6stuff.patch
20 URL:            http://www.snert.com/Software/mod_watch/
21 BuildRequires:  %{apxs}
22 BuildRequires:  apache1-devel >= 1.3.33-2
23 %{?with_ipv6:BuildRequires:     apache1(ipv6)-devel}
24 Requires(post,preun):   %{apxs}
25 Requires(post,preun):   grep
26 Requires(preun):        fileutils
27 Requires:       apache1 >= 1.3.33-2
28 Obsoletes:      apache-mod_%{mod_name} <= %{version}
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
32 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
33
34 %description
35 This module will watch and collect the bytes, requests, and documents
36 in & out per virtual host, file owner, remote-ip address, directory or
37 location, and the web server as a whole. This module was designed for
38 use with MRTG, which will make nice graphical representations of the
39 data, but is general enough that it can be applied to other purposes,
40 as the raw data is accessed by a URL. This module supports
41 mod_vhost_alias and mod_gzip.
42
43 %description -l pl
44 Ten modu³ kontroluje i zbiera informacje na temat ilo¶ci przes³anych
45 bajtów (przychodz±cych i wychodz±cych) wg. serwera wirtualnego, w³a¶ciciela
46 plików, zdalnego adresu ip, katalogu lub lokacji oraz serwera jako ca³o¶ci.
47 Modu³ zosta³ zaprojektowany do pracy z MRTG, dziêki czemu otrzymamy ³adn±,
48 graficzn± reprezentacje danych. Modu³ wspiera mod_vhost_alias oraz mod_gzip.
49
50 %prep
51 %setup -q -n mod_%{mod_name}-%{version}
52 %{?with_ipv6:%patch -p0}
53
54 mv mod_watch.html mod_watch_pl.html
55
56 %build
57 %{__make} build-dynamic \
58         APXS=%{apxs}
59
60 %install
61 rm -rf $RPM_BUILD_ROOT
62 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d}
63
64 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
65 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
66
67 sed -e 's/<!--#/<!--/g' index.shtml > mod_watch.html
68
69 %clean
70 rm -rf $RPM_BUILD_ROOT
71
72 %post
73 if [ -f /var/lock/subsys/apache ]; then
74         /etc/rc.d/init.d/apache restart 1>&2
75 else
76         echo "Run \"/etc/rc.d/init.d/apache start\" to start apache HTTP daemon."
77 fi
78
79 %preun
80 if [ "$1" = "0" ]; then
81         if [ -f /var/lock/subsys/apache ]; then
82                 /etc/rc.d/init.d/apache restart 1>&2
83         fi
84 fi
85
86 %triggerpostun -- %{name} < 3.18-1.1
87 if grep -q '^Include conf\.d' /etc/apache/apache.conf; then
88         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
89         sed -i -e '
90                 /^Include.*mod_%{mod_name}\.conf/d
91         ' /etc/apache/apache.conf
92 else
93         # they're still using old apache.conf
94         sed -i -e '
95                 s,^Include.*mod_%{mod_name}\.conf,Include %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf,
96         ' /etc/apache/apache.conf
97 fi
98 if [ -f /var/lock/subsys/apache ]; then
99         /etc/rc.d/init.d/apache restart 1>&2
100 fi
101
102 %files
103 %defattr(644,root,root,755)
104 %doc CHANGES* *.html
105 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
106 %attr(755,root,root) %{_pkglibdir}/*
This page took 0.069909 seconds and 2 git commands to generate.