Author: glen                         Date: Sat Mar  5 16:29:21 2005 GMT
Module: PLD-doc                       Tag: HEAD
---- Log message:
- Apache version independant packages

---- Files affected:
PLD-doc:
   devel-hints-en.txt (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: PLD-doc/devel-hints-en.txt
diff -u PLD-doc/devel-hints-en.txt:1.9 PLD-doc/devel-hints-en.txt:1.10
--- PLD-doc/devel-hints-en.txt:1.9      Tue Jan 11 21:00:09 2005
+++ PLD-doc/devel-hints-en.txt  Sat Mar  5 17:29:16 2005
@@ -17,7 +17,8 @@
 Package naming:
 Some package classes have a unified naming scheme.
 Mainly:
-- for Apache modules: apache-mod_<name>
+- for Apache 2.x modules: apache-mod_<name>
+- for Apache 1.3.x modules: apache1-mod_<name>
 - for PAM modules: pam-pam_<name>
 - for PEAR modules: php-pear-<name> (where <name> usually is
   Class[_Class[_Class...]])
@@ -104,7 +105,7 @@
          >= 2:1.4d
        - when all of those two conditions are present then >= 2:1.4d-3
          has to be used
-       - in case that the macro AC_CONFIG_AUX_DIR in configure.ac 
+       - in case that the macro AC_CONFIG_AUX_DIR in configure.ac
          (not configure.in) is specified then version >= 1:1.4.3
          (or >= 2:1.4e in case of C++ libraries) has to be used
 
@@ -117,7 +118,7 @@
 %{__aclocal}            = aclocal
 %{__libtoolize}         = libtoolize --copy --force
 %{__gettextize}         = gettextize --copy --force [--intl]
-                          (+other operations depending on the version 
+                          (+other operations depending on the version
                           of gettext being used)
 %{__autopoint}          = autopoint --force
 
@@ -151,7 +152,7 @@
 config.sub can be taken from the automake package. For projects which
 are using automake only regeneration of the files as shown before is
 needed. But config.sub is also used by programs which don't use automake
-or even autoconf. In such cases it must be copied over in the %build 
+or even autoconf. In such cases it must be copied over in the %build
 section of the spec file, for eg. in this way:
 
 cp /usr/share/automake/config.sub .
@@ -172,7 +173,7 @@
 package P, we don't add it to the buildRequires of package P - except,
 when the version must be restricted.
 
-In case of shared libraries (and e.g. perl modules) dynamically linked 
+In case of shared libraries (and e.g. perl modules) dynamically linked
 on build time you have to remember that, apart from "BuildRequires:
 something[-devel] >= version", you also need to add "Requires:
 something >= version" - unless that dependency results from SONAME
@@ -190,8 +191,7 @@
 Build process and generated dependencies should be predictable - If a
 given package detects some components during the build, and these aren't
 controlled with e.g. configure switches, than such package is borked and
-needs patching. 
-
+needs patching.
 
 It's a standard to link dynamically (with BuildRequires: library-devel).
 Static linking (and BuildRequires: library-static) can only be used
@@ -543,3 +543,66 @@
 
 5. ERROR:src/Makefile.am: USE_AUTOMOC is unsupported
 can be overcome by replacing USE_AUTOMOC with AUTO.
+
+
+Apache version independant packages
+
+As of 1.3.33-2 version, apache1 also supports confdir based configuration.
+To make your package require just apache functionality (versionless
+dependancy), You should add to your package:
+Requires:      apache >= 1.3.33-3
+
+If your package needs some apache core module, add virtual dependancy:
+Requires:      apache(mod_dir)
+
+To place apache configuration for both apaches, You should first put the
+apache configuration in your application config directory (not to apache
+dirs!). %{_sysconfdir}/apache-%{name}.conf is good choice.
+
+"Linking" configuration to apache
+
+%define                _apache1dir     /etc/apache
+%define                _apache2dir     /etc/httpd
+
+%post
+# apache1
+if [ -d %{_apache1dir}/conf.d ]; then
+       ln -sf %{_sysconfdir}/apache-%{name}.conf 
%{_apache1dir}/conf.d/99_%{name}.conf
+       if [ -f /var/lock/subsys/apache ]; then
+               /etc/rc.d/init.d/apache restart 1>&2
+       fi
+fi
+# apache2
+if [ -d %{_apache2dir}/httpd.conf ]; then
+       ln -sf %{_sysconfdir}/apache-%{name}.conf 
%{_apache2dir}/httpd.conf/99_%{name}.conf
+       if [ -f /var/lock/subsys/httpd ]; then
+               /etc/rc.d/init.d/httpd restart 1>&2
+       fi
+fi
+
+%postun
+if [ "$1" = "0" ]; then
+       # apache1
+       if [ -d %{_apache1dir}/conf.d ]; then
+               rm -f %{_apache1dir}/conf.d/99_%{name}.conf
+               if [ -f /var/lock/subsys/apache ]; then
+                       /etc/rc.d/init.d/apache restart 1>&2
+               fi
+       fi
+       # apache2
+       if [ -d %{_apache2dir}/httpd.conf ]; then
+               rm -f %{_apache2dir}/httpd.conf/99_%{name}.conf
+               if [ -f /var/lock/subsys/httpd ]; then
+                       /etc/rc.d/init.d/httpd restart 1>&2
+               fi
+       fi
+fi
+
+If your application did mungle apache.conf or httpd.conf earlier, You must add
+trigger to convert to new schema. (it's usually with apache1 applications)
+You can see sample trigger from template-apache1_module.spec
+For apache2 trigger see turba.spec
+
+If your application apache config was previously in apache directory, then you
+should also add trigger when moving it (see imp.spec for sample trigger)
+
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/PLD-doc/devel-hints-en.txt?r1=1.9&r2=1.10&f=u


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

Reply via email to