[csw-devel] SF.net SVN: gar:[14582] csw/mgar/pkg/apache2/trunk

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Sun May 15 16:47:06 CEST 2011


Revision: 14582
          http://gar.svn.sourceforge.net/gar/?rev=14582&view=rev
Author:   bdwalton
Date:     2011-05-15 14:47:06 +0000 (Sun, 15 May 2011)

Log Message:
-----------
apache2/trunk: a manual merge (read: rsync -a --delete --exclude .svn) of the open-bug-squash branch

Modified Paths:
--------------
    csw/mgar/pkg/apache2/trunk/Makefile
    csw/mgar/pkg/apache2/trunk/files/CSWap2worker.postinstall
    csw/mgar/pkg/apache2/trunk/files/README.CSW.apache2
    csw/mgar/pkg/apache2/trunk/files/config.layout
    csw/mgar/pkg/apache2/trunk/files/cswapache2

Added Paths:
-----------
    csw/mgar/pkg/apache2/trunk/files/0001-Apply-a-large-hammer-to-buildconf-to-fix-libtool-set.patch
    csw/mgar/pkg/apache2/trunk/files/0002-Adjust-a-few-usr-local-paths-in-the-man-pages.patch
    csw/mgar/pkg/apache2/trunk/files/0003-Switch-usr-local-for-opt-csw-in-default-cgi-path.patch
    csw/mgar/pkg/apache2/trunk/files/CSWap2worker.postremove
    csw/mgar/pkg/apache2/trunk/files/CSWap2worker.preinstall
    csw/mgar/pkg/apache2/trunk/files/CSWapache2-dev.cswreleasenotes
    csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall
    csw/mgar/pkg/apache2/trunk/files/i.cswap2mod
    csw/mgar/pkg/apache2/trunk/files/r.cswap2mod

Removed Paths:
-------------
    csw/mgar/pkg/apache2/trunk/files/CSWap2worker.preremove
    csw/mgar/pkg/apache2/trunk/files/build_cas_template
    csw/mgar/pkg/apache2/trunk/files/index_cas_template
    csw/mgar/pkg/apache2/trunk/files/ssl_cas_template

Modified: csw/mgar/pkg/apache2/trunk/Makefile
===================================================================
--- csw/mgar/pkg/apache2/trunk/Makefile	2011-05-15 13:46:56 UTC (rev 14581)
+++ csw/mgar/pkg/apache2/trunk/Makefile	2011-05-15 14:47:06 UTC (rev 14582)
@@ -37,29 +37,39 @@
 # Standard package bits
 DISTFILES += CSWapache2.killproc cswapache2
 
-DISTFILES += CSWapache2.preinstall
-DISTFILES += CSWap2worker.postinstall CSWap2worker.preremove
+DISTFILES += CSWapache2.preinstall CSWapache2.postinstall
+DISTFILES += CSWap2worker.postinstall CSWap2worker.postremove
+DISTFILES += CSWap2worker.preinstall
 
+DISTFILES += CSWapache2-dev.cswreleasenotes
+
 # Configuration templates
 DISTFILES += update20to22
 DISTFILES += README.CSW.apache2 README.CSW.ap2_prefork
 DISTFILES += README.CSW.apache2rt
 
+PATCHFILES += 0001-Apply-a-large-hammer-to-buildconf-to-fix-libtool-set.patch
+PATCHFILES += 0002-Adjust-a-few-usr-local-paths-in-the-man-pages.patch
+PATCHFILES += 0003-Switch-usr-local-for-opt-csw-in-default-cgi-path.patch
+
 UFILES_REGEX = $(NAME)-(\d+(?:\.\d+)*).tar.gz
 
 # The PACKAGES variable tell GAR which packages to build
-PACKAGES  = CSWapache2 CSWapache2-devel CSWapache2-manual CSWap2suexec
+PACKAGES  = CSWapache2 CSWapache2-dev CSWapache2-manual CSWap2suexec
 PACKAGES += CSWap2worker
 # These packages are dummy versions to make dependencies nicer
-# as various things depend on CSWap2prefork currently
-PACKAGES += CSWap2prefork CSWapache2rt
+# as various things depend on them currently
+PACKAGES += CSWap2prefork CSWapache2rt CSWapache2c
 
+OBSOLETED_BY_CSWapache2-dev = CSWapache2-devel
+
 ARCHALL_CSWapache2-manual = 1
 ARCHALL_CSWap2prefork = 1
 ARCHALL_CSWapache2rt = 1
+ARCHALL_CSWapache2c = 1
 
 CATALOGNAME_CSWapache2 = apache2
-CATALOGNAME_CSWapache2-devel = apache2_devel
+CATALOGNAME_CSWapache2-dev = apache2_dev
 CATALOGNAME_CSWapache2-manual = apache2_manual
 CATALOGNAME_CSWap2suexec = ap2_suexec
 CATALOGNAME_CSWap2prefork = ap2_prefork
@@ -67,32 +77,44 @@
 CATALOGNAME_CSWapache2rt = apache2rt
 
 SPKG_DESC_CSWapache2 = A high performance Unix-based HTTP server.
-SPKG_DESC_CSWapache2-devel = The development files for Apache2.
+SPKG_DESC_CSWapache2-dev = The development files for Apache2.
 SPKG_DESC_CSWapache2-manual = The Apache2 manual files.
 SPKG_DESC_CSWap2suexec = The standard suEXEC binary for Apache2.
 SPKG_DESC_CSWap2worker = The apache worker mpm.
 SPKG_DESC_CSWap2prefork = A stub for the old prefork mpm package.
 SPKG_DESC_CSWapache2rt = A stub for the old apache2rt package.
+SPKG_DESC_CSWapache2c = A stub for the old apache2c package.
 
-INCOMPATIBLE_PKGS_CSWapache2  = CSWapache2c
-
 RUNTIME_DEP_PKGS_CSWapache2       += CSWexpat CSWiconv CSWosslutils
 RUNTIME_DEP_PKGS_CSWapache2       += CSWoldaprt CSWosslrt CSWzlib
 RUNTIME_DEP_PKGS_CSWapache2       += CSWapr CSWapr-util CSWbdb48
