Bump. Significant enhancements to reconfig script to handle webapp-config upgrades...
authorDonnie Berkholz <dberkholz@gentoo.org>
Tue, 20 Jun 2006 15:12:34 +0000 (15:12 +0000)
committerDonnie Berkholz <dberkholz@gentoo.org>
Tue, 20 Jun 2006 15:12:34 +0000 (15:12 +0000)
Package-Manager: portage-2.1.1_pre1-r1

sci-chemistry/webmo/ChangeLog
sci-chemistry/webmo/Manifest
sci-chemistry/webmo/files/digest-webmo-6.1.010 [new file with mode: 0644]
sci-chemistry/webmo/files/reconfig
sci-chemistry/webmo/webmo-6.1.010.ebuild [new file with mode: 0644]

index 06917940be73faea494ebb7693a8c80cc276ab1c..d1677ada569fe9ac9ea1e756fd947345494aed46 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for sci-chemistry/webmo
 # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/webmo/ChangeLog,v 1.5 2006/02/23 23:17:34 spyderous Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/webmo/ChangeLog,v 1.6 2006/06/20 15:12:34 spyderous Exp $
+
+*webmo-6.1.010 (20 Jun 2006)
+
+  20 Jun 2006; Donnie Berkholz <spyderous@gentoo.org>; files/reconfig,
+  +webmo-6.1.010.ebuild:
+  Bump. Significant enhancements to reconfig script to handle webapp-config
+  upgrades properly via etc-update.
 
   23 Feb 2006; Donnie Berkholz <spyderous@gentoo.org>; webmo-6.0.003.ebuild:
   Remove redundant src_compile(), reported by ciaranm.
index fdcba48d2048253b0edc6f03921ca45232db51d2..5358ccce8bafcd1e29de8803899439e362c5bc2b 100644 (file)
@@ -1,24 +1,40 @@
-MD5 fda3ee50ee78d5ae69af8ef131e5a1d8 ChangeLog 1502
-RMD160 6e26ed2eb53957d4c4b94f8bb2d392e99543b772 ChangeLog 1502
-SHA256 bb99626a1f5b3b83501db2de10f5e2934f15a5986c23c2e852216f788bcf96d7 ChangeLog 1502
+AUX add-gamess-data-directory.patch 2112 RMD160 1cb6afe72d077b8e53c958276da054e581dffb80 SHA1 4b1d0fa9a2e38e1644969eed0d727fed6c03be2a SHA256 3f22a700679e762296593816a6ddac3fe048a069921dd890176b0a5863b0323d
 MD5 8e94349e3989b4b0219b8b5d8616ff4a files/add-gamess-data-directory.patch 2112
 RMD160 1cb6afe72d077b8e53c958276da054e581dffb80 files/add-gamess-data-directory.patch 2112
 SHA256 3f22a700679e762296593816a6ddac3fe048a069921dd890176b0a5863b0323d files/add-gamess-data-directory.patch 2112
-MD5 ea0135b660aec5e5627dd9929a937a41 files/digest-webmo-6.0.003 66
-RMD160 a8c739cf534847241cb224372e6c1b68fd61b314 files/digest-webmo-6.0.003 66
-SHA256 f81cf40d64be294e14c578e925ac4c1a47f8b8e41ce720a46cb673acd4ee310f files/digest-webmo-6.0.003 66
+AUX dont-be-interactive-or-diagnose.patch 806 RMD160 f583bd3515fdd6388a842aa0ef6afc798bfbdf7b SHA1 9bb7e090322010b66a0314da80283b70f8e1af24 SHA256 0564216929993ff7180486da3b9166a829eb111a90d83b46f1a70099f67c2774
 MD5 6a9f136cdce79131896e4815b19cdeab files/dont-be-interactive-or-diagnose.patch 806
 RMD160 f583bd3515fdd6388a842aa0ef6afc798bfbdf7b files/dont-be-interactive-or-diagnose.patch 806
 SHA256 0564216929993ff7180486da3b9166a829eb111a90d83b46f1a70099f67c2774 files/dont-be-interactive-or-diagnose.patch 806
