nkf-2.1.3-r1.ebuild 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. l10n_ja? ( https://dev.gentoo.org/~naota/files/nkf.1j )
  10. python? ( https://dev.gentoo.org/~naota/files/NKF_python20090602.tgz )"
  11. LICENSE="ZLIB"
  12. SLOT="0"
  13. KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-macos"
  14. IUSE="perl python l10n_ja"
  15. src_prepare() {
  16. sed -i \
  17. -e '/^CFLAGS/{s|-g -O2||;s|=|+=|;}' \
  18. -e '/-o nkf/s:$(CFLAGS):$(CFLAGS) $(LDFLAGS):' \
  19. Makefile || die
  20. if use l10n_ja; then
  21. cp "${DISTDIR}"/nkf.1j "${S}" || die
  22. fi
  23. if use python; then
  24. mv "${WORKDIR}/NKF.python" "${S}" || die
  25. epatch "${FILESDIR}"/${P}-strip.patch
  26. fi
  27. }
  28. src_compile() {
  29. emake CC="$(tc-getCC)" nkf || die
  30. if use perl; then
  31. cd "${S}/NKF.mod"
  32. perl-module_src_compile
  33. fi
  34. if use python; then
  35. cd "${S}/NKF.python"
  36. distutils-r1_src_compile
  37. fi
  38. }
  39. src_test() {
  40. emake test || die
  41. if use perl; then
  42. cd "${S}/NKF.mod"
  43. perl-module_src_test
  44. fi
  45. }
  46. src_install() {
  47. dobin nkf || die
  48. doman nkf.1
  49. if use l10n_ja; then
  50. ./nkf -e nkf.1j > nkf.1
  51. doman -i18n=ja nkf.1
  52. fi
  53. dodoc nkf.doc
  54. if use perl; then
  55. cd "${S}/NKF.mod"
  56. perl-module_src_install
  57. fi
  58. if use python; then
  59. cd "${S}/NKF.python"
  60. distutils-r1_src_install
  61. fi
  62. }