+RUNTIME_DEP_PKGS_CSWapache2       += CSWapache2c
 RUNTIME_DEP_PKGS_CSWapache2-manual = CSWapache2
-RUNTIME_DEP_PKGS_CSWapache2-devel  = CSWapache2
+RUNTIME_DEP_PKGS_CSWapache2-dev  = CSWapache2
 RUNTIME_DEP_PKGS_CSWap2suexec	   = CSWapache2
-RUNTIME_DEP_PKGS_CSWap2prefork     = CSWapache2
-RUNTIME_DEP_PKGS_CSWap2worker      = CSWapache2 CSWapr CSWexpat
-RUNTIME_DEP_PKGS_CSWap2worker 	  += CSWbdb48 CSWapr-util CSWiconv
+RUNTIME_DEP_PKGS_CSWap2prefork     = CSWapache2 CSWapache2c
+RUNTIME_DEP_PKGS_CSWap2worker      = CSWapache2 CSWapr CSWexpat CSWap2prefork
+RUNTIME_DEP_PKGS_CSWap2worker 	  += CSWbdb48 CSWapr-util CSWiconv CSWapache2c
 RUNTIME_DEP_PKGS_CSWapache2rt	   = CSWapache2
 
 CHECKPKG_OVERRIDES_CSWapache2 += surplus-dependency|CSWalternatives
 CHECKPKG_OVERRIDES_CSWapache2 += surplus-dependency|CSWosslutils
+CHECKPKG_OVERRIDES_CSWapache2 += surplus-dependency|CSWapache2c
 CHECKPKG_OVERRIDES_CSWap2prefork += surplus-dependency|CSWapache2
+CHECKPKG_OVERRIDES_CSWap2prefork += surplus-dependency|CSWapache2c
+CHECKPKG_OVERRIDES_CSWap2worker += surplus-dependency|CSWap2prefork
 CHECKPKG_OVERRIDES_CSWap2worker += surplus-dependency|CSWalternatives
+CHECKPKG_OVERRIDES_CSWap2worker += surplus-dependency|CSWapache2c
 CHECKPKG_OVERRIDES_CSWapache2rt += surplus-dependency|CSWapache2
 
+CHECKPKG_OVERRIDES_CSWapache2-dev += file-with-bad-content|/usr/local|root/opt/csw/apache2/include/httpd.h
+
+# these will eventually go away...
+CHECKPKG_OVERRIDES_CSWap2suexec += catalogname-does-not-match-pkgname|pkgname=CSWap2suexec|catalogname=ap2_suexec|expected-catalogname=ap2suexec
+CHECKPKG_OVERRIDES_CSWap2worker += catalogname-does-not-match-pkgname|pkgname=CSWap2worker|catalogname=ap2_worker|expected-catalogname=ap2worker
+CHECKPKG_OVERRIDES_CSWap2prefork += catalogname-does-not-match-pkgname|pkgname=CSWap2prefork|catalogname=ap2_prefork|expected-catalogname=ap2prefork
+
+
 # We need this to get bdb48/lib into the runpath
 EXTRA_LIB = $(prefix)/bdb48/lib
 
@@ -162,6 +184,7 @@
 CONFIGURE_ARGS += --with-suexec-gidmin=100
 CONFIGURE_ARGS += --with-suexec-logfile=$(prefix)/apache2/var/log/suexec_log
 CONFIGURE_ARGS += --with-suexec-bin=$(prefix)/apache2/sbin/suexec
+CONFIGURE_ARGS += --with-suexec-safepath=/opt/csw/bin:/usr/bin:/bin
 CONFIGURE_ARGS += --enable-authn-alias
 CONFIGURE_ARGS += --enable-authnz-ldap
 CONFIGURE_ARGS += --enable-file-cache
@@ -192,14 +215,15 @@
 STRIP_DIRS    = $(APACHE_ROOT)/sbin $(APACHE_ROOT)/libexec
 
 PKGFILES_CSWap2suexec = .*sbin/suexec .*libexec/.*suexec.* .*/man/.*suexec.*
-PKGFILES_CSWap2suexec += .*ap2mod.*suexec
-PKGFILES_CSWapache2-devel = .*include/.* .*\.(a|la)
+PKGFILES_CSWap2suexec += .*ap2mod/suexec
+PKGFILES_CSWapache2-dev = .*include/.* .*\.(a|la)
 PKGFILES_CSWapache2-manual = .*share/.*manual.* .*etc/extra/httpd-manual.conf
 PKGFILES_CSWap2prefork = .*share/doc/ap2_prefork.*
 PKGFILES_CSWap2worker = .*share/doc/ap2_worker.* .*sbin/httpd.worker
 PKGFILES_CSWapache2rt = .*share/doc/apache2rt.*
+PKGFILES_CSWapache2c = .*share/doc/apache2c.*
 
-PROTOTYPE_FILTER = gawk '$$$$3 ~ /etc\/opt\/csw\/apache2/ && $$$$1 == "f" && $$$$3 !~ /CSW/ && $$$$3 !~ /original/ {$$$$1 = "e"; $$$$2 = "build"}; $$$$3 ~ /ssl_cert_migration.CSW/ {$$$$1 = "e"; $$$$2 = "build"}; $$$$3 ~ /index.html.CSW/ {$$$$1 = "e"; $$$$2 = "build"}; {print}'
+#PROTOTYPE_FILTER  = awk '$$$$3 == "/opt/csw/apache2/sbin/suexec" { $$$$4 = "4755" }; $$$$3 ~ /cswap2mod/ { $$$$4 = "0555" }; { print }'
 
 include gar/category.mk
 
@@ -209,12 +233,14 @@
 FIXCONFIG_RMPATHS  = $(DESTDIR)
 
 pre-configure-modulated:
+	(cd $(WORKDIR)/$(NAME)-$(VERSION); ./buildconf)
 	@gsed -e s,INSTALL_PREFIX,$(prefix)/apache2,g \
 		$(WORKDIR)/config.layout > $(WORKDIR)/$(NAME)-$(VERSION)/config.layout
 	@$(MAKECOOKIE)
 
