diff options
author | Daniel Joseph Barnhart Clark <dclark@pobox.com> | 2006-09-02 23:06:16 +0000 |
---|---|---|
committer | Daniel Joseph Barnhart Clark <dclark@pobox.com> | 2006-09-02 23:06:16 +0000 |
commit | 57a3484065040d4a651187d21482ccdd4a8faac4 (patch) | |
tree | f087d0ea0334eb816fef7a7ad8ac59795aed29e2 /encap/src | |
parent | 9a5ec9dd1783f69fc4870f72ba7dfd8035422607 (diff) | |
download | bcfg2-57a3484065040d4a651187d21482ccdd4a8faac4.tar.gz bcfg2-57a3484065040d4a651187d21482ccdd4a8faac4.tar.bz2 bcfg2-57a3484065040d4a651187d21482ccdd4a8faac4.zip |
EncapPackages:
* Delete VERSION and ChangeLog, just use bcfg2 version or svn release #
* Update install scripts to allow forcing replacement of local config files
* Make python build fail if "from httplib import HTTPS" fails
* Some doc updates
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2172 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'encap/src')
-rw-r--r-- | encap/src/Makefile | 25 | ||||
-rwxr-xr-x | encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl | 56 | ||||
-rw-r--r-- | encap/src/encap-profiles/Makefile | 8 | ||||
-rw-r--r-- | encap/src/encap-profiles/bcfg2-python-2.4.3.ep | 12 | ||||
-rwxr-xr-x | encap/src/makeself-dist/makedist.sh | 14 |
5 files changed, 104 insertions, 11 deletions
diff --git a/encap/src/Makefile b/encap/src/Makefile index 9547709dd..fec6f66b7 100644 --- a/encap/src/Makefile +++ b/encap/src/Makefile @@ -2,7 +2,10 @@ export SHELL = /bin/sh -.PHONY : test log all clean uninstall +.PHONY : test log all clean distclean uninstall + +DEST ?= DIST +MKINSTALLDIRS = ./bcfg2-site/bcfg2-site-RENAME/mkinstalldirs log : @printf "Building in background, and logging to ./make.log\n" @@ -12,21 +15,31 @@ all : $(MAKE) -C ./encap-profiles all $(MAKE) -C ./bcfg2-site all $(MAKE) -C ./makeself-dist all + if [ ! -d $(DEST) ]; then $(MKINSTALLDIRS) $(DEST); fi + cp makeself-dist/*.run $(DEST) + cp encap-profiles/*doc*.tar.gz $(DEST) + cp encap-profiles/bcfg2-cheetah-[0-9]*.tar.gz $(DEST) + -cp encap-profiles/bcfg2-glib-*.tar.gz $(DEST) + -cp encap-profiles/bcfg2-gamin-*.tar.gz $(DEST) @printf "\n\n### encap build finished...\n" @printf "## Client install self-extracting/installing package is:\n" - @printf "%s\n" "`ls makeself-dist/*.run 2>/dev/null`" + @printf "%s\n" "`ls $(DEST)/*.run 2>/dev/null`" @printf "# Use 'epkg -i <packagename>' to install encap packages...\n" @printf "## Doc encap packages are:\n" - -@(ls encap-profiles/*doc*.tar.gz 2>/dev/null) + -@(ls $(DEST)/*doc*.tar.gz 2>/dev/null) @printf "## Server encap packages, if built (GNU/Linux only), are:\n" - -@printf "%s\n" "`ls encap-profiles/bcfg2-glib-*.tar.gz 2>/dev/null`" - -@printf "%s\n" "`ls encap-profiles/bcfg2-gamin-*.tar.gz 2>/dev/null`" - -@printf "%s\n" "`ls encap-profiles/bcfg2-cheetah-[0-9]*.tar.gz 2>/dev/null`" + -@printf "%s\n" "`ls $(DEST)/bcfg2-glib-*.tar.gz 2>/dev/null`" + -@printf "%s\n" "`ls $(DEST)/bcfg2-gamin-*.tar.gz 2>/dev/null`" + -@printf "%s\n" "`ls $(DEST)/bcfg2-cheetah-[0-9]*.tar.gz 2>/dev/null`" @printf "\n" clean : -rm ./*.log ./*~ ./\#* +distclean: clean + -rm $(DEST)/* + -rmdir $(DEST) + uninstall : clean $(MAKE) -C ./encap-profiles uninstall $(MAKE) -C ./bcfg2-site distclean diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl b/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl index 8a20a968d..1ac29eb7e 100755 --- a/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl +++ b/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl @@ -22,17 +22,33 @@ ${MKINSTALLDIRS} "${BASEDIR}/sbin" rmcp() { SRCFILENAME="`basename ${1}`" - if [ -d "${2}" ]; then + if [ -d "${2}" ]; then DESTDIRNAME="$2" else DESTDIRNAME="`dirname ${2}`" fi TARGETNAME="$DESTDIRNAME/$SRCFILENAME" - if [ -h "$TARGETNAME" ]; then rm "$TARGETNAME"; fi - if [ -f "$TARGETNAME" ]; then rm "$TARGETNAME"; fi + RMTARGET="no" + if [ -h "$TARGETNAME" ]; then RMTARGET="yes"; fi + if [ -f "$TARGETNAME" ]; then RMTARGET="yes"; fi + if [ "${RMTARGET}x"="yesx" ]; then + DATE="`date +%Y-%m-%d--%H-%M-%S`" + printf "INFO: Moving old $TARGETNAME to ${TARGETNAME}-${DATE}...\n" + cp "$TARGETNAME" "${TARGETNAME}-${DATE}" && rm "$TARGETNAME" + fi + printf "INFO: Copying %s to %s...\n" "$1" "$2" cp "$1" "$2" } +# bcfg2-client (options) +if [ "${REPLACE_CONFIG}x" = "yesx" ]; then + printf "REPLACE_CONFIG=yes, so removing bcfg2-client sentinel files...\n" + S_B="${BASEDIR}/etc/default/bcfg2-client/.SENTINEL_BCFG2" + test -f ${S_B} && rm ${S_B} + S_S="${BASEDIR}/etc/default/bcfg2-client/.SENTINEL_SITE" + test -f ${S_S} && rm ${S_S} +fi + if [ -f ${BASEDIR}/etc/default/bcfg2-client/.SENTINEL_BCFG2 ]; then printf "INFO: bcfg2 client options have been updated by bcfg2 -\n" printf "INFO: not replacing that configuration.\n" @@ -46,6 +62,15 @@ else touch ${BASEDIR}/$DIR/.SENTINEL_SITE fi +# bcfg2-server (options) +if [ "${REPLACE_CONFIG}x" = "yesx" ]; then + printf "REPLACE_CONFIG=yes, so removing bcfg2-server sentinel files...\n" + S_B="${BASEDIR}/etc/default/bcfg2-server/.SENTINEL_BCFG2" + test -f ${S_B} && rm ${S_B} + S_S="${BASEDIR}/etc/default/bcfg2-server/.SENTINEL_SITE" + test -f ${S_S} && rm ${S_S} +fi + if [ -f ${BASEDIR}/etc/default/bcfg2-server/.SENTINEL_BCFG2 ]; then printf "INFO: bcfg2 server options have been updated by bcfg2 -\n" printf "INFO: not replacing that configuration.\n" @@ -58,6 +83,15 @@ else touch ${BASEDIR}/$DIR/.SENTINEL_SITE fi +# bcfg2.conf & ostiary.conf +if [ "${REPLACE_CONFIG}x" = "yesx" ]; then + printf "REPLACE_CONFIG=yes, so removing ${BASEDIR}/etc sentinel files...\n" + S_B="${BASEDIR}/etc/.SENTINEL_BCFG2" + test -f ${S_B} && rm ${S_B} + S_S="${BASEDIR}/etc/.SENTINEL_SITE" + test -f ${S_S} && rm ${S_S} +fi + if [ -f ${BASEDIR}/etc/.SENTINEL_BCFG2 ]; then printf "INFO: bcfg2.conf and/or ostiary.cfg may have been updated by\n" printf "INFO: bcfg2 - not replacing that configuration.\n" @@ -70,6 +104,15 @@ else touch ${BASEDIR}/etc/.SENTINEL_SITE fi +# ost-bcfg2.sh +if [ "${REPLACE_CONFIG}x" = "yesx" ]; then + printf "REPLACE_CONFIG=yes, so removing ${BASEDIR}/sbin sentinel files...\n" + S_B="${BASEDIR}/sbin/.SENTINEL_BCFG2" + test -f ${S_B} && rm ${S_B} + S_S="${BASEDIR}/sbin/.SENTINEL_SITE" + test -f ${S_S} && rm ${S_S} +fi + if [ -f ${BASEDIR}/sbin/.SENTINEL_BCFG2 ]; then printf "INFO: ost-bcfg2.sh may have been updated by bcfg2 -\n" printf "INFO: not replacing that configuration with this script.\n" @@ -81,8 +124,10 @@ else touch ${BASEDIR}/sbin/.SENTINEL_SITE fi +# ostiary (daemontools) if [ ! -h /service/ostiary ]; then if [ -d /usr/local/var/svc.d/ostiary ]; then + printf "INFO: Enabling ostiary service (via daemontools)...\n" ln -s /usr/local/var/svc.d/ostiary /service/ostiary else printf "ERROR: /usr/local/var/svc.d/ostiary does not exist.\n" @@ -92,19 +137,22 @@ else printf "INFO: /service/ostiary already exists, not replacing...\n" fi +# bcfg2-client (daemontools) //if int(@BCFG2_CLIENT_RUN_INTERVAL_SECONDS) > 0 if [ ! -h /service/bcfg2-client ]; then if [ -d /usr/local/var/svc.d/bcfg2-client ]; then + printf "INFO: Enabling bcfg2-client service (via daemontools)...\n" ln -s /usr/local/var/svc.d/bcfg2-client /service/bcfg2-client else printf "ERROR: /usr/local/var/svc.d/bcfg2-client does not exist.\n" - exit 1 + printf "ERROR: Could not enable bcfg2-client service.\n" fi else printf "INFO: /service/bcfg2-client already exists, not replacing...\n" fi //end if +# end printf "Finished ${ENCAP_PKGNAME} postinstall script.\n" exit 0 diff --git a/encap/src/encap-profiles/Makefile b/encap/src/encap-profiles/Makefile index f2c4d04b9..664aea619 100644 --- a/encap/src/encap-profiles/Makefile +++ b/encap/src/encap-profiles/Makefile @@ -141,6 +141,14 @@ rename : encaps fi; \ done; \ fi + for OLDNAME in `ls ./*-doc-*-encap-*.tar.gz`; do \ + NEWNAME="`printf "%s\n" "$${OLDNAME}" \ + | awk -F- '{$$NF = "OSDIST.tar.gz" ; print}' \ + | sed s:\ :-:g | sed s:OSDIST:share:g`" ; \ + if [ "$${OLDNAME}x" != "$${NEWNAME}x" ]; then \ + mv ./$${OLDNAME} ./$${NEWNAME}; \ + fi; \ + done; clean : -(rm ./*.log; rm ./*.packaged; rm ./*.gz; rm ./*~) diff --git a/encap/src/encap-profiles/bcfg2-python-2.4.3.ep b/encap/src/encap-profiles/bcfg2-python-2.4.3.ep index 454aeced1..d94aba979 100644 --- a/encap/src/encap-profiles/bcfg2-python-2.4.3.ep +++ b/encap/src/encap-profiles/bcfg2-python-2.4.3.ep @@ -83,6 +83,18 @@ PLATFORM_ENDIF --disable-ipv6 </configure> +<build type="append"><![CDATA[ +# Make sure linking to openssl worked +${builddir}/python -c "from httplib import HTTPS" || HS="no"; \ +if [ "${HS}x" = "nox" ]; then \ + printf "ERROR: HTTPS fails (usually a problem with linking against "; \ + printf "openssl), aborting...\n"; \ + exit 1; \ +else \ + printf "INFO: HTTPS works\n"; \ +fi +]]></build> + </source> <prepackage><![CDATA[ diff --git a/encap/src/makeself-dist/makedist.sh b/encap/src/makeself-dist/makedist.sh index 72855dc4f..68aee6c99 100755 --- a/encap/src/makeself-dist/makedist.sh +++ b/encap/src/makeself-dist/makedist.sh @@ -234,6 +234,18 @@ chgrp 0 \${LOC_OST_CFG}* chmod 600 \${LOC_BCFG2_CONF}* chmod 600 \${LOC_OST_CFG}* +# Restart services if they exist to catch any config file changes +if [ -x /command/svc -a -x /command/svstat ]; then + for LOC_SERVICE in bcfg2-client bcfg2-server ostiary; do + if [ -h /service/\${LOC_SERVICE} ]; then + printf "Restarting daemontools service \${LOC_SERVICE}...\n" + /command/svc -t /service/\${LOC_SERVICE} + sleep 2 + /command/svstat /service/\${LOC_SERVICE} + fi + done +fi + exit 0 EOF @@ -241,7 +253,7 @@ EOF chmod 755 $DISTDIR/setup.sh # Create .run file from $DISTDIR with makeself -BLURB="Bcfg2 Client install for $SITENAME (version $SITEVER)" +BLURB="Bcfg2 Client install for $SITENAME (version $SITEVER) - export REPLACE_CONFIG=yes before running to force config file replacement" ${MAKESELF} --nox11 $DISTDIR ${DISTDIR}.run "$BLURB" ./setup.sh exit 0 |