# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" inherit versionator multilib toolchain-funcs eutils MV=$(get_major_version) DESCRIPTION="Virtual Monte Carlo" HOMEPAGE="http://root.cern.ch/root/vmc/VirtualMC.html" SRC_URI="ftp://root.cern.ch/root/vmc/geant4_vmc.${PV}.tar.gz" LICENSE="public domain" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="doc examples vgm" DEPEND="sci-physics/root sci-physics/clhep sci-physics/geant:4[examples?] vgm? ( sci-physics/vgm ) doc? ( app-doc/doxygen )" RDEPEND="${DEPEND}" S="${WORKDIR}/geant4_vmc" pkg_setup() { use vgm && [ -z USE_VGM ] && \ die "USE_VGM is not set, check your environment anf sci-physics/vgm installation." if [ -z ${G4SYSTEM} ]; then elog "Your Geant-4 environment is not set." has_version ">=sci-physics/geant-4.9.4" && \ elog "Yo use Geant4 version 4.9.4 or newer." && \ elog "Use script /usr/share/geant4/config/geant-*.{sh|csh} to setup" && \ elog "your backward compability environment in following way:" && \ elog " source /usr/share/geant4/config/geant-xxxx.sh" && \ elog "where xxxx is your geant version." die "Installation broken" fi } src_compile() { cd "${S}/g4root" emake || die "emake failed" cd "${S}/source" emake || die "emake failed" use doc && doxygen } src_install() { cd ${S} PLATFORM=$(root-config --arch) insinto /usr/$(get_libdir)/ doins lib/tgt_${PLATFORM}/{libg4root,libgeant4vmc}.so insinto /usr/include/ doins -r include/* insinto /usr/share/doc/${PF} dodoc README LICENSE if use doc; then doins Geant4VMC.html doins -r doc/* fi use examples && doins -r examples }