aboutsummaryrefslogtreecommitdiff
blob: 8f49f3d297d028811d3648a3b0a397d771e748f2 (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
66
67
68
69
70
71
72
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=2

PYTHON_DEPEND="2"
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="3.*"

inherit eutils fortran-2 python toolchain-funcs

MY_PN="SMMP"
MY_P="${MY_PN}-${PV}"

DESCRIPTION="Simple Molecular Mechanics for Proteins"
HOMEPAGE="http://smmp.berlios.de/"
SRC_URI="mirror://berlios/${PN}/${MY_P}.tar.bz2"

SLOT="0"
KEYWORDS="~amd64 ~x86"
LICENSE="GPL-2"
IUSE="doc mpi test"

RDEPEND="
	virtual/fortran
	mpi? ( virtual/mpi )"
DEPEND="${RDEPEND}
	doc? ( app-doc/doxygen )"

S="${WORKDIR}/${MY_P}"

src_prepare() {
	epatch "${FILESDIR}"/${PV}-flags.patch
}

src_compile() {
	if use mpi; then
		FC="mpif90"
		target="parallel"
	else
		target="${PN}"
	fi

	tc-export FC

	emake ${target} || die
}

src_test() {
	emake examples || die
	cd EXAMPLES
	bash smmp.cmd || die
}

src_install() {
	dobin ${PN} || die
	installation() {
		insinto $(python_get_sitedir)/${PN}
		doins *.py || die
	}
	python_execute_function installation
	dodoc README || die
}

pkg_postinst() {
	python_mod_optimize ${PN}
}

pkg_postrm() {
	python_mod_cleanup ${PN}
}