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

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Sun Nov 14 03:57:23 CET 2010


Revision: 11604
          http://gar.svn.sourceforge.net/gar/?rev=11604&view=rev
Author:   bdwalton
Date:     2010-11-14 02:57:23 +0000 (Sun, 14 Nov 2010)

Log Message:
-----------
apache2: move the ssl dummy cert generation to a separate script and use the build CAS for it

Modified Paths:
--------------
    csw/mgar/pkg/apache2/trunk/Makefile
    csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall

Added Paths:
-----------
    csw/mgar/pkg/apache2/trunk/files/server.crt.build_cas

Modified: csw/mgar/pkg/apache2/trunk/Makefile
===================================================================
--- csw/mgar/pkg/apache2/trunk/Makefile	2010-11-14 01:51:43 UTC (rev 11603)
+++ csw/mgar/pkg/apache2/trunk/Makefile	2010-11-14 02:57:23 UTC (rev 11604)
@@ -40,7 +40,7 @@
 DISTFILES += CSWapache2.preinstall CSWapache2.postinstall
 
 # Configuration templates
-DISTFILES += update20to22
+DISTFILES += update20to22 server.crt.build_cas
 DISTFILES += README.CSW.apache2 README.CSW.ap2_prefork
 DISTFILES += README.CSW.apache2rt
 
@@ -256,5 +256,6 @@
 		s/^#(Include.*httpd-mpm.conf)/$$1/; \
 		s/^#(Include.*httpd-ssl.conf)/$$1/' $$f; \
                done )
+	@cp -p $(WORKDIR)/server.crt.build_cas $(PKGROOT)/$(prefix)/apache2/etc/server.crt.CSW
 	@$(MAKECOOKIE)
 

Modified: csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall	2010-11-14 01:51:43 UTC (rev 11603)
+++ csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall	2010-11-14 02:57:23 UTC (rev 11604)
@@ -44,21 +44,4 @@
 EOF
 fi
 
-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
-
 exit 0

Added: csw/mgar/pkg/apache2/trunk/files/server.crt.build_cas
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/server.crt.build_cas	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/server.crt.build_cas	2010-11-14 02:57:23 UTC (rev 11604)
@@ -0,0 +1,27 @@
+# On installation, generate a dummy ssl certificate
+
+PIR=${PKG_INSTALL_ROOT:-/}
+AP2_PREFIX=/opt/csw/apache2
+AP2_CONFDIR=$AP2_PREFIX/etc
+
+if [ "$1" = install ]; then
+    echo "A dummy file created during ${PKGINST} installation." > ${PIR}/$AP2_CONF/server.crt.CSW
+    if [ ! -f $PIR/$AP2_CONFDIR/server.crt -a ! -f $PIR/$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 ${PIR} /opt/csw/bin/openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout $AP2_CONFDIR/server.key  -out $AP2_CONFDIR/server.crt >/dev/null 2>&1
+TS
+Westfarthing
+Hobbiton
+
+
+$hostname
+bilbo at example.net
+
+
+EOF
+    fi
+else
+    rm ${PIR}/$AP2_CONF/server.crt.CSW
+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