]> git.pld-linux.org Git - packages/apache1-mod_watch.git/blob - apache1-mod_watch.spec
3fe6016d90f0d51290612faef122498c704eb7c6
[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:        3
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:       apache1 >= 1.3.33-2
25 Obsoletes:      apache-mod_%{mod_name} <= %{version}
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
29 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
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
40 %description -l pl
41 Ten modu³ kontroluje i zbiera informacje na temat ilo¶ci przes³anych
42 bajtów (przychodz±cych i wychodz±cych) wg. serwera wirtualnego, w³a¶ciciela
43 plików, zdalnego adresu ip, katalogu lub lokacji oraz serwera jako ca³o¶ci.
44 Modu³ zosta³ zaprojektowany do pracy z MRTG, dziêki czemu otrzymamy ³adn±,
45 graficzn± reprezentacje danych. Modu³ wspiera mod_vhost_alias oraz mod_gzip.
46
47 %prep
48 %setup -q -n mod_%{mod_name}-%{version}
49 %{?with_ipv6:%patch -p0}
50
51 mv mod_watch.html mod_watch_pl.html
52
53 %build
54 %{__make} build-dynamic \
55         APXS=%{apxs}
56
57 %install
58 rm -rf $RPM_BUILD_ROOT
59 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d}
60
61 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
62 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
63
64 sed -e 's/<!--#/<!--/g' index.shtml > mod_watch.html
65
66 %clean
67 rm -rf $RPM_BUILD_ROOT
68
69 %post
70 if [ -f /var/lock/subsys/apache ]; then
71         /etc/rc.d/init.d/apache restart 1>&2
72 else
73         echo "Run \"/etc/rc.d/init.d/apache start\" to start apache HTTP daemon."
74 fi
75
76 %postun
77 if [ "$1" = "0" ]; then
78         if [ -f /var/lock/subsys/apache ]; then
79                 /etc/rc.d/init.d/apache restart 1>&2
80         fi
81 fi
82
83 %triggerpostun -- %{name} < 3.18-1.1
84 if grep -q '^Include conf\.d' /etc/apache/apache.conf; then
85         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
86         sed -i -e '
87                 /^Include.*mod_%{mod_name}\.conf/d
88         ' /etc/apache/apache.conf
89 else
90         # they're still using old apache.conf
91         sed -i -e '
92                 s,^Include.*mod_%{mod_name}\.conf,Include %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf,
93         ' /etc/apache/apache.conf
94 fi
95 if [ -f /var/lock/subsys/apache ]; then
96         /etc/rc.d/init.d/apache restart 1>&2
97 fi
98
99 %files
100 %defattr(644,root,root,755)
101 %doc CHANGES* *.html
102 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
103 %attr(755,root,root) %{_pkglibdir}/*
This page took 0.492287 seconds and 2 git commands to generate.