+AUX gentoo-locations.patch 1939 RMD160 c9f38a643ac722a05cd4287b1124f192b8524c35 SHA1 316655a00f562b8104482da71454b1a9a60f42ab SHA256 cc4604c3f520a4b6914f3f44a4971a761c3e96a1ae0c8941d6f956ab97aaba01
 MD5 c3f7daf2719dca6df3f68a7193213e63 files/gentoo-locations.patch 1939
 RMD160 c9f38a643ac722a05cd4287b1124f192b8524c35 files/gentoo-locations.patch 1939
 SHA256 cc4604c3f520a4b6914f3f44a4971a761c3e96a1ae0c8941d6f956ab97aaba01 files/gentoo-locations.patch 1939
-MD5 ad796a7a1a4d239fc2b1ca49ee328e6a files/reconfig 864
-RMD160 3ee64fea8ed341e49e8779eceb3c9fd5401eccb2 files/reconfig 864
-SHA256 a946ef7780881e287dcd37d13842b012334594b35a22a3de1929a9b1191b1d2a files/reconfig 864
-MD5 af1bfbb0777267a03e889b08173f2757 metadata.xml 248
-RMD160 6488d9f1ef3e05e6ac5a29ddcc818e5ead0a5230 metadata.xml 248
-SHA256 de0ad7dc383b462c407cae015684d27c090455eac87c6f0f9ff581ef6e0b5b27 metadata.xml 248
+AUX reconfig 1957 RMD160 68c3eac15df2acebdeeb9dd82938e5a3d5bc1aa9 SHA1 370883684b76277b409739819b22c3056fcf4130 SHA256 86faf48c67355367ca6d68a1b1e992602b760857b50ced0f2be78a9da9395ba5
+MD5 17c5529a4765b4a96aab284f55752cc0 files/reconfig 1957
+RMD160 68c3eac15df2acebdeeb9dd82938e5a3d5bc1aa9 files/reconfig 1957
+SHA256 86faf48c67355367ca6d68a1b1e992602b760857b50ced0f2be78a9da9395ba5 files/reconfig 1957
+DIST WebMO.6.0.003.tar.gz 1197672
+DIST WebMO.6.1.010.tar.gz 1221074 RMD160 2ed4385229b3c094891cc31131ca0f313eba59e5 SHA1 63440398ddb3daf591fa260a30204519889a7ab0 SHA256 99f53a346b32ee7b9ec9c0c7a4368b5c3e744e8dd960e57a776867558e35ec7b
+EBUILD webmo-6.0.003.ebuild 3173 RMD160 a0e0d99ac4b105a1d9e03f9d938cbc917933a641 SHA1 545e9fcae49d60d636700c54f5f6b3163d251fbb SHA256 615dd51d91be36df3ab7f938502366d75ff90ce93d736b02c0689eb5fe36da51
 MD5 f3e81f5102cb2c010c72beeb22449a44 webmo-6.0.003.ebuild 3173
 RMD160 a0e0d99ac4b105a1d9e03f9d938cbc917933a641 webmo-6.0.003.ebuild 3173
 SHA256 615dd51d91be36df3ab7f938502366d75ff90ce93d736b02c0689eb5fe36da51 webmo-6.0.003.ebuild 3173
