2 %define apxs /usr/sbin/apxs
3 Summary: Apache module: log the access_log and error_log log into the syslogd
4 Summary(pl): Modu³ do apache: loguje pliki access_log i error_log do demona syslogd
5 Name: apache-mod_%{mod_name}
9 Group: Networking/Daemons
10 Source0: http://savannah.nongnu.org/download/mod-witch/mod-witch.pkg/%{version}/mod-witch-%{version}.tar.gz
11 # Source0-md5: a2ffe2f9e28947426321615e2ba57fc7
12 Source1: apache-mod_witch.conf
13 URL: http://savannah.nongnu.org/projects/mod-witch
14 BuildRequires: %{apxs}
15 BuildRequires: apache(EAPI)-devel
16 Requires(post,preun): %{apxs}
17 Requires(post,preun): grep
18 Requires(preun): fileutils
19 Requires: apache(EAPI)
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
23 %define _sysconfdir /etc/httpd
26 This mod-witch apache module [1] project intend to help the Apache web
27 server [1] to log the access_log and error_log log into the syslogd
28 [2], this way apache will be able to log onto a remote logger machine
34 %setup -q -n mod-%{mod_name}-%{version}
37 %{apxs} -Wc,-Wall,-pipe -c mod_%{mod_name}.c -o mod_%{mod_name}.so
40 rm -rf $RPM_BUILD_ROOT
41 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
43 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
44 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_%{mod_name}.conf
47 rm -rf $RPM_BUILD_ROOT
50 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
51 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_%{mod_name}.conf" /etc/httpd/httpd.conf; then
52 echo "Include /etc/httpd/mod_%{mod_name}.conf" >> /etc/httpd/httpd.conf
54 if [ -f /var/lock/subsys/httpd ]; then
55 /etc/rc.d/init.d/httpd restart 1>&2
59 if [ "$1" = "0" ]; then
60 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
62 grep -v "^Include.*mod_%{mod_name}.conf" /etc/httpd/httpd.conf > \
63 /etc/httpd/httpd.conf.tmp
64 mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
65 if [ -f /var/lock/subsys/httpd ]; then
66 /etc/rc.d/init.d/httpd restart 1>&2
71 %defattr(644,root,root,755)
72 %doc README INSTALL COPYING
73 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_*.conf
74 %attr(755,root,root) %{_pkglibdir}/*