kinput2-3.1-r2.ebuild 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Copyright 1999-2012 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="3"
  4. inherit eutils
  5. MY_P="${PN}-v${PV}"
  6. DESCRIPTION="A Japanese input server which supports the XIM protocol"
  7. HOMEPAGE="http://www.nec.co.jp/canna/"
  8. SRC_URI="ftp://ftp.sra.co.jp/pub/x11/${PN}/${MY_P}.tar.gz"
  9. LICENSE="HPND"
  10. SLOT="0"
  11. KEYWORDS="amd64 ~ppc ~ppc64 ~sparc x86"
  12. IUSE="freewnn"
  13. RDEPEND="freewnn? ( >=app-i18n/freewnn-1.1.1_alpha19 )
  14. !freewnn? ( >=app-i18n/canna-3.5_beta2-r1 )
  15. x11-libs/libX11
  16. x11-libs/libXaw
  17. x11-libs/libXmu
  18. x11-libs/libXp
  19. x11-libs/libXt"
  20. DEPEND="${RDEPEND}
  21. x11-misc/gccmakedep
  22. x11-misc/imake
  23. app-text/rman"
  24. S="${WORKDIR}/${MY_P}"
  25. src_prepare() {
  26. epatch "${FILESDIR}/${P}-r1-gentoo.diff"
  27. if use freewnn; then
  28. sed -i -e '/\/\* #define UseWnn/s:^:#define UseWnn\n:' Kinput2.conf || die
  29. else
  30. sed -i -e '/\/\* #define UseCanna/s:^:#define UseCanna\n:' Kinput2.conf || die
  31. fi
  32. }
  33. src_configure() {
  34. xmkmf -a || die
  35. }
  36. src_compile() {
  37. emake \
  38. XAPPLOADDIR="${EPREFIX}/usr/share/X11/app-defaults/" \
  39. CDEBUGFLAGS="${CFLAGS}" \
  40. LOCAL_LDFLAGS="${LDFLAGS}" \
  41. || die
  42. }
  43. src_install() {
  44. emake XAPPLOADDIR="/usr/share/X11/app-defaults/" DESTDIR="${D}" install || die
  45. rm -rf "${ED}/usr/lib/X11" || die
  46. local server
  47. if use freewnn; then
  48. server="wnn"
  49. else
  50. server="canna"
  51. fi
  52. insinto /etc/X11/xinit/xinput.d
  53. sed \
  54. -e "s:@EPREFIX@:${EPREFIX}:g" \
  55. -e "s:@SERVER@:${server}:g" \
  56. "${FILESDIR}/xinput-kinput2" > "${T}/kinput2.conf" || die
  57. doins "${T}/kinput2.conf" || die
  58. dodoc README NEWS doc/* || die
  59. newman cmd/${PN}.man ${PN}.1 || die
  60. }