nkf-2.1.3.ebuild 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit eutils distutils-r1 perl-module toolchain-funcs
  6. DESCRIPTION="Network Kanji code conversion Filter with UTF-8/16 support"
  7. HOMEPAGE="http://sourceforge.jp/projects/nkf/"
  8. SRC_URI="mirror://sourceforge.jp/nkf/59912/${P}.tar.gz
  9. python? ( https://dev.gentoo.org/~naota/files/NKF_python20090602.tgz )"
  10. LICENSE="ZLIB"
  11. SLOT="0"
  12. KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-macos"
  13. IUSE="perl python l10n_ja"
  14. src_prepare() {
  15. sed -i \
  16. -e '/^CFLAGS/{s|-g -O2||;s|=|+=|;}' \
  17. -e '/-o nkf/s:$(CFLAGS):$(CFLAGS) $(LDFLAGS):' \
  18. Makefile || die
  19. if use python; then
  20. mv "${WORKDIR}/NKF.python" "${S}" || die
  21. epatch "${FILESDIR}"/${P}-strip.patch
  22. fi
  23. }
  24. src_compile() {
  25. emake CC="$(tc-getCC)" nkf || die
  26. if use perl; then
  27. cd "${S}/NKF.mod"
  28. perl-module_src_compile
  29. fi
  30. if use python; then
  31. cd "${S}/NKF.python"
  32. distutils-r1_src_compile
  33. fi
  34. }
  35. src_test() {
  36. emake test || die
  37. if use perl; then
  38. cd "${S}/NKF.mod"
  39. perl-module_src_test
  40. fi
  41. }
  42. src_install() {
  43. dobin nkf || die
  44. doman nkf.1
  45. if use l10n_ja; then
  46. ./nkf -e nkf.1j > nkf.1
  47. doman -i18n=ja nkf.1
  48. fi
  49. dodoc nkf.doc
  50. if use perl; then
  51. cd "${S}/NKF.mod"
  52. perl-module_src_install
  53. fi
  54. if use python; then
  55. cd "${S}/NKF.python"
  56. distutils-r1_src_install
  57. fi
  58. }