/[gentoo-x86]/sci-chemistry/pdb2pqr/pdb2pqr-1.7.0-r2.ebuild
Gentoo

Contents of /sci-chemistry/pdb2pqr/pdb2pqr-1.7.0-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Oct 19 10:10:18 2012 UTC (2 years, 1 month ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +2 -2 lines
sci-chemistry/pdb2pqr: Remove virtual/fortran and always call fortran-2_pkg_setup as intend by the updated fortran-2.eclass

(Portage version: 2.2.0_alpha141/cvs/Linux x86_64, signed Manifest commit with key 70EB7916)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-chemistry/pdb2pqr/pdb2pqr-1.7.0-r2.ebuild,v 1.1 2012/05/11 07:42:54 jlec Exp $
4
5 EAPI=4
6
7 PYTHON_DEPEND="2:2.5"
8 SUPPORT_PYTHON_ABIS="1"
9 PYTHON_EXPORT_PHASE_FUNCTIONS="1"
10 RESTRICT_PYTHON_ABIS="2.4 3.* 2.7-pypy-*"
11
12 inherit autotools eutils fortran-2 flag-o-matic python toolchain-funcs versionator
13
14 MY_PV=$(get_version_component_range 1-2)
15 MY_P="${PN}-${MY_PV}"
16
17 DESCRIPTION="An automated pipeline for performing Poisson-Boltzmann electrostatics calculations"
18 LICENSE="BSD"
19 HOMEPAGE="http://pdb2pqr.sourceforge.net/"
20 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
21
22 SLOT="0"
23 IUSE="doc examples opal +pdb2pka"
24 KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
25
26 RDEPEND="
27 dev-python/numpy
28 sci-chemistry/openbabel
29 opal? ( dev-python/zsi )
30 pdb2pka? ( sci-chemistry/apbs[python,-mpi] )"
31 DEPEND="${RDEPEND}"
32
33 S="${WORKDIR}/${MY_P}"
34
35 pkg_setup() {
36 if [[ -z ${MAXATOMS} ]]; then
37 einfo "If you like to have support for more then 10000 atoms,"
38 einfo "export MAXATOMS=\"your value\""
39 else
40 einfo "Allow usage of ${MAXATOMS} during calculations"
41 fi
42 python_pkg_setup
43 fortran-2_pkg_setup
44 }
45
46 src_prepare() {
47 epatch \
48 "${FILESDIR}"/${PN}-1.4.0-ldflags.patch \
49 "${FILESDIR}"/${PN}-1.4.0-automagic.patch \
50 "${FILESDIR}"/${PV}-install.patch
51 sed \
52 -e '50,200s:CWD:DESTDIR:g' \
53 -i Makefile.am || die
54
55 python_src_prepare
56
57 preparation() {
58 sed \
59 -e "s:python\$PY_VERSION:$(PYTHON):g" \
60 -i configure.ac || die
61
62 eautoreconf
63 }
64 python_execute_function -s preparation
65
66 tc-export CC
67 }
68
69 src_configure() {
70 # we need to compile the *.so as pic
71 append-flags -fPIC
72 FFLAGS="${FFLAGS} -fPIC"
73
74 configuration() {
75 # Avoid automagic to numeric
76 econf \
77 --enable-propka \
78 --with-max-atoms=${MAXATOMS:-10000} \
79 $(use_enable pdb2pka) \
80 $(use_with opal) \
81 NUMPY="${EPREFIX}/$(python_get_sitedir)" \
82 F77="$(tc-getFC)"
83 }
84 python_execute_function -s configuration
85 }
86
87 src_compile() {
88 python_execute_function -d -s
89 }
90
91 src_test() {
92 testing() {
93 emake -j1 test
94 }
95 python_execute_function -s testing
96 }
97
98 src_install() {
99 installation() {
100 dodir $(python_get_sitedir)/${PN}
101 emake -j1 DESTDIR="${ED}$(python_get_sitedir)/${PN}" \
102 PREFIX="" install
103
104 INPATH="$(python_get_sitedir)/${PN}"
105
106 # generate pdb2pqr wrapper
107 cat >> "${T}"/${PN}-$(python_get_version) <<-EOF
108 #!/bin/sh
109 $(PYTHON) ${EPREFIX}${INPATH}/${PN}.py \$*
110 EOF
111
112 cat >> "${T}"/pdb2pka-$(python_get_version) <<-EOF
113 #!/bin/sh
114 $(PYTHON) ${EPREFIX}${INPATH}/pdb2pka/pka.py \$*
115 EOF
116
117 dobin "${T}"/{${PN},pdb2pka}-$(python_get_version)
118
119 insinto "${INPATH}" && doins __init__.py
120
121 exeinto "${INPATH}" && doexe ${PN}.py
122
123 insinto "${INPATH}"/dat && doins dat/*
124
125 exeinto "${INPATH}"/extensions && doexe extensions/*
126
127 insinto "${INPATH}"/src && doins src/*.py
128
129 exeinto "${INPATH}"/propka && doexe propka/_propkalib.so
130
131 insinto "${INPATH}"/propka && doins propka/propkalib.py propka/__init__.py
132
133 insinto "${INPATH}"/pdb2pka && doins pdb2pka/*.{py,so,DAT,h}
134
135 dosym ../../apbs/_apbs.so "${INPATH}"/pdb2pka/_apbslib.so
136 dosym ../../apbs/apbslib.py "${INPATH}"/pdb2pka/apbslib.py
137 dosym ../../apbs/apbslib.pyc "${INPATH}"/pdb2pka/apbslib.pyc
138 dosym ../../apbs/apbslib.pyo "${INPATH}"/pdb2pka/apbslib.pyo
139 }
140 python_execute_function -s installation
141
142 dosym ${PN}-$(python_get_version -f) /usr/bin/${PN}
143 dosym pdb2pka-$(python_get_version -f) /usr/bin/pdb2pka
144
145 if use doc; then
146 pushd doc > /dev/null
147 sh genpydoc.sh || die "genpydoc failed"
148 dohtml -r *.html images pydoc
149 popd > /dev/null
150 fi
151
152 use examples && \
153 insinto /usr/share/${PN}/ && \
154 doins -r examples
155
156 dodoc ChangeLog NEWS README AUTHORS
157 }
158
159 pkg_postinst() {
160 python_mod_optimize ${PN}
161 }
162
163 pkg_postrm() {
164 python_mod_cleanup ${PN}
165 }

  ViewVC Help
Powered by ViewVC 1.1.20