+EBUILD webmo-6.1.010.ebuild 3325 RMD160 24e181e0e61743dee6191813e180ac51048e51e1 SHA1 c3d0453b61d8ff6ac272ade22b869c9f0b464225 SHA256 2ab15ea885184b104e77086b81b8503c0c49f0e8c4da233e376c9750b7d47d33
+MD5 96c00e450d4ea26711f9c71a8d0324ff webmo-6.1.010.ebuild 3325
+RMD160 24e181e0e61743dee6191813e180ac51048e51e1 webmo-6.1.010.ebuild 3325
+SHA256 2ab15ea885184b104e77086b81b8503c0c49f0e8c4da233e376c9750b7d47d33 webmo-6.1.010.ebuild 3325
+MISC ChangeLog 1741 RMD160 76269b317e5a626bb0ede7811a01090e9bc357dc SHA1 d9474b2e45410ed76aa033d3fc4dc78aef68e3a7 SHA256 68a51bfba40302fc63292ee3092db620094cb064f25f8664a743e74e051f42b5
+MD5 c559377ad0398745f056b89d5200f096 ChangeLog 1741
+RMD160 76269b317e5a626bb0ede7811a01090e9bc357dc ChangeLog 1741
+SHA256 68a51bfba40302fc63292ee3092db620094cb064f25f8664a743e74e051f42b5 ChangeLog 1741
+MISC metadata.xml 248 RMD160 6488d9f1ef3e05e6ac5a29ddcc818e5ead0a5230 SHA1 75a648fddef9922cdfe21fb0298a1c746190fd82 SHA256 de0ad7dc383b462c407cae015684d27c090455eac87c6f0f9ff581ef6e0b5b27
+MD5 af1bfbb0777267a03e889b08173f2757 metadata.xml 248
+RMD160 6488d9f1ef3e05e6ac5a29ddcc818e5ead0a5230 metadata.xml 248
+SHA256 de0ad7dc383b462c407cae015684d27c090455eac87c6f0f9ff581ef6e0b5b27 metadata.xml 248
+MD5 ea0135b660aec5e5627dd9929a937a41 files/digest-webmo-6.0.003 66
+RMD160 a8c739cf534847241cb224372e6c1b68fd61b314 files/digest-webmo-6.0.003 66
+SHA256 f81cf40d64be294e14c578e925ac4c1a47f8b8e41ce720a46cb673acd4ee310f files/digest-webmo-6.0.003 66
+MD5 f5f9e87168b357da498cf69c14379595 files/digest-webmo-6.1.010 244
+RMD160 e20bf9b04c01ddd272aedd988598a8af065399cd files/digest-webmo-6.1.010 244
+SHA256 e53b2180f0ed15f57bafeb8bb148a8930231ad050db51610746f81a9d58fa486 files/digest-webmo-6.1.010 244
diff --git a/sci-chemistry/webmo/files/digest-webmo-6.1.010 b/sci-chemistry/webmo/files/digest-webmo-6.1.010
new file mode 100644 (file)
index 0000000..8618d0f
--- /dev/null
@@ -0,0 +1,3 @@
+MD5 60ac456a9a38c1aa3acce579c3964433 WebMO.6.1.010.tar.gz 1221074
+RMD160 2ed4385229b3c094891cc31131ca0f313eba59e5 WebMO.6.1.010.tar.gz 1221074
+SHA256 99f53a346b32ee7b9ec9c0c7a4368b5c3e744e8dd960e57a776867558e35ec7b WebMO.6.1.010.tar.gz 1221074
index c8c769cddf178adcfcae49c86e1c3194b8f9111b..a8e35a781de626919592be281f6dcba6724c2332 100644 (file)
@@ -1,25 +1,60 @@
 #!/bin/bash
 
+declare -i cfgnum
+
 if [ $1 = "install" ]; then
-       FILE="${MY_CGIBINDIR}/webmo/interfaces/globals.int"
+       FILE="${VHOST_CGIBINDIR}/webmo/interfaces/._cfg*_globals.int"
 
        sed -i \
-               -e "s:htmlBase.*:htmlBase=\"${MY_HTDOCSDIR}\":g" \
-               -e "s:cgiBase.*:cgiBase=\"${MY_CGIBINDIR}/webmo\" :g" \
-               -e "s:userBase.*:userBase=\"${MY_HOSTROOTDIR}/webmo\":g" \
+               -e "s:^htmlBase.*:htmlBase=\"${VHOST_HTDOCSDIR}/webmo\":g" \
+               -e "s:^cgiBase.*:cgiBase=\"${VHOST_CGIBINDIR}/webmo\" :g" \
+               -e "s:userBase.*:userBase=\"${VHOST_ROOT}/webmo\":g" \
                ${FILE}
 
