httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject [PATCH] Configuration (1/4): Path Layout
Date Tue, 01 Dec 1998 12:32:33 GMT

Configuration (1/4): Path Layout [config-layout]
------------------------------------------------

This patch tries to complete Randys work to change the default path layout in
APACI to the layout of --compat in a more generalized way.

 o there is no longer a _default_ path layout. This means
   the user _HAS_ to specifiy a path layout _explicitly_.  Only this way we
   can avoid confusion again because silently changing the layout to --compat
   would again cause confusion.

 o added a generic --with-layout=[FILE:]ID option. It has
   to be used to select the installation path layout.  ID here is a layout
   indentifier, currently "Apache" and "GNU" are pre-defined in the file
   config.layout.  Custom layouts are possible by using FILE:ID as the
   argument. Then the layout ID is taken from FILE. This makes the life of
   package vendors a little bit easier and avoids specifying thousends of
   options every time.

 o the config.layout file consists of <Layout ID>..</Layout> sections
   where inside those sections "path_variable: path_value" pairs can be
   specified. Those lines are converted to path_variable='path_value' shell
   commands under --with-layout.

 o removed --compat option. This is now --with-layout=Apache.

 o renamed --layout option to --show-layout to be more consistent
   with --with-layout option.
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com
Index: config.layout
===================================================================
RCS file: config.layout
diff -N config.layout
--- /dev/null	Tue Dec  1 13:23:02 1998
+++ config.layout	Tue Dec  1 12:48:30 1998
@@ -0,0 +1,39 @@
+##
+##  config.layout -- APACI Pre-defined Installation Path Layouts
+##  (selectable with APACI's --with-layout=ID option)
+##
+
+#   Classical Apache path layout
+<Layout Apache>
+    prefix:        /usr/local/apache
+    exec_prefix:   $prefix
+    bindir:        $exec_prefix/bin
+    sbindir:       $exec_prefix/bin
+    libexecdir:    $exec_prefix/libexec
+    mandir:        $prefix/man
+    sysconfdir:    $prefix/conf
+    datadir:       $prefix
+    includedir:    $prefix/include
+    localstatedir: $prefix
+    runtimedir:    $localstatedir/logs
+    logfiledir:    $localstatedir/logs
+    proxycachedir: $localstatedir/proxy
+</Layout>
+
+#   GNU standards conforming path layout
+<Layout GNU>
+    prefix:        /usr/local
+    exec_prefix:   $prefix
+    bindir:        $exec_prefix/bin
+    sbindir:       $exec_prefix/sbin
+    libexecdir:    $exec_prefix/libexec
+    mandir:        $prefix/man
+    sysconfdir:    $prefix/etc
+    datadir:       $prefix/share
+    includedir:    $prefix/include
+    localstatedir: $prefix/var
+    runtimedir:    $localstatedir/run
+    logfiledir:    $localstatedir/log
+    proxycachedir: $localstatedir/proxy
+</Layout>
+
Index: configure
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/configure,v
retrieving revision 1.50
diff -u -u -3 -r1.50 configure
--- configure	1998/11/08 21:24:01	1.50
+++ configure	1998/12/01 11:48:48
@@ -76,6 +76,8 @@
 sedsubst=src/.apaci.sedsubst
 addconf=src/.apaci.addconf
 tplconf=src/.apaci.tplconf
+pldconf=src/.apaci.pldconf
+configlayout=config.layout
 configstatus=config.status
 
 ##
@@ -165,19 +167,7 @@
 ##
 
 #   default paths
-prefix='/usr/local/apache'
-exec_prefix='$prefix'
-bindir='$exec_prefix/bin'
-sbindir='$exec_prefix/sbin'
-libexecdir='$exec_prefix/libexec'
-mandir='$prefix/man'
-sysconfdir='$prefix/etc'
-datadir='$prefix/share'
-includedir='$prefix/include'
-localstatedir='$prefix/var'
-runtimedir='$localstatedir/run'
-logfiledir='$localstatedir/log'
-proxycachedir='$localstatedir/proxy'
+prefix=UNSET
 
 #   customization flags for
 #   automatic "apache" suffix 
@@ -186,8 +176,9 @@
 customized_localstatedir=0
 customized_includedir=0
 
-#   check and debug
-layout=0
+#   layout configuration
+with_layout=0
+show_layout=0
 
 #   suexec defaults
 suexec=0
@@ -391,23 +382,23 @@
             echo ""
             echo "Stand-alone options:"
             echo " --help, -h             print this message"
-            echo " --layout               print installation layout (check and debug)"
+            echo " --show-layout          print installation path layout (check and debug)"
             echo ""
             echo "Installation layout options:"
+            echo " --with-layout=[F:]ID   use installation path layout ID (from file F)"
             echo " --prefix=PREFIX        install architecture-independent files in PREFIX"
             echo " --exec-prefix=EPREFIX  install architecture-dependent files in EPREFIX"
