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