summaryrefslogtreecommitdiff
blob: 26c33b92cec116f9824c0c8394f9422dd2069c58 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/caver/caver-0.99.4.ebuild,v 1.2 2007/03/15 15:51:57 kugelfang Exp $

inherit multilib python eutils

MY_PN="${PN}_unix"
MY_P="${MY_PN}_v${PV}"
PLUG_P="${MY_P/caver/caverPLUG}"

DESCRIPTION="Rapid, accurate and fully automated calculation of pathways leading from buried cavities to outside solvent in static and dynamic protein structures"
HOMEPAGE="http://viper.chemi.muni.cz/caver/"
SRC_URI="${MY_P}.tar.gz
	pymol? ( ${PLUG_P}.tar.gz )"
LICENSE="CAVER"

SLOT="0"
KEYWORDS="~ppc ~x86"
IUSE="pymol"

RDEPEND="media-libs/qhull
	pymol? ( sci-chemistry/pymol )"
DEPEND="${RDEPEND}"

RESTRICT="fetch"

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

pkg_nofetch() {
	einfo "Download ${MY_P}.tar.gz"
	if use pymol; then
		einfo "and ${PLUG_P}.tar.gz"
	fi
	einfo "from ${HOMEPAGE}. This requires registration."
	einfo "Place tarballs in ${DISTDIR}."
}

src_unpack() {
	unpack ${A}
	epatch "${FILESDIR}"/${P}-001.patch
}

src_install() {
	make DESTDIR="${D}" install
	doman man/man1/* || die "Failed to install man page."
	if use pymol; then
		python_version
		sed -e "s:^\(CAVER_BINARY_LOCATION\).*:\1 = \"usr/bin/caver\":g" \
				-i "${WORKDIR}"/${PLUG_P}/caver.py \
				|| die "Failed setting caver location"
		insinto /usr/$(get_libdir)/python${PYVER}/site-packages/pmg_tk/startup
		doins "${WORKDIR}"/${PLUG_P}/caver.py || die "Failed to install plugin"
	fi
	cd "${S}"/pdb2caver
	dobin pdb2caver || die "Failed to install pdb2caver"
	newdoc README README_pdb2caver || die "Failed to install pdb2caver readme."
}

pkg_postinst() {
	if use pymol; then
		python_mod_compile \
		/usr/$(get_libdir)/python${PYVER}/site-packages/pmg_tk/startup/caver.py
	fi
}