-post-install-modulated: rename-httpd copy-local-files copy-readmes
 
+post-install-modulated: rename-httpd copy-local-files create-templates copy-readmes
+
 copy-readmes:
 	@(cd $(WORKDIR); for f in README.CSW*; do \
 		p=`echo $$f | sed 's/README.CSW.//'`; \
@@ -236,20 +262,56 @@
 	@ginstall $(WORKDIR)/update20to22 $(APACHE_ROOT)/sbin
 	@$(MAKECOOKIE)
 
+# Create stock templates
+template_list  = share/htdocs/index.html
+template_list += etc/extra/httpd-autoindex.conf
+template_list += etc/extra/httpd-dav.conf
+template_list += etc/extra/httpd-default.conf
+template_list += etc/extra/httpd-info.conf
+template_list += etc/extra/httpd-languages.conf
+template_list += etc/extra/httpd-multilang-errordoc.conf
+template_list += etc/extra/httpd-userdir.conf
+template_list += etc/extra/httpd-vhosts.conf
+template_list += etc/extra/httpd-mpm.conf
+template_list += etc/magic
+template_list += etc/mime.types
+
 create-templates:
+	@echo "  => Creating template files"
+	@( cd $(DESTDIR)$(prefix)/apache2 ; \
+			for file in $(template_list) ; do \
+				gmv -v $$file $$file.CSW ; \
+			done )
 	@$(MAKECOOKIE)
 
 
-post-merge: create-templates
-	@echo "  => Creating template files and CAS shell scripts..."
-	@( cd $(PKGROOT)/etc/opt/csw/apache2/; \
-		for f in *conf extra/* mime* magic*; do \
-			echo "...$$f"; \
-			mv $$f $$f.CSW; \
-			$(abspath $(FILEDIR))/build_cas_template $$f > $$f; \
-		done; \
-	   cd $(PKGROOT)/opt/csw/apache2/share/htdocs; \
-		rm index.html; \
-		cp $(abspath $(FILEDIR))/index_cas_template index.html.CSW; \
-	   cp $(abspath $(FILEDIR))/ssl_cas_template ssl_cert_migration.CSW )
+post-merge:
+	@(cd $(PKGROOT)/$(prefix)/apache2/etc/; \
+		for f in httpd.conf extra/httpd-ssl.conf; do \
+		perl -pi -e 's/User.*daemon.*/User \@USER\@/; \
+		s/Group.*daemon.*/Group \@GROUP\@/; \
+		s/#*ServerName www.example.com/ServerName \@HOSTNAME\@/; \
+		s/ServerAdmin you\@example.com/ServerAdmin \@ADMIN\@/; \
+		s/^(LoadModule.*suexec.*)/#$$1/; \
+		s/^#(Include.*httpd-mpm.conf)/$$1/; \
+		s/^#(Include.*httpd-ssl.conf)/$$1/' $$f; \
+		mv $$f $$f.CSW; \
+		done )
+	@echo Fixing usr/local references in the online manaual...
+	@(cd $(PKGROOT)/$(prefix)/apache2/share/manual; \
+		/opt/csw/bin/gfind . -type f -print0 | \
+		/opt/csw/bin/gxargs -0 \
+			 perl -pi \
+			  -e 's@/usr/local/apache2*@/opt/csw/apache2 at g;' \
+			  -e 's@/usr/local@/opt/csw/apache2 at g')
+	@echo Fixing export/home references in the online manaual...
+	@(cd $(PKGROOT)/$(prefix)/apache2/share/manual; \
+		/opt/csw/bin/gfind . -type f -print0 | \
+		/opt/csw/bin/gxargs -0 \
+			 perl -pi \
+			  -e 's@/export/home@/home at g;')
+	@echo Fixing usr/local reference in the cgi-bin scripts
+	@(cd $(PKGROOT)/$(prefix)/apache2/share/cgi-bin; \
+		perl -pi -e 's@/usr/local/bin@/opt/csw/bin at g' *)
 	@$(MAKECOOKIE)
+

Added: csw/mgar/pkg/apache2/trunk/files/0001-Apply-a-large-hammer-to-buildconf-to-fix-libtool-set.patch
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/0001-Apply-a-large-hammer-to-buildconf-to-fix-libtool-set.patch	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/0001-Apply-a-large-hammer-to-buildconf-to-fix-libtool-set.patch	2011-05-15 14:47:06 UTC (rev 14582)
@@ -0,0 +1,33 @@
+From 386d1e486af82bffc18f4668a96565b892b1ae48 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Thu, 20 Jan 2011 02:16:26 +0100
+Subject: [PATCH] Apply a large hammer to buildconf to fix libtool setup
+
+The heuristics used in buildconf are broken with our newest version of
+the libtool stack.  For now, apply an ugly hack to the script to make
+it work.  Later, we'll polish it and make it general enough to submit
+upstream.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ srclib/apr/buildconf |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/srclib/apr/buildconf b/srclib/apr/buildconf
+index 1041af4..f84e205 100755
+--- a/srclib/apr/buildconf
++++ b/srclib/apr/buildconf
+@@ -52,8 +52,8 @@ if [ -f libtool.m4 ]; then
+    ltfile=`pwd`/libtool.m4
+ elif grep all_pkgmacro_files $libtoolize > /dev/null; then
+     # libtool 2.x
+-   aclocal_dir=`sed -n '/^aclocaldir=/{s/.*=//;p;q;}' < $libtoolize`
+-   ltfiles=`sed -n '/^all_pkgmacro_files=/{s/.*=//;;s/"//;p;q;}' < $libtoolize`
++   aclocal_dir=/opt/csw/share/aclocal
++   ltfiles=`sed -n '/all_pkgmacro_files=/{s/.*=//;;s/"//;p;q;}' < $libtoolize`
+    for f in $ltfiles; do
+        test -f "$aclocal_dir/$f" && cp "$aclocal_dir/$f" build
+    done
+-- 
+1.7.3.2
+

Added: csw/mgar/pkg/apache2/trunk/files/0002-Adjust-a-few-usr-local-paths-in-the-man-pages.patch
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/0002-Adjust-a-few-usr-local-paths-in-the-man-pages.patch	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/0002-Adjust-a-few-usr-local-paths-in-the-man-pages.patch	2011-05-15 14:47:06 UTC (rev 14582)
@@ -0,0 +1,54 @@
+From c1d63dce36cee499600cc4bf4a4856ec35c7a942 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Tue, 22 Feb 2011 10:12:00 +0100
+Subject: [PATCH] Adjust a few /usr/local paths in the man pages.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ docs/man/htdbm.1    |    2 +-
+ docs/man/htpasswd.1 |    2 +-
+ docs/man/httpd.8    |    2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/docs/man/htdbm.1 b/docs/man/htdbm.1
+index d37be2c..80334f0 100644
+--- a/docs/man/htdbm.1
++++ b/docs/man/htdbm.1
+@@ -123,7 +123,7 @@ htdbm returns a zero status ("true") if the username and password have been succ
+  
+ .nf
+ 
+-      htdbm /usr/local/etc/apache/\&.htdbm-users jsmith
++      htdbm /opt/csw/apache2/etc/\&.htdbm-users jsmith
+     
+ .fi
+  
+diff --git a/docs/man/htpasswd.1 b/docs/man/htpasswd.1
+index 40858a0..1d669a1 100644
+--- a/docs/man/htpasswd.1
++++ b/docs/man/htpasswd.1
+@@ -100,7 +100,7 @@ htpasswd returns a zero status ("true") if the username and password have been s
+  
+ .nf
+ 
+-      htpasswd /usr/local/etc/apache/\&.htpasswd-users jsmith
++      htpasswd /opt/csw/apache2/etc/\&.htpasswd-users jsmith
+     
+ .fi
+  
+diff --git a/docs/man/httpd.8 b/docs/man/httpd.8
+index 5b9e168..d806ebe 100644
+--- a/docs/man/httpd.8
++++ b/docs/man/httpd.8
+@@ -50,7 +50,7 @@ In general, httpd should not be invoked directly, but rather should be invoked v
+  
+ .TP
+ -d \fIserverroot\fR
+-Set the initial value for the ServerRoot directive to \fIserverroot\fR\&. This can be overridden by the ServerRoot directive in the configuration file\&. The default is /usr/local/apache2\&.  
++Set the initial value for the ServerRoot directive to \fIserverroot\fR\&. This can be overridden by the ServerRoot directive in the configuration file\&. The default is /opt/csw/apache2\&.  
+ .TP
+ -f \fIconfig\fR
+ Uses the directives in the file \fIconfig\fR on startup\&. If \fIconfig\fR does not begin with a /, then it is taken to be a path relative to the ServerRoot\&. The default is conf/httpd\&.conf\&.  
+-- 
+1.7.3.2
+

Added: csw/mgar/pkg/apache2/trunk/files/0003-Switch-usr-local-for-opt-csw-in-default-cgi-path.patch
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/0003-Switch-usr-local-for-opt-csw-in-default-cgi-path.patch	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/0003-Switch-usr-local-for-opt-csw-in-default-cgi-path.patch	2011-05-15 14:47:06 UTC (rev 14582)
@@ -0,0 +1,29 @@
+From 4565f79569130fc4ec0bae99fd3829785394f937 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Mon, 28 Feb 2011 01:23:44 +0100
+Subject: [PATCH] Switch usr/local for opt/csw in default cgi path
+
+Modify the default PATH for cgi scripts to use /opt/csw/bin as the
+final element instead of /usr/local/bin.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ include/httpd.h |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/include/httpd.h b/include/httpd.h
+index 40351b7..0fff717 100644
+--- a/include/httpd.h
++++ b/include/httpd.h
+@@ -150,7 +150,7 @@ extern "C" {
+ 
+ /** The default path for CGI scripts if none is currently set */
+ #ifndef DEFAULT_PATH
+-#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
++#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/opt/csw/bin"
+ #endif
+ 
+ /** The path to the suExec wrapper, can be overridden in Configuration */
+-- 
+1.7.3.2
+

Modified: csw/mgar/pkg/apache2/trunk/files/CSWap2worker.postinstall
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/CSWap2worker.postinstall	2011-05-15 13:46:56 UTC (rev 14581)
+++ csw/mgar/pkg/apache2/trunk/files/CSWap2worker.postinstall	2011-05-15 14:47:06 UTC (rev 14582)
@@ -1,52 +1,41 @@
 #!/bin/sh
 
-# this is a special handler for the worker mpm of apache2.  As we ship
-# the init/smf script with the primary package (which provides the
-# default prefork mpm), there is no hook to auto-(re)start apache when
-# this package gets installed.  Unfortunately, the postinstall script
-# is the best way to handle this situation.
+	# Source csw.conf, if it exists
+if [ -f $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf ] ; then
+    . $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf
+fi
+if [ -f $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf ] ; then
+    . $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf
+fi
 
-CSW_PREFIX=/opt/csw
-AP2_PREFIX=$CSW_PREFIX/apache2
-AP2_BINDIR=$AP2_PREFIX/sbin
-AP2_HTTPD=$AP2_BINDIR/httpd
-AP2_CTRL=$AP2_BINDIR/apachectl
-AP2_CONF=/etc/opt/csw/apache2/httpd.conf
-SVCADM=/usr/sbin/svcadm
+# Determine if service should be started or not
+daemon=yes
+if [ "$autoenable_daemons" = "no" ]; then
+    daemon=no
+fi
 
-# only worry about stop/start if we're not installing via jumpstart or
-# similar
-if [ -z "$PKG_INSTALL_ROOT" ]; then
-    [ ! -f "$AP2_CONF" ] && exit 0
+if [ "$autoenable_cswapache2" = "no" ]; then
 
-    # Source csw.conf, if it exists
-    if [ -f /opt/csw/etc/csw.conf ] ; then
-	. /opt/csw/etc/csw.conf
-    fi
-    if [ -f /etc/opt/csw/csw.conf ] ; then
-	. /etc/opt/csw/csw.conf
-    fi
-
+    daemon=no
+elif [ "$autoenable_cswapache2" = "yes" ]; then
     daemon=yes
-    if [ "$autoenable_daemons" = "no" ]; then
-	daemon=no
+fi
+
+if [ "$daemon" = "yes" ]; then
+    # Determine if SMF should be used or not
+    smf=no
+
+    if [ "$use_smf" = "no" ]; then
+	smf=no
+    else
+	if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ]; then
+	    smf=yes
+	fi
     fi
-    if [ "$autoenable_cswapache2" = "no" ]; then
-	daemon=no
-    elif [ "$autoenable_cswapache2" = "yes" ]; then
-	daemon=yes
-    fi
 
-    if [ "$daemon" = "yes" -a -x "$AP2_HTTPD" ]; then
-        if [ -x "$SVCADM" ]; then
-	    $SVCADM disable cswapache2
-	    $SVCADM enable cswapache2
-        elif [ -x "$AP2_CTRL" ]; then
-	    $AP2_CTRL -k stop
-	    $AP2_CTRL -k start
-        fi
-        sleep 2
+    if [ "$smf" = "yes" ]; then
+	svcadm restart cswapache2
+    else
+	/etc/init.d/cswapache2 restart
     fi
 fi
-
-exit 0

Added: csw/mgar/pkg/apache2/trunk/files/CSWap2worker.postremove
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/CSWap2worker.postremove	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/CSWap2worker.postremove	2011-05-15 14:47:06 UTC (rev 14582)
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# Source csw.conf, if it exists
+if [ -f $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf ] ; then
+    . $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf
+fi
+if [ -f $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf ] ; then
+    . $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf
+fi
+
+# On removal of the worker mpm, restart apache to use the prefork (default)
+# mpm...only if it's currently running though
+if [ -n "`pgrep -f apache2/sbin/httpd`" ]; then
+    # Determine if SMF should be used or not
+    smf=no
+
+    if [ "$use_smf" = "no" ]; then
+	smf=no
+    else
+	if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ]; then
+	    smf=yes
+	fi
+    fi
+
+    if [ "$smf" = "yes" ]; then
+	svcadm restart cswapache2
+    else
+	/etc/init.d/cswapache2 restart
+    fi
+fi

