From: Elan Ruusamäe Date: Thu, 10 Feb 2005 01:48:18 +0000 (+0000) Subject: - confdir enabled apache1 X-Git-Tag: auto/ac/apache1-mod_rpaf-0_5-1~12 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fapache1-mod_rpaf.git;a=commitdiff_plain;h=0bd3dc42bbf80d0de11e6f257c27c3b3760625d9 - confdir enabled apache1 Changed files: apache1-mod_rpaf.spec -> 1.3 --- diff --git a/apache1-mod_rpaf.spec b/apache1-mod_rpaf.spec index e31477f..813fcd5 100644 --- a/apache1-mod_rpaf.spec +++ b/apache1-mod_rpaf.spec @@ -6,16 +6,18 @@ Summary: Apache module: record traffic statistics into a database Summary(pl): Modu³ Apache'a: zapisywanie statystyk ruchu do bazy danych Name: apache1-mod_%{mod_name} Version: 0.5 -Release: 0.3 +Release: 0.11 License: Apache Group: Networking/Daemons Source0: http://stderr.net/apache/rpaf/download/mod_%{mod_name}-%{version}.tar.gz # Source0-md5: 471fb059d6223a394f319b7c8ab45c4d Source1: %{name}.conf URL: http://stderr.net/apache/rpaf/ -BuildRequires: apache1-devel -Requires(post,preun): %{apxs} -Requires(post,preun): grep +BuildRequires: apache1-devel >= 1.3.33-1.1 +BuildConflicts: apache(ipv6)-devel +Requires(triggerpostun): %{apxs} +Requires(triggerpostun): grep +Requires(triggerpostun): sed >= 4.0 Requires: apache1 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -43,37 +45,44 @@ od wersji 1.3.25. %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} +install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d} install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} -install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_%{mod_name}.conf +install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/99_mod_%{mod_name}.conf %clean rm -rf $RPM_BUILD_ROOT %post -%{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2 -if [ -f /etc/apache/apache.conf ] && ! grep -q "^Include.*mod_%{mod_name}.conf" /etc/apache/apache.conf; then - echo "Include /etc/apache/mod_%{mod_name}.conf" >> /etc/apache/apache.conf -fi if [ -f /var/lock/subsys/apache ]; then /etc/rc.d/init.d/apache restart 1>&2 fi %preun if [ "$1" = "0" ]; then - %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2 - umask 027 - grep -v "^Include.*mod_%{mod_name}.conf" /etc/apache/apache.conf > \ - /etc/apache/apache.conf.tmp - mv -f /etc/apache/apache.conf.tmp /etc/apache/apache.conf if [ -f /var/lock/subsys/apache ]; then /etc/rc.d/init.d/apache restart 1>&2 fi fi +%triggerpostun -- %{name} < 0.5-0.11 +if grep -q '^Include conf\.d' /etc/apache/apache.conf; then + %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2 + sed -i -e ' + /^Include.*mod_%{mod_name}\.conf/d + ' /etc/apache/apache.conf +else + # they're still using old apache.conf + sed -i -e ' + s,^Include.*mod_%{mod_name}\.conf,Include %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf, + ' /etc/apache/apache.conf +fi +if [ -f /var/lock/subsys/apache ]; then + /etc/rc.d/init.d/apache restart 1>&2 +fi + %files %defattr(644,root,root,755) %doc README CHANGES test.pl -%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_*.conf +%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf %attr(755,root,root) %{_pkglibdir}/*