sci-calculators/units: Version bump.
[gentoo.git] / sci-calculators / units / units-2.16.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 inherit eutils python-single-r1
7
8 DESCRIPTION="Unit conversion program"
9 HOMEPAGE="https://www.gnu.org/software/units/units.html"
10 SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
11
12 LICENSE="FDL-1.3 GPL-3"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
15 IUSE="+units_cur"
16 REQUIRED_USE="units_cur? ( ${PYTHON_REQUIRED_USE} )"
17
18 RDEPEND="
19         sys-libs/readline:=
20         units_cur? (
21                 ${PYTHON_DEPS}
22                 dev-python/future[${PYTHON_USEDEP}]
23         )
24 "
25 DEPEND="
26         ${RDEPEND}
27 "
28
29 pkg_setup() {
30         use units_cur && python-single-r1_pkg_setup
31 }
32
33 src_configure() {
34         econf ac_cv_path_PYTHON=no
35 }
36
37 src_compile() {
38         emake ${PN}
39 }
40
41 src_install() {
42         emake DESTDIR="${D}" install
43
44         dodoc ChangeLog NEWS README
45
46         # we're intentionally delaying this since 'make install' would
47         # get confused if we shove 'units_cur' there, and there is no real
48         # need to add more complexity for it
49         if use units_cur; then
50                 sed \
51                         -e "/^outfile/s|'.*'|'/usr/share/units/currency.units'|g" \
52                         -e 's|^#!|&/usr/bin/python|g' \
53                         units_cur_inst > units_cur || die
54                 python_fix_shebang units_cur
55                 python_doscript units_cur
56         fi
57 }