aboutsummaryrefslogtreecommitdiff
blob: dd9cdecc06c06e7bd606f7831364c34db81ae098 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright 2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/camp/CVSROOT/CamposEbuilds/portage/sci-physics/campos-asap/campos-asap-2.14.ebuild,v 1.2 2006/02/15 10:27:52 schiotz Exp $

inherit eutils toolchain-funcs python multilib

MY_P=Asap-${PV}
DESCRIPTION="ASAP is a calculator for campos-ase, implementing the Effective Medium Potential"
HOMEPAGE="http://wiki.fysik.dtu.dk/Asap"
SRC_URI="http://dcwww.camp.dtu.dk/campos/download/${MY_P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE="doc mpi"
RDEPEND=">=sci-physics/campos-ase-2.1.1"
DEPEND="${RDEPEND}
	>=dev-lang/swig-1.3.21
	doc? ( >=app-doc/doxygen-1.4.4
		dev-libs/libxslt
		dev-python/epydoc )
	mpi? ( virtual/mpi )"
S=${WORKDIR}/${MY_P}

src_compile() {
	if [[ $(tc-getCXX) = icc ]]; then
		MYMF="USE_INTEL_COMPILER_ON_LINUX=1"
	else
		MYMF="USE_INTEL_COMPILER_ON_LINUX=0"
	fi

	python_version

	emake -j1 ${MYMF} depend || die "emake depend failed"
	if use doc; then
		emake -j1 ${MYMF} docs || die "emake docs failed"
	fi
	if use mpi; then
		emake ${MYMF} parallel || die "emake serial failed"
	else
		emake ${MYMF} serial || die "emake serial failed"
	fi
	if use doc; then
		# Pythonpath set to work around bug in epydoc
		export PYTHONPATH=/usr/$(get_libdir)/python${PYVER}/site-packages/Scientific/linux2
		export PYTHONPATH=`pwd`/Swig/`arch`:${PYTHONPATH}
		epydoc --output epydoc --inheritance included --name Asap --url ${HOMEPAGE} Python/Asap
	fi
}

src_install() {
	if use mpi; then
		emake ${MYMF} DESTDIR="${D}" install-parallel || die "emake install failed"
	else
		emake ${MYMF} DESTDIR="${D}" install || die "emake install failed"
	fi
	use doc && dohtml -r epydoc/*
}

pkg_postinst() {
	python_mod_optimize ${ROOT}usr/$(get_libdir)/python*/site-packages/Asap
}

pkg_postrm() {
	python_mod_cleanup ${ROOT}usr/$(get_libdir)/python*/site-packages/Asap
}