[csw-devel] SF.net SVN: gar:[4995] csw/mgar/pkg/drupal/trunk

valholla at users.sourceforge.net valholla at users.sourceforge.net
Thu May 21 17:32:18 CEST 2009


Revision: 4995
          http://gar.svn.sourceforge.net/gar/?rev=4995&view=rev
Author:   valholla
Date:     2009-05-21 15:32:17 +0000 (Thu, 21 May 2009)

Log Message:
-----------
package checkin

Modified Paths:
--------------
    csw/mgar/pkg/drupal/trunk/Makefile
    csw/mgar/pkg/drupal/trunk/checksums

Added Paths:
-----------
    csw/mgar/pkg/drupal/trunk/files/httpd-drupal.conf.CSW

Modified: csw/mgar/pkg/drupal/trunk/Makefile
===================================================================
--- csw/mgar/pkg/drupal/trunk/Makefile	2009-05-21 15:14:27 UTC (rev 4994)
+++ csw/mgar/pkg/drupal/trunk/Makefile	2009-05-21 15:32:17 UTC (rev 4995)
@@ -14,6 +14,7 @@
 
 MASTER_SITES = http://ftp.drupal.org/files/projects/
 DISTFILES  = $(GARNAME)-$(GARVERSION).tar.gz
+DISTFILES += httpd-drupal.conf.CSW
 
 PACKAGES = CSWdrupal
 CATALOGNAME_CSWdrupal = drupal
@@ -39,9 +40,94 @@
 test-skip:
 	@$(MAKECOOKIE)
 
+DRUPAL_BASE_INSTDIR = $(prefix)
+DRUPAL_INST_DIR = $(DRUPAL_BASE_INSTDIR)/$(GARNAME)/$(GARVERSION)
+SETTINGS_DIR=$(DRUPAL_INST_DIR)/sites/default
+
 install-custom:
-	ginstall -d $(DESTDIR)$(prefix)/$(GARNAME)/$(GARVERSION)
-	cd $(WORKSRC); /usr/bin/pax -rw -v * $(DESTDIR)$(prefix)/$(GARNAME)/$(GARVERSION)
+	ginstall -d $(DESTDIR)$(DRUPAL_INST_DIR)
+	ginstall -d $(DESTDIR)$(prefix)/apache2/etc/extra
+	cd $(WORKSRC); /usr/bin/pax -rw -v * $(DESTDIR)$(DRUPAL_INST_DIR)
+	gmv $(DESTDIR)$(SETTINGS_DIR)/default.settings.php $(DESTDIR)$(SETTINGS_DIR)/settings.php.CSW
+	gcp $(DOWNLOADDIR)/httpd-drupal.conf.CSW $(DESTDIR)$(prefix)/apache2/etc/extra
 	@$(MAKECOOKIE)
 
+
+define CSWdrupal_postinstall
+#!/bin/sh
+
+PATH=/usr/bin:/usr/sbin
+
+AP2CONF=/opt/csw/apache2/etc/httpd.conf
+AP2EXTRADIR=/opt/csw/apache2/etc/extra
+AP2USR="`sed -ne 's/^User \(.*\)/\1/p' $${AP2CONF}`"
+AP2GRP="`sed -ne 's/^Group \(.*\)/\1/p' $${AP2CONF}`"
+
+if [ -z $${AP2USR} ]; then
+	AP2USR=nobody
+fi
+if [ -z $${AP2GRP} ]; then
+	AP2GRP=nobody
+fi
+chown -R $${AP2USR}:$${AP2GRP} $(DRUPAL_BASE_INSTDIR)/$(GARNAME)
+
+if [ -f $(SETTINGS_DIR)/settings.php ]; then
+    echo "***** $(SETTINGS_DIR)/settings.php Found ***** "
+	echo "***** Preserving Existing Config ***** "
+else
+	cp $(SETTINGS_DIR)/settings.php.CSW $(SETTINGS_DIR)/settings.php
+	chmod o+w $(SETTINGS_DIR)/settings.php
+	chmod o+w $(SETTINGS_DIR)
+fi
+
+perl -i -pne 's|_DRUPALDIR_|$(DRUPAL_INST_DIR)|' $${AP2EXTRADIR}/httpd-drupal.conf.CSW
+
+if [ -f $${AP2EXTRADIR}/httpd-drupal.conf ]; then
+	echo "***** $${AP2EXTRADIR}/httpd-drupal.conf Found *****"
+	echo "***** Preserving Existing Config *****"
+else
+	cp $${AP2EXTRADIR}/httpd-drupal.conf.CSW $${AP2EXTRADIR}/httpd-drupal.conf
+fi
+
+if [ -n "`grep 'Include etc/extra/httpd-drupal.conf' $${AP2CONF}`" ]; then
+	perl -i -pne 's|#(Include etc/extra/httpd-drupal.conf)|$$1|' $${AP2CONF}
+else
+	cat << END >>$${AP2CONF}
+	
+Include etc/extra/httpd-drupal.conf
+END
+fi
+cat << _EOM_
+
+*********************************************************************
+*    NOTICE:
+*          drupal has been enabled in $${AP2CONF}
+*          You will need to restart your web server
+*          To finish the install.
+*********************************************************************
+
+_EOM_
+endef
+
+define CSWdrupal_preremove
+#!/bin/sh
+
+PATH=/usr/bin:/usr/sbin
+
+AP2CONF=/opt/csw/apache2/etc/httpd.conf
+
+perl -i -pne 's|(?<!#)(Include etc/extra/httpd-drupal.conf)|#$$1|' $${AP2CONF}
+
+cat << _EOM_
+
+*********************************************************************
+*    NOTICE:
+*          drupal has been disabled in $${AP2CONF}
+*          You will need to restart your web server
+*          To finish the removal.
+*********************************************************************
+
+_EOM_
+endef
+
 include gar/category.mk

Modified: csw/mgar/pkg/drupal/trunk/checksums
===================================================================
--- csw/mgar/pkg/drupal/trunk/checksums	2009-05-21 15:14:27 UTC (rev 4994)
+++ csw/mgar/pkg/drupal/trunk/checksums	2009-05-21 15:32:17 UTC (rev 4995)
@@ -1 +1,2 @@
 82e2517f175320cffe20997333b3a33a  download/drupal-6.12.tar.gz
+6f0b81503fb622b33f27a1ba63e66560  download/httpd-drupal.conf.CSW

Added: csw/mgar/pkg/drupal/trunk/files/httpd-drupal.conf.CSW
===================================================================
--- csw/mgar/pkg/drupal/trunk/files/httpd-drupal.conf.CSW	                        (rev 0)
+++ csw/mgar/pkg/drupal/trunk/files/httpd-drupal.conf.CSW	2009-05-21 15:32:17 UTC (rev 4995)
@@ -0,0 +1,15 @@
+
+Alias /drupal "_DRUPALDIR_"
+
+<Directory "_DRUPALDIR_">
+    AllowOverride None
+    <Limit GET POST OPTIONS>
+        Order allow,deny
+        Allow from all
+    </Limit>
+    <LimitExcept GET POST OPTIONS>
+        Order deny,allow
+        Deny from all
+    </LimitExcept>
+</Directory>
+


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