summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonnie Berkholz <dberkholz@gentoo.org>2006-06-20 15:12:34 +0000
committerDonnie Berkholz <dberkholz@gentoo.org>2006-06-20 15:12:34 +0000
commitc50ecf9927bc280bfe1a1e98dfe6025f11007b08 (patch)
tree67f33ebc7c44a52fb1a20087b7bf6bf8190001ec /sci-chemistry/webmo/webmo-6.1.010.ebuild
parentversion bump, #137314; remove buggy version (diff)
downloadhistorical-c50ecf9927bc280bfe1a1e98dfe6025f11007b08.tar.gz
historical-c50ecf9927bc280bfe1a1e98dfe6025f11007b08.tar.bz2
historical-c50ecf9927bc280bfe1a1e98dfe6025f11007b08.zip
Bump. Significant enhancements to reconfig script to handle webapp-config upgrades properly via etc-update.
Package-Manager: portage-2.1.1_pre1-r1
Diffstat (limited to 'sci-chemistry/webmo/webmo-6.1.010.ebuild')
-rw-r--r--sci-chemistry/webmo/webmo-6.1.010.ebuild118
1 files changed, 118 insertions, 0 deletions
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}
+}