+       pushd ${VHOST_CGIBINDIR}/webmo/interfaces > /dev/null
+
        # If a program is enabled, install .int.disabled changes to .int
-       pushd ${MY_CGIBINDIR}/webmo/interfaces
-       for file in ._cfg*; do
+       for file in *.disabled; do
+               enabled_file=${file%.disabled}
+               echo -n "Checking for enabled interface '${enabled_file}' ... "
+               if [[ -e ${enabled_file} ]]; then
+                       echo "yes"
+                       for (( cfgnum=10#0000; cfgnum < 10#9999; cfgnum++ )); do
+                               # A number can't be padded with zero's, but a string can
+                               cfgstr=$(printf "%.4d" ${cfgnum})
+                               enabled_cfgfile=._cfg${cfgstr}_${enabled_file}
+                               if [[ ! -e ${enabled_cfgfile} ]]; then
+                                       mv ${file} ${enabled_cfgfile}
+                                       break
+                               fi
+                       done
+               else
+                       echo "no"
+               fi
+       done
+
+       # Handle ._cfg* files properly, whether interfaces are enabled or not
+       for file in ._cfg*disabled; do
                realfile=${file#._cfg*_}
                enabled_file=${realfile%.disabled}
+               # If interface is enabled, then rename the config file
+               # But be considerate of other unmerged config files
                if [[ -e ${enabled_file} ]]; then
-                       enabled_cfgfile=${file%.disabled}
-                       mv ${file} ${enabled_cfgfile}
+                       cfgnum=${file%.disabled}
+                       cfgnum=${cfgnum#._cfg}
+                       cfgnum=10#${cfgnum%%_*}
+                       for (( ; cfgnum < 10#9999; cfgnum++ )); do
+                               # A number can't be padded with zero's, but a string can
+                               cfgstr=$(printf "%.4d" ${cfgnum})
+                               enabled_cfgfile=._cfg${cfgstr}_${enabled_file}
+                               if [[ ! -e ${enabled_cfgfile} ]]; then
+                                       mv ${file} ${enabled_cfgfile}
+                                       break
+                               fi
+                       done
                fi
        done
-       popd
+       popd > /dev/null
 else
        echo "done."
 fi
@@ -28,7 +63,7 @@ if [ $1 = "clean" ]; then
        echo "Please examine the contents of the following directories"
        echo "and delete anything that is no longer necessary"
        echo
-       echo ${MY_HTDOCSDIR}
-       echo ${MY_CGIBINDIR}/webmo
-       echo ${MY_HOSTROOTDIR}/webmo
+       echo ${VHOST_HTDOCSDIR}
+       echo ${VHOST_CGIBINDIR}/webmo
+       echo ${VHOST_ROOT}/webmo
 fi
diff --git a/sci-chemistry/webmo/webmo-6.1.010.ebuild b/sci-chemistry/webmo/webmo-6.1.010.ebuild
new file mode 100644 (file)
index 0000000..5a0a141
--- /dev/null
@@ -0,0 +1,118 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/webmo/webmo-6.1.010.ebuild,v 1.1 2006/06/20 15:12:34 spyderous Exp $
+
+inherit eutils webapp
+
+MY_SRC_PN="WebMO"
+MY_SRC_P="${MY_SRC_PN}.${PV}"
+DESCRIPTION="Web-based interface to computational chemistry packages"
+HOMEPAGE="http://webmo.net/"
+SRC_URI="${MY_SRC_P}.tar.gz"
+LICENSE="WebMO"
+SLOT="${PVR}"
+KEYWORDS="~x86"
+RESTRICT="fetch"
+IUSE=""
+RDEPEND="dev-lang/perl
+       net-www/apache"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_SRC_PN}.install"
+
+pkg_nofetch() {
+       einfo "Go to http://webmo.net/ and register for a free license."
+       einfo "Download ${SRC_URI} and place it in ${DISTDIR}."
+}
+
+src_unpack() {
+       # We need a license number to proceed
+       if [[ -z ${WEBMO_LICENSE} ]]; then
+               msg="You must set WEBMO_LICENSE to your license number in make.conf."
+               ewarn "$msg"
+               die "$msg"
+       fi
+
+       # Check for invalid license values. Valid are dddd-dddd-dddd
+       if [[ ${WEBMO_LICENSE} != [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] ]]; then
+               msg="Invalid license format. Licenses should be DDDD-DDDD-DDDD (D is a digit)."
+               ewarn "$msg"
+               die "$msg"
+       fi
+
+       unpack ${A}
+
+       # Set up program locations to match where portage installs them
+       epatch ${FILESDIR}/gentoo-locations.patch
+
+       # Add a data directory for gamess, because WebMO expects everything
+       # in one directory instead of FHS
+       # (Depends on gentoo-locations.patch)
+       epatch ${FILESDIR}/add-gamess-data-directory.patch
+
+       # Don't run diagnose.pl or ask about being root user
+       epatch ${FILESDIR}/dont-be-interactive-or-diagnose.patch
+
+       # Make setup.conf
+       create_setup_conf
+}
+
+src_install() {
+       webapp_src_preinst
+
+       # Install everything
+       perl setup.pl || die "Check ${S}/diagnose.html for errors"
+
+       # Get ${D} out of main config file
+       dosed "${MY_CGIBINDIR}/webmo/interfaces/globals.int"
+
+       webapp_hook_script ${FILESDIR}/reconfig
+
+       local files=$(find ${D}${MY_HOSTROOTDIR}/webmo ${D}${MY_CGIBINDIR}/webmo/interfaces)
+       # Add the directories themselves
+       files="${files} ${MY_HOSTROOTDIR}/webmo ${MY_CGIBINDIR}/webmo/interfaces"
+       files=${files//${D}/}
+       for file in ${files}; do
+               webapp_configfile "${file}"
+               webapp_serverowned "${file}"
+       done
+
+       ebegin "Fixing permissions"
+       pushd "${D}" > /dev/null
+       find . -perm /o+w -type f | xargs fperms 664
+       find . -perm /o+w -type d | xargs fperms 775
+       popd > /dev/null
+       eend 0
+
+       webapp_src_install
+}
+
+pkg_postinst() {
+       einfo
+       einfo "Be sure that this line is uncommented in httpd.conf:"
+       einfo "AddHandle cgi-scripts .cgi"
+       einfo
+       einfo "The diagnose.pl script can be run if WebMO doesn't work properly."
+       einfo
+
+       webapp_pkg_postinst
+}
+
+create_setup_conf() {
+       local SETUP_CONF="${S}/setup.conf"
+
+       echo_setup perlPath /usr/bin/perl "${SETUP_CONF}"
+       echo_setup htmlBase "${D}${MY_HTDOCSDIR}" "${SETUP_CONF}"
+       echo_setup url_htmlBase /webmo "${SETUP_CONF}"
+       echo_setup cgiBase "${D}${MY_CGIBINDIR}/webmo" "${SETUP_CONF}"
+       echo_setup url_cgiBase /cgi-bin/webmo "${SETUP_CONF}"
+       echo_setup userBase "${D}${MY_HOSTROOTDIR}/webmo" "${SETUP_CONF}"
+       echo_setup license "${WEBMO_LICENSE}" "${SETUP_CONF}"
+}
+
+# Takes three arguments:
+# 1: variable, 2: value, 3: file to echo them to
+echo_setup() {
+       # All values must be double-quoted, so escape the inner quotes.
+       echo "${1}=\"${2}\"" >> ${3}
+}