[csw-devel] SF.net SVN: gar:[11587] csw/mgar/pkg/apache2/trunk
bdwalton at users.sourceforge.net
bdwalton at users.sourceforge.net
Fri Nov 12 03:51:53 CET 2010
Revision: 11587
http://gar.svn.sourceforge.net/gar/?rev=11587&view=rev
Author: bdwalton
Date: 2010-11-12 02:51:53 +0000 (Fri, 12 Nov 2010)
Log Message:
-----------
apache2: move postinstall functionality to the templated .CSW config files using build CAS
Modified Paths:
--------------
csw/mgar/pkg/apache2/trunk/Makefile
csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall
Modified: csw/mgar/pkg/apache2/trunk/Makefile
===================================================================
--- csw/mgar/pkg/apache2/trunk/Makefile 2010-11-12 02:33:40 UTC (rev 11586)
+++ csw/mgar/pkg/apache2/trunk/Makefile 2010-11-12 02:51:53 UTC (rev 11587)
@@ -212,7 +212,7 @@
@$(MAKECOOKIE)
-post-install-modulated: rename-httpd copy-local-files create-templates copy-readmes
+post-install-modulated: rename-httpd copy-local-files copy-readmes
copy-readmes:
@(cd $(WORKDIR); for f in README.CSW*; do \
@@ -235,40 +235,27 @@
@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:
+post-merge: create-templates
+ @echo " => Creating template files"
+ @$(FILEDIR)/conf_build_scripts $(PKGROOT)
+ @echo " => Modifying template files for specific cases"
@(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\@/; \
+ for f in httpd.conf.CSW extra/httpd-ssl.conf.CSW; do \
+ echo ...$$f; \
+ perl -pi -e 's/#*ServerName www.example.com:(80|443)/EOS\necho ServerName `hostname`:$$1 >> \$$TEMPLATE;\ncat <<EOS >>\$$TEMPLATE/; \
+ s/#*ServerAdmin you\@example.com/EOS\necho ServerAdmin root@`hostname` >> \$$TEMPLATE;\ncat <<EOS >>\$$TEMPLATE/; \
+ s/^User.*daemon/User nobody/; \
+ s/^Group.*daemon/Group nobody/; \
s/^(LoadModule.*suexec.*)/#$$1/; \
s/^#(Include.*httpd-mpm.conf)/$$1/; \
s/^#(Include.*httpd-ssl.conf)/$$1/' $$f; \
- mv $$f $$f.CSW; \
- done )
+ done )
+
+
+
@$(MAKECOOKIE)
Modified: csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall 2010-11-12 02:33:40 UTC (rev 11586)
+++ csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall 2010-11-12 02:51:53 UTC (rev 11587)
@@ -31,12 +31,6 @@
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
@@ -50,32 +44,6 @@
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
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