# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils autotools DESCRIPTION="The Globus Toolkit - grid middleware package" HOMEPAGE="http://www.globus.org/toolkit/" SRC_URI="http://www.globus.org/ftppub/${PN}${PV:0:1}/${PV:0:3}/${PV}/installers/src/${PN}${PV}-all-source-installer.tar.bz2 http://www.globus.org/ftppub/${PN}${PV:0:1}/${PV:0:3}/${PV}/updates/src/globus_js-0.5.tar.gz http://www.globus.org/ftppub/${PN}${PV:0:1}/${PV:0:3}/${PV}/updates/src/globus_xio-0.35.tar.gz http://www.globus.org/ftppub/${PN}${PV:0:1}/${PV:0:3}/${PV}/updates/src/globus_gram_protocol-6.5.tar.gz http://www.globus.org/ftppub/${PN}${PV:0:1}/${PV:0:3}/${PV}/updates/src/globus_fork_starter-0.3.tar.gz" LICENSE="as-is" SLOT="0" KEYWORDS="~x86" # FIXME: Full depends? DEPEND=" >=dev-java/sun-jdk-1.5.0.08 dev-java/ant sys-libs/zlib sys-apps/sed dev-lang/perl app-admin/sudo dev-db/postgresql dev-db/libiodbc" RDEPEND="${DEPEND}" # Completely untested USE flags... :) #IUSE="wsc wsjava wsgram prewsmds condor i18n drs rls gridftp \ #rendezvous webmds myproxy gt-tests gt-wstests gsiopenssh wsc wscas wsrft \ #wsdel wsmds wsjava prewsgram" IUSE="lsf pbs" S="${WORKDIR}/${PN}${PV}-all-source-installer" GLOBUS="/opt/globus-4.0.3" pkg_setup() { enewgroup globus enewuser globus -1 -1 /home/globus globus } function gt_advisory() { # Usage: gt_advisory globus_xio-0.35.tar.gz ${S}/source-trees/xio/src einfo "Unpacking: ${1} into source-trees/${2}..." tar xfz "${DISTDIR}/${1}" --strip-components=1 -C "${S}/source-trees/${2}" } src_unpack() { unpack gt${PV}-all-source-installer.tar.bz2 cd "${S}" # TODO: Report this bug on bugzilla.globus.org einfo "Patch wsrf parser generator template (will lead to bad C++ down the road)" epatch "${FILESDIR}/wsrfparsertemplate.patch" # Globus Toolkit advisories / "patches"... # Snagged from: http://www.globus.org/toolkit/advisories.html gt_advisory "globus_xio-0.35.tar.gz" \ "xio/src" # gt4726 gt_advisory "globus_js-0.5.tar.gz" \ "wsrf/c/tools/js/source" # gt4315 gt_advisory "globus_gram_protocol-6.5.tar.gz" \ "gram/protocol/source" # gt4620 gt_advisory "globus_fork_starter-0.3.tar.gz" \ "ws-gram/job_management/fork/c/source" # gt4706 cd "${S}" sed -i \ -e "s|\(GLOBUS_LOCATION=\)\(@prefix@\)|\1${D}\2|" \ -e "s|\(GPT_LOCATION=\)\(@gptlocation@\)|\1${D}\2|" \ -e "s|\(GLOBUS_IODBC_PATH=\)\(@globus_iodbc@\)|\1${D}\2|" \ Makefile.in # Add -I/usr/include/iodbc to RLS Makefile einfo "Fixing RLS so it can find sql.h etc..." sed -i -re 's?(DEFAULT_INCLUDES = -I. -I\$\(srcdir\))?\1 -I/usr/include/iodbc?' source-trees/replica/rls/server/Makefile.in } src_compile() { cd ${WORKDIR}/gt${PV}-all-source-installer # NOTE: --with-iodbc doesn't seem to actually do anything ./configure \ --prefix=${GLOBUS} --disable-prewsgram \ $(use_enable lsf wsgram-lsf) \ $(use_enable pbs wsgram-pbs) \ --with-iodbc=/usr/include/iodbc \ || die "configure failed" } src_install() { local envfile # Yep, compile during the install phase. Fix it if you can :) make -j1 gridftp wsjava wsc wsmds wsdel wsrft wsgram wscas rls install \ || die "make -j1 install failed!" envfile="${D}etc/env.d/21gt" einfo "Making ${envfile}..." mkdir -p "${D}etc/env.d" echo "GLOBUS_LOCATION=${GLOBUS}" > "${envfile}" echo "PATH=${GLOBUS}/sbin:${GLOBUS}/bin" >> "${envfile}" echo "LD_LIBRARY_PATH=${GLOBUS}/lib" >> "${envfile}" echo "DYLD_LIBRARY_PATH=${GLOBUS}/lib" >> "${envfile}" echo "MANPATH=${GLOBUS}/man" >> "${envfile}" echo "SHLIB_PATH=${GLOBUS}/lib" >> "${envfile}" echo "LIBPATH=${GLOBUS}/lib" >> "${envfile}" # SASL_PATH / LD_LIBRARYN32_PATH / LD_LIBRARY64_PATH ? # Frightening textfile path fixup hack up ahead... einfo "grep/sed hacking installed paths (D)=${D} (S)=${S}" grep -IR "${D}" ${D} \ --exclude='config.status' --exclude='config.log' -H \ | sed -e 's/:.*//' \ | sort \ | uniq \ | xargs sed -i -e "s|${D}|/|g" -- # Single path fixup (obsolete?) sed -i -e \ "s| -L${S}/source-trees/gsi/callback/source/library/oldgaa||" \ "${D}usr/globus/lib/libglobus_gsi_callback_gcc32dbg.la" insinto ${GLOBUS}/share/extras doins ${S}/quickstart.html bzip2 -9 ${S}/contrib/*.txt bzip2 -9 ${S}/contrib/*.pl doins ${S}/contrib/* chown -R globus:globus ${IMAGE} chmod o-wrx ${IMAGE}${GLOBUS}/var/globus-fork.log } pkg_postinst() { einfo "Now env-update and..." einfo "... follow various steps of the Globus Toolkit quickstart Tutorial:" einfo " http://www.globusconsortium.org/tutorial/ch6/page_4.php" echo einfo "You'll need a CA, host and user certs, a gridmap file, a postgres" einfo "database... etc." echo einfo "Also consult Google for further help" echo einfo "Good luck!" # http://bugzilla.globus.org/globus/show_bug.cgi?id=4159 }