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