1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # Author Olivier Fisette <ribosome@gentoo.org>
7 # This eclass is used to install EMBASSY programs (EMBOSS add-ons).
9 # The inheriting ebuild should provide a "DESCRIPTION", "KEYWORDS" and, if
10 # necessary, add "(R|P)DEPEND"encies. Additionnaly, the inheriting ebuild's
11 # name must begin by "embassy-". Also, before inheriting, the ebuild should
12 # specify what version of EMBOSS is required by setting EBOV.
14 inherit eutils multilib
16 # The EMBASSY package name, retrieved from the inheriting ebuild's name
18 # The full name and version of the EMBASSY package (excluding the Gentoo
20 EF="$(echo ${EN} | tr "[:lower:]" "[:upper:]")-${PV}"
22 HOMEPAGE="http://emboss.sourceforge.net/"
23 LICENSE="LGPL-2 GPL-2"
24 SRC_URI="ftp://emboss.open-bio.org/pub/EMBOSS/EMBOSS-${EBOV}.tar.gz
25 ftp://emboss.open-bio.org/pub/EMBOSS/${EF}.tar.gz"
30 DEPEND="=sci-biology/emboss-${EBOV}*
31 !<sci-biology/emboss-${EBOV}
32 X? ( x11-libs/libX11 )
38 S=${WORKDIR}/EMBOSS-${EBOV}/embassy/${EF}
40 embassy_src_unpack() {
42 mkdir EMBOSS-${EBOV}/embassy
43 mv ${EF} EMBOSS-${EBOV}/embassy/
44 cp /usr/$(get_libdir)/libplplot.la EMBOSS-${EBOV}/plplot/
45 cp /usr/$(get_libdir)/libeplplot.la EMBOSS-${EBOV}/plplot/
46 cp /usr/$(get_libdir)/libajax.la EMBOSS-${EBOV}/ajax/
47 cp /usr/$(get_libdir)/libajaxg.la EMBOSS-${EBOV}/ajax/
48 cp /usr/$(get_libdir)/libnucleus.la EMBOSS-${EBOV}/nucleus/
49 if [ -e "${FILESDIR}"/${PF}.patch ]; then
51 epatch "${FILESDIR}"/${PF}.patch
55 embassy_src_compile() {
56 local PREFIX="${ROOT}/usr"
58 ! use X && EXTRA_CONF="${EXTRA_CONF} --without-x"
59 ! use png && EXTRA_CONF="${EXTRA_CONF} --without-pngdriver"
61 "--bindir=${PREFIX}/bin" \
62 "--sbindir=${PREFIX}/sbin" \
63 "--libexecdir=${PREFIX}/libexec" \
64 "--sysconfdir=${ROOT}/etc" \
65 "--sharedstatedir=${ROOT}/var" \
66 "--localstatedir=${ROOT}/var" \
67 "--libdir=${PREFIX}/$(get_libdir)" \
68 "--includedir=${PREFIX}/include" \
69 "--datarootdir=${PREFIX}/share" \
70 "--datadir=${PREFIX}/share" \
71 "--infodir=${PREFIX}/share/info" \
72 "--localedir=${PREFIX}/share/locale" \
73 "--mandir=${PREFIX}/share/man" \
75 emake || die "Before reporting this error as a bug, please make sure you compiled
76 EMBOSS and the EMBASSY packages with the same \"USE\" flags. Failure to
77 do so may prevent the compilation of some EMBASSY packages, or cause
78 runtime problems with some EMBASSY programs. For example, if you
79 compile EMBOSS with \"png\" support and then try to build DOMAINATRIX
80 without \"png\" support, compilation will fail when linking the binaries."
83 embassy_src_install() {
84 emake DESTDIR="${D}" install || die "Install failed"
85 dodoc AUTHORS ChangeLog NEWS README
87 mv "${D}"/usr/local/share/* "${D}"/usr/share/
88 rmdir "${D}"/usr/local/share
89 rmdir "${D}"/usr/local
92 EXPORT_FUNCTIONS src_unpack src_compile src_install