units-2.14-r1.ebuild 1.2 KB

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