summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonnie Berkholz <spyderous@gentoo.org>2006-06-20 15:12:34 +0000
committerDonnie Berkholz <spyderous@gentoo.org>2006-06-20 15:12:34 +0000
commitee3d8d7f2a17e3c322229b06ada03414f85b5e29 (patch)
tree15e76ab3b35fa37b45b1a62d2c5a99fa02400a6b /sci-chemistry
parentversion bump, #137314; remove buggy version (diff)
downloadgentoo-2-ee3d8d7f2a17e3c322229b06ada03414f85b5e29.tar.gz
gentoo-2-ee3d8d7f2a17e3c322229b06ada03414f85b5e29.tar.bz2
gentoo-2-ee3d8d7f2a17e3c322229b06ada03414f85b5e29.zip
Bump. Significant enhancements to reconfig script to handle webapp-config upgrades properly via etc-update.
(Portage version: 2.1.1_pre1-r1)
Diffstat (limited to 'sci-chemistry')
-rw-r--r--sci-chemistry/webmo/ChangeLog9
-rw-r--r--sci-chemistry/webmo/files/digest-webmo-6.1.0103
-rw-r--r--sci-chemistry/webmo/files/reconfig59
-rw-r--r--sci-chemistry/webmo/webmo-6.1.010.ebuild118
4 files changed, 176 insertions, 13 deletions
diff --git a/sci-chemistry/webmo/ChangeLog b/sci-chemistry/webmo/ChangeLog
index 06917940be73..d1677ada569f 100644
--- a/sci-chemistry/webmo/ChangeLog
+++ b/sci-chemistry/webmo/ChangeLog
@@ -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.
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
index 000000000000..8618d0f5c153
--- /dev/null
+++ b/sci-chemistry/webmo/files/digest-webmo-6.1.010
@@ -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
diff --git a/sci-chemistry/webmo/files/reconfig b/sci-chemistry/webmo/files/reconfig
index c8c769cddf17..a8e35a781de6 100644
--- a/sci-chemistry/webmo/files/reconfig
+++ b/sci-chemistry/webmo/files/reconfig
@@ -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
index 000000000000..5a0a141dd5f9
--- /dev/null
+++ b/sci-chemistry/webmo/webmo-6.1.010.ebuild
@@ -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}
+}