]> git.pld-linux.org Git - packages/apache-mod_watch.git/blob - apache-mod_watch.spec
04bf43a83fbb0e330c021c8768b9fecb30e8305d
[packages/apache-mod_watch.git] / apache-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.13
7 Release:        3
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 # Source0-md5:  89ca8cee3315d8073359d47104583aee
12 Source1:        %{name}.conf
13 Patch0:         %{name}-PLD-v6stuff.patch
14 URL:            http://www.snert.com/Software/mod_watch/
15 BuildRequires:  %{apxs}
16 BuildRequires:  apache(EAPI)-devel
17 Requires(post,preun):   %{apxs}
18 Requires(post,preun):   grep
19 Requires(preun):        fileutils
20 Requires:       apache(EAPI)
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
24
25 %description
26 This module will watch and collect the bytes, requests, and documents
27 in & out per virtual host, file owner, remote-ip address, directory or
28 location, and the web server as a whole. This module was designed for
29 use with MRTG, which will make nice graphical representations of the
30 data, but is general enough that it can be applied to other purposes,
31 as the raw data is accessed by a URL. This module supports
32 mod_vhost_alias and mod_gzip.
33
34 %description -l pl
35 Ten modu³ kontroluje i zbiera informacje na temat ilo¶ci przes³anych
36 bajtów (przychodz±cych i wychodz±cych) wg. serwera wirtualnego, w³a¶ciciela
37 plików, zdalnego adresu ip, katalogu lub lokacji oraz serwera jako ca³o¶ci.
38 Modu³ zosta³ zaprojektowany do pracy z MRTG, dziêki czemu otrzymamy ³adn±,
39 graficzn± reprezentacje danych. Modu³ wspiera mod_vhost_alias oraz mod_gzip.
40
41 %prep
42 %setup -q -n mod_%{mod_name}-%{version}
43 %patch -p0
44
45 %build
46 %{__make} build-dynamic
47
48 %install
49 rm -rf $RPM_BUILD_ROOT
50 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/httpd}
51
52 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
53 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/mod_watch.conf
54
55 mv mod_watch.html mod_watch_pl.html
56 sed -e 's/<!--#/<!--/g' index.shtml > mod_watch.html
57
58 %clean
59 rm -rf $RPM_BUILD_ROOT
60
61 %post
62 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
63 if [ -f %{_sysconfdir}/httpd/httpd.conf ] && \
64     ! grep -q "^Include.*mod_watch.conf" %{_sysconfdir}/httpd/httpd.conf; then
65         echo Include %{_sysconfdir}/httpd/mod_watch.conf >> %{_sysconfdir}/httpd/httpd.conf
66 fi
67 if [ -f /var/lock/subsys/httpd ]; then
68         /etc/rc.d/init.d/httpd restart 1>&2
69 else
70         echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache http daemon."
71 fi
72
73 %preun
74 if [ "$1" = "0" ]; then
75         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
76         umask 027
77         grep -v "^Include.*mod_watch.conf" %{_sysconfdir}/httpd/httpd.conf > \
78                 %{_sysconfdir}/httpd/httpd.conf.tmp
79         mv -f %{_sysconfdir}/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
80         if [ -f /var/lock/subsys/httpd ]; then
81                 /etc/rc.d/init.d/httpd restart 1>&2
82         fi
83 fi
84
85 %files
86 %defattr(644,root,root,755)
87 %doc CHANGES* *.html
88 %attr(755,root,root) %{_pkglibdir}/*
89 %{_sysconfdir}/httpd/mod_watch.conf
This page took 0.071663 seconds and 2 git commands to generate.