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