-            echo " --bindir=DIR           install user     executables in DIR  [EPREFIX/bin]"
-            echo " --sbindir=DIR          install sysadmin executables in DIR  [EPREFIX/sbin]"
-            echo " --libexecdir=DIR       install program  executables in DIR  [EPREFIX/libexec]"
-            echo " --mandir=DIR           install manual pages in DIR          [PREFIX/man]"
-            echo " --sysconfdir=DIR       install configuration files in DIR   [PREFIX/etc]"
-            echo " --datadir=DIR          install read-only  data files in DIR [PREFIX/share]"
-            echo " --includedir=DIR       install includes files in DIR        [PREFIX/include]"
-            echo " --localstatedir=DIR    install modifiable data files in DIR [PREFIX/var]"
-            echo " --runtimedir=DIR       install runtime data in DIR          [PREFIX/var/run]"
-            echo " --logfiledir=DIR       install logfile data in DIR          [PREFIX/var/log]"
-            echo " --proxycachedir=DIR    install proxy cache data in DIR      [PREFIX/var/proxy]"
-            echo " --compat               install with old Apache 1.2 installation paths"
+            echo " --bindir=DIR           install user     executables in DIR"
+            echo " --sbindir=DIR          install sysadmin executables in DIR"
+            echo " --libexecdir=DIR       install program  executables in DIR"
+            echo " --mandir=DIR           install manual pages in DIR"
+            echo " --sysconfdir=DIR       install configuration files in DIR"
+            echo " --datadir=DIR          install read-only  data files in DIR"
+            echo " --includedir=DIR       install includes files in DIR"
+            echo " --localstatedir=DIR    install modifiable data files in DIR"
+            echo " --runtimedir=DIR       install runtime data in DIR"
+            echo " --logfiledir=DIR       install logfile data in DIR"
+            echo " --proxycachedir=DIR    install proxy cache data in DIR"
             echo ""
             echo "Configuration options:"
             echo " --enable-rule=NAME     enable  a particular Rule named 'NAME'"
@@ -437,9 +428,41 @@
             echo ""
             exit 0
             ;;
-        --layout)
-            layout=1
+        --with-layout=*)
+            case $apc_optarg in
+                *:* ) 
+                    file=`echo $apc_optarg | sed -e 's/:.*//'`
+                    name=`echo $apc_optarg | sed -e 's/.*://'`
+                    ;;
+                * ) 
+                    file=$configlayout
+                    name=$apc_optarg
+                    ;;
+            esac
+            if [ ! -f "$file" ]; then
+                echo "configure:Error: Path layout definition file $file not found" 1>&2
+                exit 1
+            fi
+            sed -e "1,/[ 	]*<[Ll]ayout[ 	]*$name[ 	]*>[ 	]*/d" \
+                -e '/[ 	]*<\/Layout>[ 	]*/,$d' \
+				-e "s/^[ 	]*//g" \
+				-e "s/:[ 	]*/=\'/g" \
+				-e "s/[ 	]*$/'/g" \
+                $file >$pldconf
+            . $pldconf
+            rm -f $pldconf 2>/dev/null
+            if [ ".$prefix" = .UNSET ]; then
+                echo "configure:Error: Path layout definition not found or incorrect" 1>&2
+                exit 1
+            fi
+            if [ ".$quiet" = .no ]; then
+                echo " + using installation path layout: $name ($file)"
+            fi
+            with_layout=1
             ;;
+        --show-layout)
+            show_layout=1
+            ;;
         --prefix=*)
             prefix="$apc_optarg"
             ;;
@@ -483,24 +506,6 @@
         --proxycachedir=*) 
             proxycachedir="$apc_optarg" 
             ;;
-        --compat) 
-            exec_prefix='$prefix'
-            bindir='$exec_prefix/bin'
-            sbindir='$exec_prefix/bin'
-            libexecdir='$exec_prefix/libexec'
-            mandir='$prefix/man'
-            sysconfdir='$prefix/conf'
-            datadir='$prefix'
-            includedir='$prefix/include'
-            localstatedir='$prefix'
-            runtimedir='$localstatedir/logs'
-            logfiledir='$localstatedir/logs'
-            proxycachedir='$localstatedir/proxy'
-            customized_sysconfdir=1
-            customized_datadir=1
-            customized_localstatedir=1
-            customized_includedir=1
-            ;;
         --add-module=*) 
             file="$apc_optarg"
             if [ ".`echo $file | egrep '/?mod_[a-zA-Z0-9][a-zA-Z0-9_]*\.c$'`" = . ]; then
@@ -789,6 +794,12 @@
         exit 1
     fi
 fi
+if [ ".$with_layout" = .0 ]; then
+    echo "configure:Error: You have to select an installation path layout with"
+    echo "                 the --with-layout=[FILE:]ID option. Use 'apache' or"
+    echo "                 'gnu' for ID to select the two predefined layouts."
+    exit 1
+fi
 
 ##
 ##  a few warnings
@@ -887,7 +898,7 @@
 ##
 ##  check and debug
 ##
-if [ ".$layout" = .1 ]; then
+if [ ".$show_layout" = .1 ]; then
     echo ""
     echo "Installation paths:"
     echo "               prefix: $prefix"

Mime
View raw message