sci-calculators/units-2.14-r1: ppc stable, bug 625086
[gentoo.git] / sci-calculators / units / units-2.14-r1.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python{2_7,3_4,3_5} )
6 PYTHON_REQ_USE="xml"
7 inherit eutils python-single-r1
8
9 DESCRIPTION="Unit conversion program"
10 HOMEPAGE="https://www.gnu.org/software/units/units.html"
11 SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
12
13 LICENSE="FDL-1.3 GPL-3"
14 SLOT="0"
15 KEYWORDS="~alpha amd64 ~arm hppa ppc ~ppc64 ~sparc x86 ~amd64-linux ~x86-linux"
16 IUSE="+units_cur"
17 REQUIRED_USE="units_cur? ( ${PYTHON_REQUIRED_USE} )"
18
19 RDEPEND="
20         sys-libs/readline:=
21         units_cur? (
22                 dev-python/unidecode[${PYTHON_USEDEP}]
23                 ${PYTHON_DEPS}
24         )"
25 DEPEND=${RDEPEND}
26
27 pkg_setup() {
28         use units_cur && python-single-r1_pkg_setup
29 }
30
31 src_configure() {
32         econf ac_cv_path_PYTHON=no
33 }
34
35 src_install() {
36         emake DESTDIR="${D}" install
37
38         dodoc ChangeLog NEWS README
39
40         # we're intentionally delaying this since 'make install' would
41         # get confused if we shove 'units_cur' there, and there is no real
42         # need to add more complexity for it
43         if use units_cur; then
44                 local pyver
45                 python_is_python3 && pyver=3 || pyver=2
46                 sed -e "/^outfile/s|'.*'|'/usr/share/units/currency.units'|g" \
47                         "units_cur${pyver}" > units_cur || die
48                 python_doscript units_cur
49         fi
50 }