Added: csw/mgar/pkg/apache2/trunk/files/CSWap2worker.preinstall
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/CSWap2worker.preinstall	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/CSWap2worker.preinstall	2011-05-15 14:47:06 UTC (rev 14582)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# The old apache2 packages could potentially leave a dangling
+# sbin/httpd file.  As this would prevent successful delivery of the
+# new packages (alternatives won't instantiate sbin/httpd as a symlink
+# since it exists already), we need to kill sbin/httpd if it exists
+# when CSWapache2 is installed.
+
+HTTPD=$PKG_INSTALL_ROOT/opt/csw/apache2/sbin/httpd
+
+if [ -f "$HTTPD" -a ! -L "$HTTPD" ]; then
+   rm -f "$HTTPD"
+fi
+
+exit 0

Deleted: csw/mgar/pkg/apache2/trunk/files/CSWap2worker.preremove
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/CSWap2worker.preremove	2011-05-15 13:46:56 UTC (rev 14581)
+++ csw/mgar/pkg/apache2/trunk/files/CSWap2worker.preremove	2011-05-15 14:47:06 UTC (rev 14582)
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-# Stop httpd.worker prior to removal
-
-CSW_PREFIX=/opt/csw
-AP2_PREFIX=$CSW_PREFIX/apache2
-AP2_BINDIR=$AP2_PREFIX/sbin
-AP2_HTTPD=$AP2_BINDIR/httpd
-AP2_CTRL=$AP2_BINDIR/apachectl
-AP2_CONF=/etc/opt/csw/apache2/httpd.conf
-SVCADM=/usr/sbin/svcadm
-
-[ ! -f "$AP2_CONF" ] && exit 0
-
-if [ -n "`pgrep -f apache2/sbin/httpd`" ]; then
-    if [ -x "$AP2_HTTPD" ]; then
-	if [ -x "$SVCADM" ]; then
-	    $SVCADM disable cswapache2
-	elif [ -x "$AP2_CTRL" ]; then
-	    $AP2_CTRL -k stop
-	fi
-	sleep 2
-    fi
-fi
-
-exit 0

