2 %define apxs /usr/sbin/apxs1
3 Summary: Apache module: log the access_log and error_log log into the syslogd
4 Summary(pl): Modu³ do apache przekazuj±cy access_log i error_log do demona syslogd
5 Name: apache1-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
13 URL: http://savannah.nongnu.org/projects/mod-witch/
14 BuildRequires: %{apxs}
15 BuildRequires: apache1-devel
16 Requires(post,preun): %{apxs}
17 Requires(post,preun): grep
18 Requires(preun): fileutils
20 Obsoletes: apache-mod_%{mod_name} <= %{version}
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
24 %define _sysconfdir %(%{apxs} -q SYSCONFDIR)
27 This mod_witch apache module project intend to help the Apache web
28 server to log the access_log and error_log log into the syslogd, this
29 way apache will be able to log onto a remote logger machine with the
33 Modu³ apache'a mod_witch ma pomóc serwerowi WWW apache przekazywaæ
34 logi access_log i error_log do syslogd, umo¿liwiaj±c w ten sposób
35 logowanie na inn± maszynê.
38 %setup -q -n mod-%{mod_name}-%{version}
41 %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so
44 rm -rf $RPM_BUILD_ROOT
45 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
47 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
48 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_%{mod_name}.conf
51 rm -rf $RPM_BUILD_ROOT
54 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
55 if [ -f %{_sysconfdir}/apache.conf ] && ! grep -q "^Include.*mod_%{mod_name}.conf" %{_sysconfdir}/apache.conf; then
56 echo "Include %{_sysconfdir}/mod_%{mod_name}.conf" >> %{_sysconfdir}/apache.conf
58 if [ -f /var/lock/subsys/apache ]; then
59 /etc/rc.d/init.d/apache restart 1>&2
63 if [ "$1" = "0" ]; then
64 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
66 grep -v "^Include.*mod_%{mod_name}.conf" %{_sysconfdir}/apache.conf > \
67 %{_sysconfdir}/apache.conf.tmp
68 mv -f %{_sysconfdir}/apache.conf.tmp %{_sysconfdir}/apache.conf
69 if [ -f /var/lock/subsys/apache ]; then
70 /etc/rc.d/init.d/apache restart 1>&2
75 %defattr(644,root,root,755)
76 %doc ChangeLog README TODO
77 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_*.conf
78 %attr(755,root,root) %{_pkglibdir}/*