Author: glen                         Date: Mon Feb 28 19:22:11 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- unify with template-apache1_module.spec
- full confdir apache1 support

---- Files affected:
SPECS:
   apache1-mod_suphp.spec (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SPECS/apache1-mod_suphp.spec
diff -u SPECS/apache1-mod_suphp.spec:1.1 SPECS/apache1-mod_suphp.spec:1.2
--- SPECS/apache1-mod_suphp.spec:1.1    Mon Feb 28 18:17:34 2005
+++ SPECS/apache1-mod_suphp.spec        Mon Feb 28 20:22:05 2005
@@ -1,8 +1,7 @@
 # $Revision$, $Date$
 #
 # Available build options:
-%bcond_with    checkpath       # enable check if php execution is within
-                               # DOCUMENT_ROOT of the vhost
+%bcond_with    checkpath       # enable check if php execution is within 
DOCUMENT_ROOT of the vhost
 #
 %define                mod_name        suphp
 %define        apxs            /usr/sbin/apxs1
@@ -10,31 +9,32 @@
 Summary(pl):   Moduł do apache: suPHP - uruchamianie skryptów PHP z 
uprawnieniami ich właścicieli
 Name:          apache1-mod_%{mod_name}
 Version:       0.5.2
-Release:       1
+Release:       1.4
 License:       GPL
 Group:         Networking/Daemons
-Source0:       http://www.suphp.org/download/%{mod_name}-%{version}.tar.gz     
+Source0:       http://www.suphp.org/download/%{mod_name}-%{version}.tar.gz
 # Source0-md5: 337909e87027af124052baddddbd2994
-Source1:       %{name}.logrotate
-Source2:       %{name}.conf
+Source1:       %{name}.conf
+Source2:       %{name}.logrotate
 URL:           http://www.suphp.org/
-BuildRequires: %{apxs}
-BuildRequires: apache1-devel
+BuildRequires: apache1-devel >= 1.3.33-2
 BuildRequires: autoconf
 BuildRequires: automake
-Requires(post,preun):  %{apxs}
+Requires(triggerpostun):       %{apxs}
+Requires(triggerpostun):       grep
+Requires(triggerpostun):       sed >= 4.0
 Requires:      apache
 Requires:      php-cgi
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _sysconfdir     %(%{apxs} -q SYSCONFDIR)
-%define                _pkglibdir      %(%{apxs} -q LIBEXECDIR)
+%define                _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
+%define                _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
 
 %description
-suPHP is a tool for executing PHP scripts with the permissions of their
-owners. It consists of an Apache module (mod_suphp) and a setuid root
-binary (suphp) that is called by the Apache module to change the uid of
-the process executing the PHP interpreter.
+suPHP is a tool for executing PHP scripts with the permissions of
+their owners. It consists of an Apache module (mod_suphp) and a setuid
+root binary (suphp) that is called by the Apache module to change the
+uid of the process executing the PHP interpreter.
 
 %description -l pl
 suPHP jest narzędziem pozwalającym na wykonywanie skryptów w PHP z
@@ -58,46 +58,61 @@
        --with-min-gid=1000 \
        --with-apxs=%{apxs} \
        --disable-checkuid \
-       --disable-checkgid 
+       --disable-checkgid
 
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sbindir},%{_pkglibdir}}
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/conf.d
+install -d $RPM_BUILD_ROOT{%{_sbindir},%{_pkglibdir},%{_sysconfdir}/conf.d}
 
 install src/suphp $RPM_BUILD_ROOT%{_sbindir}
 install src/apache/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
-install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod-suphp.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
 
 install -d $RPM_BUILD_ROOT/etc/logrotate.d
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp
+# TODO: apache1-mod_suphp + trigger
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post
-%{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
 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
        if [ -f /var/lock/subsys/apache ]; then
                /etc/rc.d/init.d/apache restart 1>&2
        fi
 fi
 
+# TODO remove the trigger, if no longer needed
+%triggerpostun -- %{name} <= 0.5.2-1
+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 AUTHORS ChangeLog doc
 %attr(4755,root,root) %{_sbindir}/suphp
 %attr(755,root,root) %{_pkglibdir}/*
-%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) 
/etc/logrotate.d/*
-%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) 
%{_sysconfdir}/conf.d/*
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) 
/etc/logrotate.d/*
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) 
%{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
 
 %define date   %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -105,7 +120,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.2  2005/02/28 19:22:05  glen
+- unify with template-apache1_module.spec
+- full confdir apache1 support
+
 Revision 1.1  2005/02/28 17:17:34  adamg
 - new, from Marcin Sztolcman <msztolcman (at) post.pl>
-
-
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/apache1-mod_suphp.spec?r1=1.1&r2=1.2&f=u


_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to