Added: csw/mgar/pkg/apache2/trunk/files/CSWapache2-dev.cswreleasenotes
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/CSWapache2-dev.cswreleasenotes	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/CSWapache2-dev.cswreleasenotes	2011-05-15 14:47:06 UTC (rev 14582)
@@ -0,0 +1,3 @@
+* /usr/local references:
+  - include/httpd.h: specifies default if no HTTPD_ROOT set, overridden via
+    		     ap_config_auto.h

Added: csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall	2011-05-15 14:47:06 UTC (rev 14582)
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+ROOT=${PKG_INSTALL_ROOT:-/}
+CSW_PREFIX=${ROOT}/opt/csw
+AP2_PREFIX=$CSW_PREFIX/apache2
+AP2_BINDIR=$AP2_PREFIX/sbin
+AP2_LIBEXEC=$AP2_PREFIX/libexec
+AP2_CONFDIR=$AP2_PREFIX/etc
+AP2_EXTRADIR=$AP2_CONFDIR/extra
+AP2_RUNDIR=$AP2_PREFIX/var/run
+
+
+UPGRADE_CONFIGS="\
+    httpd.conf \
+    ssl.conf \
+    extra/httpd-ssl.conf \
+    extra/httpd-mpm.conf \
+    "
+# Don't overwrite config if it exists
+warn_update=0
+# For use in config files and certificate generation
+hostname=`hostname`
+echo "Checking configuration files:"
+for file in $UPGRADE_CONFIGS; do
+    config=$AP2_CONFDIR/$file
+    if [ -f "$config" ]; then 
+        if [ -n "`grep mod_auth.so $config`" ]; then
+            echo "Updating syntax of $config to Apache 2.2"
+            $AP2_BINDIR/update20to22 $config
+            warn_update=1
+        fi
+        # Ensure that the PidFile is pointed at ServerRoot relative path.
+        perl -i -plne 's#PidFile /var#PidFile var#'
+    elif [ -f "$config.CSW" ]; then
+        echo "Creating $config from template"
+        sed -e s, at HOSTNAME@,$hostname,g   \
+            -e s, at USER@,nobody,g          \
+            -e s, at GROUP@,nobody,g         \
+            -e s, at ADMIN@,root@$hostname,g $config.CSW > $config
+    fi
+done
+
+if [ $warn_update -eq 1 ] ; then
+cat << EOF
+
+*** NOTICE: Existing configuration files have been updated to
+*** Apache 2.2 syntax.  Additional files can be updated using
+*** /opt/csw/apache2/sbin/update20to22.
+
+EOF
+fi
+
+# Copy templates
+template_list="\
+    share/htdocs/index.html \
+    etc/extra/httpd-autoindex.conf \
+    etc/extra/httpd-dav.conf \
+    etc/extra/httpd-default.conf \
+    etc/extra/httpd-info.conf \
+    etc/extra/httpd-languages.conf \
+    etc/extra/httpd-multilang-errordoc.conf \
+    etc/extra/httpd-userdir.conf \
+    etc/extra/httpd-vhosts.conf \
+    etc/magic \
+    etc/mime.types"
+
+echo Copying CSW templates:
+for file in $template_list
+do
+    filepath=$AP2_PREFIX/$file
+    if [ -f "$filepath" ]; then
+        echo "  preserving $filepath"
+    elif [ -f "$filepath.CSW" ]; then
+        echo "  creating $filepath"
+        cp $filepath.CSW $filepath
+    fi
+done
+
+if [ ! -f $AP2_CONFDIR/server.crt -a ! -f $AP2_CONFDIR/server.key ]; then
+    echo Generating dummy ssl key and certificate...
+    # this is likely overkill for a dummy cert, but why not
+    umask 0077
+    cat <<EOF | /usr/sbin/chroot ${ROOT} /opt/csw/bin/openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout /opt/csw/apache2/etc/server.key  -out /opt/csw/apache2/etc/server.crt >/dev/null 2>&1
+TS
+Westfarthing
+Hobbiton
+
+
+$hostname
+bilbo at example.net
+
+
+EOF
+fi
+
+if [ ! -d "$AP2_RUNDIR" ]; then
+    echo "Creating var/run..."
+    mkdir -p "$AP2_RUNDIR"
+fi
+
+exit 0

