# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils S=${WORKDIR}/${PV} DESCRIPTION="The CLHEP project is intended to be a set of HEP-specific foundation and utility classes such as random generators, physics vectors, geometry and linear algebra" SRC_URI="http://wwwasd.web.cern.ch/wwwasd/lhc++/clhep/DISTRIBUTION/distributions/${P}.tgz" HOMEPAGE="http://proj-clhep.web.cern.ch/proj-clhep/index.html" SLOT="0" LICENSE="as-is, GPL-2, BSD, ... NIGHTMARE!" KEYWORDS="~x86" IUSE="doc icc" DEPEND="sys-devel/libtool >=sys-devel/autoconf-2.59 >=sys-devel/automake-1.9 >=dev-lang/perl-5.8.0 doc? ( >=app-doc/doxygen-1.4.2 ) icc? ( dev-lang/icc )" src_unpack(){ unpack ${A} # This is neccesary if both gcc and icc are installed in the system # but the icc flag is not turned on if ! use icc; then for x in $(find ${S}/CLHEP -type f '(' -name configure ')' | sed 's/configure//'); do cd ${x} epatch ${FILESDIR}/gcc-configure.patch done fi } src_compile() { cd ${S}/CLHEP if use icc; then unset CFLAGS unset LDFLAGS # This is neccesary because if we don't change the flags # everything is compiled with debug support CXXFLAGS="-ansi -mp -no-gcc -w1 -O2" export CXXFLAGS fi ./configure \ --prefix=/usr \ --bindir=/usr/bin/CLHEP \ --libdir=/usr/lib/CLHEP \ --datadir=/usr/share/CLHEP \ --enable-exceptions \ --disable-dependency-tracking || die "Configure failed" emake || die "Build failed" if use doc; then emake docs OPT="$CFLAGS" || die "make docs failed" cp ${FILESDIR}/Doxyfile . doxygen || Die "Doxygen failed" fi # make tests make check || die "Make tests failed" } src_install() { cd ${S}/CLHEP make DESTDIR=${D} INSTALL="install" install || die "install failed" if use doc; then make DESTDIR=${D} INSTALL="install" install-docs || die "install docs failed" mkdir -p ${D}/usr/share/doc/clhep-${PV} mv docs/html ${D}/usr/share/doc/clhep-${PV}/. mv ${D}/usr/doc/* ${D}/usr/share/doc/clhep-${PV}/. rmdir ${D}/usr/doc || die "failed to remove bad doc dir" fi dodoc INSTALL README echo 'ROOTPATH=/usr/bin/CLHEP' > 99clhep echo 'PATH=/usr/bin/CLHEP' >> 99clhep echo 'LDPATH=/usr/lib/CLHEP' >> 99clhep doenvd 99clhep mkdir -p ${D}/usr/share/CLHEP mv ${D}/usr/examples ${D}/usr/share/CLHEP/. mv ${D}/usr/data ${D}/usr/share/CLHEP/. }