net-wireless/hostapd: use #!/sbin/openrc-run instead of #!/sbin/runscript
[gentoo.git] / eclass / emboss-r1.eclass
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 # @ECLASS: emboss-r1.eclass
6 # @MAINTAINER:
7 # sci-biology@gentoo.org
8 # jlec@gentoo.org
9 # ted.tanberry@gmail.com
10 # @AUTHOR:
11 # Original author: Author Olivier Fisette <ofisette@gmail.com>
12 # Next gen author: Justin Lecher <jlec@gentoo.org>
13 # Next gen author: Ted Tanberry <ted.tanberry@gmail.com>
14 # @BLURB: Use this to easy install EMBOSS and EMBASSY programs (EMBOSS add-ons).
15 # @DESCRIPTION:
16 # The inheriting ebuild must set at least EAPI=5 and provide EBO_DESCRIPTION before the inherit line.
17 # KEYWORDS should be set. Additionally "(R|P)DEPEND"encies and other standard
18 # ebuild variables can be extended (FOO+=" bar").
19 #
20 # Example:
21 #
22 # EAPI="5"
23 #
24 # EBO_DESCRIPTION="applications from the CBS group"
25 #
26 # inherit emboss-r1
27
28 # @ECLASS-VARIABLE: EBO_DESCRIPTION
29 # @DEFAULT_UNSET
30 # @DESCRIPTION:
31 # Should be set. Completes the generic description of the embassy module as follows:
32 #
33 # EMBOSS integrated version of ${EBO_DESCRIPTION}, e.g.
34 #
35 # "EMBOSS integrated version of applications from the CBS group"
36 #
37 # Defaults to the upstream name of the module.
38
39 # @ECLASS-VARIABLE: EBO_EXTRA_ECONF
40 # @DEFAULT_UNSET
41 # @DESCRIPTION:
42 # Extra config options passed to econf.
43
44 case ${EAPI:-0} in
45         5) ;;
46         *) die "this eclass doesn't support < EAPI 5" ;;
47 esac
48
49 inherit autotools-utils eutils flag-o-matic
50
51 HOMEPAGE="http://emboss.sourceforge.net/"
52 LICENSE="LGPL-2 GPL-2"
53
54 SLOT="0"
55 IUSE="mysql pdf png postgres static-libs X"
56
57 DEPEND="
58         dev-libs/expat
59         dev-libs/libpcre:3
60         sci-libs/plplot
61         sys-libs/zlib
62         mysql? ( virtual/mysql )
63         pdf? ( media-libs/libharu )
64         png? ( media-libs/gd[png] )
65         postgres? ( dev-db/postgresql:= )
66         X? ( x11-libs/libXt )"
67 RDEPEND="${DEPEND}"
68
69 if [[ ${PN} == embassy-* ]]; then
70         EMBASSY_PACKAGE=yes
71         # The EMBASSY package name, retrieved from the inheriting ebuild's name
72         EN=${PN:8}
73         # The full name and version of the EMBASSY package (excluding the Gentoo
74         # revision number)
75         EF=$(echo ${EN} | tr "[:lower:]" "[:upper:]")-${PV}
76         : ${EBO_DESCRIPTION:=${EN}}
77         DESCRIPTION="EMBOSS integrated version of ${EBO_DESCRIPTION}"
78         SRC_URI="ftp://emboss.open-bio.org/pub/EMBOSS/${EF}.tar.gz -> embassy-${EN}-${PVR}.tar.gz"
79         DEPEND+=" >=sci-biology/emboss-6.6.0[mysql=,pdf=,png=,postgres=,static-libs=,X=]"
80
81         S="${WORKDIR}"/${EF}
82 fi
83
84 # @FUNCTION: emboss-r1_src_prepare
85 # @DESCRIPTION:
86 # Does the following things
87 #
88 #  1. Renames configure.in to configure.ac, if possible
89 #  2. Applies ${PATCHES[@]} and runs autotools via autotools-utils.eclass
90 #
91
92 emboss-r1_src_prepare() {
93         if [[ -e configure.in ]]; then
94                 mv configure.{in,ac} || die
95         fi
96
97         autotools-utils_src_prepare
98 }
99
100 # @FUNCTION: emboss-r1_src_configure
101 # @DESCRIPTION:
102 # runs econf with following options.
103 #
104 #  $(use_with X x)
105 #  $(use_with png pngdriver)
106 #  $(use_with pdf hpdf)
107 #  $(use_with mysql mysql)
108 #  $(use_with postgres postgresql)
109 #  $(use_enable static-libs static)
110 #  --enable-large
111 #  --without-java
112 #  --enable-systemlibs
113 #  ${EBO_EXTRA_ECONF}
114
115 emboss-r1_src_configure() {
116         local myeconfargs=(
117                 $(use_with X x)
118                 $(use_with png pngdriver "${EPREFIX}/usr")
119                 $(use_with pdf hpdf "${EPREFIX}/usr")
120                 $(use_with mysql mysql "${EPREFIX}/usr/bin/mysql_config")
121                 $(use_with postgres postgresql "${EPREFIX}/usr/bin/pg_config")
122                 --enable-large
123                 --without-java
124                 --enable-systemlibs
125                 ${EBO_EXTRA_ECONF}
126         )
127
128         [[ ${EMBASSY_PACKAGE} == yes ]] && \
129                 append-cppflags "-I${EPREFIX}/usr/include/emboss"
130
131         autotools-utils_src_configure
132 }
133
134 EXPORT_FUNCTIONS src_prepare src_configure