Modified: csw/mgar/pkg/apache2/trunk/files/README.CSW.apache2
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/README.CSW.apache2	2011-05-15 13:46:56 UTC (rev 14581)
+++ csw/mgar/pkg/apache2/trunk/files/README.CSW.apache2	2011-05-15 14:47:06 UTC (rev 14582)
@@ -3,8 +3,6 @@
 Please note that recent changes may affect the way you're used to
 working with the CSW apache2 packages.
 
-*****************************************************
-
 In the past, CSWap2prefork and CSWap2worker delivered a specific mpm
 module for use with apache2.  We now ship the prefork mpm as part of
 CSWapache2 while the worker mpm remains in CSWap2worker.
@@ -16,23 +14,5 @@
 /opt/csw/sbin/alternatives --help for information on how you can do
 this.
 
-
-*****************************************************
-
-We are also moving configuration of apache from /opt/csw/apache2/etc
-to /etc/opt/csw/apache2.  The files should be auto-migrated upon
-upgrade but if you've broken from the standard config file layout,
-you'll need to manually copy in those additional files.  Sorry for the
-hassle, but this really needs to be done for a package like apache
-where the configuration will be unique on most machines.
-
-*****************************************************
-
-The default log directory is now /var/opt/csw/log/apache2.  Old logs
-are not touched and the configuration will honour the old location.  You
-should updated this and move the logs manually.
-
-*****************************************************
-
 Thanks
 -The OpenCSW apache2 team.

Deleted: csw/mgar/pkg/apache2/trunk/files/build_cas_template
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/build_cas_template	2011-05-15 13:46:56 UTC (rev 14581)
+++ csw/mgar/pkg/apache2/trunk/files/build_cas_template	2011-05-15 14:47:06 UTC (rev 14582)
@@ -1,52 +0,0 @@
-#!/bin/bash
-
-cat <<EOF
-#!/bin/sh
-
-PIR=\${PKG_INSTALL_ROOT:-/}
-AP2_DIR=/opt/csw/apache2
-AP2_CONF=\$PIR/etc/opt/csw/apache2
-OLD_CONF=\$PIR\$AP2_DIR/etc
-
-NEW_CONF_FILE=\$AP2_CONF/$1
-OLD_CONF_FILE=\$OLD_CONF/$1
-
-if [ "\$1" = install ]; then
-   if [ -f "\$NEW_CONF_FILE" ]; then
-      # existing 2.2.x install with migrated config.
-      echo "Doing nothing.  Config file \$NEW_CONF_FILE in place already." >&2
-   elif [ -f "\$OLD_CONF_FILE" ]; then
-      # migrate old config, ensure it's updated
-      echo "Importing old config file from \$OLD_CONF_FILE." >&2
-      cp -p \$OLD_CONF_FILE \$NEW_CONF_FILE
-      if [ -n "\`grep mod_auth.so \$NEW_CONF_FILE\`" ]; then
-         echo "Updating the syntax to 2.2 format though..." >&2
-         \${PIR}/\$AP2_DIR/sbin/update20to22 \$NEW_CONF_FILE >&2
-      fi
-
-      # handle the new path to default ssl key files.
-      # update various uses of the var/ paths.
-      # ensure we use the config files from the new location 
-      perl -pi -e "s/\/opt\/csw\/apache2\/etc\/server.crt/\/etc\/opt\/csw\/apache2\/server.crt/;" -e "s/\/opt\/csw\/apache2\/etc\/server.key/\/etc\/opt\/csw\/apache2\/server.key/;" -e "s/\/opt\/csw\/apache2\/var\/log\//\/var\/opt\/csw\/log\/apache2\//;" -e "s/\"\/opt\/csw\/apache2\/var\//\"\/var\/opt\/csw\/apache2\//;" -e "s/\"var\/log\//\"\/var\/opt\/csw\/log\/apache2\//;" -e "s/ etc\// \/etc\/opt\/csw\/apache2\//;" \$NEW_CONF_FILE
-   else
-      # so, we're not an existing or 'needs migration' install, we must
-      # install from the templates.
-      echo "Installing $1 from CSW template." >&2
-      cp -p \$NEW_CONF_FILE.CSW \$NEW_CONF_FILE
-      perl -pi \
-	-e "s/#*ServerName.*www.example.com/ServerName \`hostname\`/;" \
-	-e "s/#*ServerAdmin you\@example.com/ServerAdmin root\@\`hostname\`/;" \
-	-e "s/^User.*daemon/User nobody/;" \
-	-e "s/^Group.*daemon/Group nobody/;" \
-	-e 's/^(LoadModule.*suexec.*)/#\$1/;' \
-	-e 's/^#(Include.*httpd-mpm.conf)/\$1/;' \$NEW_CONF_FILE
-
-      chown root:bin \$NEW_CONF_FILE
-      chmod 644 \$NEW_CONF_FILE
-   fi
-else
-   echo "Not removing $1." >&2
-   # preserve ourselves with no changes
-   cat \$NEW_CONF_FILE
-fi
-EOF

