]> git.pld-linux.org Git - projects/template-specs.git/commitdiff
- more complete trigger samples
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 9 Feb 2005 22:10:00 +0000 (22:10 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apache1-module.spec -> 1.3

apache1-module.spec

index 60769e3dd808482887c94fb557956fcd0e0e39a7..ab3c02a644f24606352c38411d3c58ebd1e84563 100644 (file)
@@ -1,6 +1,6 @@
 #
-# Replace MODNAME with real module name
-# Replace OLDVERSION with version prior apache1 confdir support
+# Replace MODNAME with real module name.
+# Replace VERSION with version since what confdir support was introduced for the module.
 #
 %define                mod_name        MODNAME
 %define        apxs            %{_sbindir}/apxs1
@@ -41,7 +41,15 @@ rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d}
 
 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/99_mod_%{mod_name}.conf
+
+# module configuration
+# - should contain LoadModule line
+# - and directives must be between IfModule (so user could disable the module easily)
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
+
+# or, if no directives needed, put just LoadModule line
+echo "LoadModule %{mod_name}_module    modules/mod_%{mod_name}.so" > \
+       $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -58,8 +66,11 @@ if [ "$1" = "0" ]; then
        fi
 fi
 
-%triggerpostun -- %{name} < OLDVERSION
-if grep -q '^Include conf.d' /etc/apache/apache.conf; then
+# trigger for upgrading from pre confdir module
+
+# if they had Include modulename.conf
+%triggerpostun -- %{name} < VERSION
+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
@@ -74,6 +85,13 @@ if [ -f /var/lock/subsys/apache ]; then
        /etc/rc.d/init.d/apache restart 1>&2
 fi
 
+# or it was just apxs
+%triggerpostun -- apache1-mod_%{mod_name} < VERSION
+# check that they're not using old apache.conf
+if grep -q '^Include conf\.d' /etc/apache/apache.conf; then
+       %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc README
This page took 0.070545 seconds and 4 git commands to generate.