]> git.pld-linux.org Git - packages/apache1-mod_watch.git/blob - apache1-mod_watch.spec
- fixed huge bug (zeroing httpd.conf after deinstalation)
[packages/apache1-mod_watch.git] / apache1-mod_watch.spec
1 %define         mod_name        watch
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}
6 Version:        3.12
7 Release:        1
8 License:        BSD
9 Group:          Networking/Daemons
10 Source0:        http://www.snert.com/Software/mod_watch/mod_watch%(echo %{version} | sed -e "s#\.##g").tgz
11 Source1:        %{name}.conf
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)
18
19 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
20 %define         _sysconfdir     /etc/httpd
21
22 %description
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.
30
31 %description -l pl
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.
37
38 %prep
39 %setup -q -n mod_%{mod_name}-%{version}
40
41 %build
42 %{__make} build-dynamic
43
44 %install
45 rm -rf $RPM_BUILD_ROOT
46 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
47
48 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
49 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_watch.conf
50
51 gzip -9nf CHANGES* apache2mrtg* 
52
53 %post
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
57 fi
58 if [ -f /var/lock/subsys/httpd ]; then
59         /etc/rc.d/init.d/httpd restart 1>&2
60 fi
61
62 %preun
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
70         fi
71 fi
72
73 %clean
74 rm -rf $RPM_BUILD_ROOT
75
76 %files
77 %defattr(644,root,root,755)
78 %doc *.gz *htm
79 %attr(755,root,root) %{_pkglibdir}/*
This page took 0.077737 seconds and 3 git commands to generate.