Modified: csw/mgar/pkg/apache2/trunk/files/config.layout
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/config.layout	2011-05-15 13:46:56 UTC (rev 14581)
+++ csw/mgar/pkg/apache2/trunk/files/config.layout	2011-05-15 14:47:06 UTC (rev 14582)
@@ -7,7 +7,7 @@
     libdir:        ${exec_prefix}/lib
     libexecdir:    ${exec_prefix}/libexec
     mandir:        ${exec_prefix}/man
-    sysconfdir:    /etc/${prefix}
+    sysconfdir:    ${exec_prefix}/etc
     datadir:       ${prefix}/share
     installbuilddir: ${datadir}/build
     errordir:      ${datadir}/error
@@ -16,8 +16,8 @@
     manualdir:     ${datadir}/manual
     cgidir:        ${datadir}/cgi-bin
     includedir:    ${exec_prefix}/include
-    localstatedir: /var/opt/csw/apache2
+    localstatedir: ${prefix}/var
     runtimedir:    /var/run
-    logfiledir:    /var/opt/csw/log/apache2
+    logfiledir:    ${localstatedir}/log
     proxycachedir: ${datadir}/proxy
 </Layout>

Modified: csw/mgar/pkg/apache2/trunk/files/cswapache2
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/cswapache2	2011-05-15 13:46:56 UTC (rev 14581)
+++ csw/mgar/pkg/apache2/trunk/files/cswapache2	2011-05-15 14:47:06 UTC (rev 14582)
@@ -12,9 +12,9 @@
 #RC_SLEV 3
 #FMRI network
 
-CONF_FILE=/etc/opt/csw/apache2/httpd.conf
-APACHECTL=/opt/csw/apache2/sbin/apachectl
-SERVERCRT=/etc/opt/csw/apache2/server.crt
+APACHE_HOME=/opt/csw/apache2
+CONF_FILE=$APACHE_HOME/etc/httpd.conf
+APACHECTL=$APACHE_HOME/sbin/apachectl
 
 [ ! -f "$CONF_FILE" ] && exit 0
 [ ! -x "$APACHECTL" ] && exit 0
@@ -22,7 +22,7 @@
 case "$1" in
 start)
     cmd=$1
-    if [ -f "$SERVERCRT" ]; then
+    if [ -f "$APACHE_HOME/etc/server.crt" ]; then
         cmd="$cmd -DSSL"
     fi
     ;;

Added: csw/mgar/pkg/apache2/trunk/files/i.cswap2mod
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/i.cswap2mod	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/i.cswap2mod	2011-05-15 14:47:06 UTC (rev 14582)
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+# i.cswap2mod - Class action script for installing apache2 modules
+#
+# Written by Ben Walton
+#
+# 2010-09-29 First Release
+#
+
+# Source csw.conf, if it exists
+if [ -f $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf ] ; then
+  . $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf
+fi
+if [ -f $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf ] ; then
+  . $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf
+fi
+
+AP2_PREFIX=/opt/csw/apache2
+AP2_BINDIR=$AP2_PREFIX/sbin
+AP2_LIBEXEC=$AP2_PREFIX/libexec
+AP2_CONFDIR=$AP2_PREFIX/etc
+AP2_CONFIG=$AP2_CONFDIR/httpd.conf
+AP2_APXS=$AP2_BINDIR/apxs
+
+PKG_INSTALL_ROOT=${PKG_INSTALL_ROOT:-'/'}
+
+while read src dest; do
+      # Place the file first
+      /usr/bin/cp -p $src $dest || exit 2
+      echo $dest
+      
+      CONF=$PKG_INSTALL_ROOT/$AP2_CONFIG
+      APXS=$PKG_INSTALL_ROOT/$AP2_APXS
+      MODFILE=`basename $dest`
+      MODNAME=`echo $MODFILE | sed 's/mod_//; s/\.so$//'`
+
+      # Modules will be enabled by default, but a global kill switch
+      # is checked , followed by a module specific value.  Thus,
+      # either ap2_enable_modules or ap2_enable_suexec (for example)
+      # could disable activation of the suexec module.  The 
+      #
+      # This value is passed to apxs (-a: add, enable; -A: add,
+      # disable)
+      enmod=-a
+
+      if [ "$ap2_enable_modules" = "no" ]; then
+	  enmod=-A
+      fi
+
+      eval ap2_mod_specific="\$ap2_enable_$MODNAME"
+      if [ "$ap2_mod_specific" = "no" ]; then
+	  enmod=-A
+      elif [ "$ap2_mod_specific" = "yes" ]; then
+	  enmod=-a
+      fi
+
+      if [ -f "$CONF" -a -x "$APXS" ]; then
+	  # Add the module module, optionally enabling it by default
+	  chroot $PKG_INSTALL_ROOT \
+	      $APXS -e $enmod -n $MODNAME $MODFILE
+	  conftouched=1
+      fi
+done
+
+if [ "$conftouched" = "1" ]; then
+	  cat <<END
+
+
+NOTICE: One or more LoadModule lines was added to your httpd.conf.
+Depending on your csw.conf settings for ap2_enable_modules or
+ap2_enable_\$modulename they may be enabled.  Please review the
+changes, make any futher modifications and then restart apache as
+required.
+
+
+END
+fi
+
+exit 0


