summaryrefslogtreecommitdiff
path: root/sci-biology/hmmer/hmmer-2.3.2-r5.ebuild
blob: b9f77b9dfce8766bac48b2fbbebd14733f1620a8 (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
73
74
75
76
77
78
79
80
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit toolchain-funcs

DESCRIPTION="Sequence analysis using profile hidden Markov models"
HOMEPAGE="http://hmmer.org/"
SRC_URI="http://eddylab.org/software/${PN}/${PV}/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="2"
KEYWORDS="~amd64 ~x86"
IUSE="cpu_flags_ppc_altivec test"
RESTRICT="!test? ( test )"

BDEPEND="test? ( dev-lang/perl )"

PATCHES=(
	"${FILESDIR}/${P}-fix-perl-shebangs.patch"
	"${FILESDIR}/${P}-fix-build-system-destdir.patch"
)

src_configure() {
	# prevent stray environmental variable
	# from causing issues in the test phase
	unset TMPDIR

	econf \
		--enable-lfs \
		--enable-threads \
		$(use_enable cpu_flags_ppc_altivec altivec)
}

src_compile() {
	emake AR="$(tc-getAR) rcs"
}

src_install() {
	default

	newlib.a src/libhmmer.a libhmmer2.a
	insinto /usr/include/hmmer2
	doins src/*.h

	dobin squid/{afetch,alistat,compalign,compstruct,revcomp,seqstat,seqsplit,sfetch,shuffle,sreformat,sindex,weight,translate}
	dolib.a squid/libsquid.a
	insinto /usr/include/hmmer2
	doins squid/*.h

	dodoc NOTES Userguide.pdf
	newdoc 00README README

	# rename files due to collisions with hmmer-3
	# in order to make SLOTing possible
	local i

	# first rename man pages...
	pushd "${ED}"/usr/share/man/man1/ >/dev/null || die
	for i in hmm*.1; do
		mv ${i%.1}{,2}.1 || die
	done
	popd >/dev/null || die

	# ... then rename binaries
	pushd "${ED}"/usr/bin/ >/dev/null || die
	for i in hmm*; do
		mv ${i}{,2} || die
	done
	popd >/dev/null || die
}

pkg_postinst() {
	elog "All ${P} binaries have been renamed, in order"
	elog "to avoid collisions with hmmer-3. For instance"
	elog
	elog "    hmmalign -> hmmalign2"
	elog
}