Property changes on: csw/mgar/pkg/apache2/trunk/files/i.cswap2mod
___________________________________________________________________
Added: svn:executable
   + *

Deleted: csw/mgar/pkg/apache2/trunk/files/index_cas_template
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/index_cas_template	2011-05-15 13:46:56 UTC (rev 14581)
+++ csw/mgar/pkg/apache2/trunk/files/index_cas_template	2011-05-15 14:47:06 UTC (rev 14582)
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-PIR=${PKG_INSTALL_ROOT:-/}
-INDEX_HTML=${PIR}/opt/csw/apache2/share/htdocs/index.html
-
-
-
-if [ "$1" = install ]; then
-   if [ ! -f "$INDEX_HTML" ]; then
-      echo "Installing default index.html..." >&2
-      echo "<html><body><h1>It works!</h1></body></html>" > ${INDEX_HTML}
-   fi
-
-   # create our 'template' version of the file regardless of normal version
-   echo "<html><body><h1>It works!</h1></body></html>"
-fi

Added: csw/mgar/pkg/apache2/trunk/files/r.cswap2mod
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/r.cswap2mod	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/r.cswap2mod	2011-05-15 14:47:06 UTC (rev 14582)
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# r.cswap2mod - Class action script for removing apache2 modules
+#
+# Written by Ben Walton
+#
+# 2010-09-29 First Release
+#
+
+AP2_PREFIX=/opt/csw/apache2
+AP2_BINDIR=$AP2_PREFIX/sbin
+AP2_LIBEXEC=$AP2_PREFIX/libexec
+AP2_CONFDIR=$AP2_PREFIX/etc
+AP2_CONFIG=$AP2_CONFDIR/httpd.conf
+AP2_APXS=$AP2_BINDIR/apxs
+
+PKG_INSTALL_ROOT=${PKG_INSTALL_ROOT:-'/'}
+
+while read dest; do
+      echo $dest
+      
+      CONF=$PKG_INSTALL_ROOT/$AP2_CONFIG
+      APXS=$PKG_INSTALL_ROOT/$AP2_APXS
+      MODFILE=`basename $dest`
+      MODNAME=`echo $MODFILE | sed 's/mod_//; s/\.so$//'`
+
+      if [ -f "$CONF" -a -x "$APXS" ]; then
+	  # Disable the module
+	  chroot $PKG_INSTALL_ROOT \
+	      $APXS -e -A -n $MODNAME $MODFILE
+	  conftouched=1
+      fi
+
+      # Now actually remove the file.
+      /usr/bin/rm -f $dest || exit 2
+done
+
+if [ "$conftouched" = "1" ]; then
+	  cat <<END
+
+
+NOTICE: One or more apache modules was disabled in your apache
+configuration.  Please review these changes and restart apache as
+required.
+
+
+END
+fi
+
+exit 0


Property changes on: csw/mgar/pkg/apache2/trunk/files/r.cswap2mod
___________________________________________________________________
Added: svn:executable
   + *

Deleted: csw/mgar/pkg/apache2/trunk/files/ssl_cas_template
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/ssl_cas_template	2011-05-15 13:46:56 UTC (rev 14581)
+++ csw/mgar/pkg/apache2/trunk/files/ssl_cas_template	2011-05-15 14:47:06 UTC (rev 14582)
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-PIR=${PKG_INSTALL_ROOT:-/}
-AP2_DIR=/opt/csw/apache2
-AP2_CONF=$PIR/etc/opt/csw/apache2
-OLD_CONF=$PIR/$AP2_DIR/etc
-
-NEW_CERT_FILE=$AP2_CONF/server.crt
-NEW_KEY_FILE=$AP2_CONF/server.key
-OLD_CERT_FILE=$OLD_CONF/server.crt
-OLD_KEY_FILE=$OLD_CONF/server.key
-
-if [ "$1" = install ]; then
-   if [ -f "$NEW_CERT_FILE" ]; then
-      echo "SSL key files in place already.  Doing nothing." >&2
-   elif [ -f "$OLD_CERT_FILE" ]; then
-      # migrate old files.
-      echo "Importing old SSL files from /opt/csw/apache2/etc." >&2
-      cp -p $OLD_CERT_FILE $NEW_CERT_FILE
-      cp -p $OLD_KEY_FILE $NEW_KEY_FILE
-      chown root:bin $NEW_CERT_FILE $NEW_KEY_FILE
-   else
-      echo Generating dummy ssl key and certificate... >&2
-      # this is likely overkill for a dummy cert, but why not
-      cat <<EOF | /usr/sbin/chroot ${PIR} /opt/csw/bin/openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout /etc/opt/csw/apache2/server.key  -out /etc/opt/csw/apache2/server.crt >/dev/null 2>&1
-TS
-Westfarthing
-Hobbiton
-
-
-`hostname`
-bilbo at example.net
-
-
-EOF
-      chown root:bin $NEW_CERT_FILE $NEW_KEY_FILE
-   fi
-   cat <<EOF
-This is a placeholder file used only to ease migration of server.crt
-and server.key to the new etc/ location for $PKGINST.  Please leave the
-file in place, but ignore it otherwise.
-EOF
-fi


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list