w3mmee-0.3.2_p24-r7.ebuild 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. inherit alternatives eutils toolchain-funcs multilib
  4. IUSE="gpm imlib nls ssl xface"
  5. MY_PV=${PV##*_}-22
  6. MY_P=${PN}-${MY_PV}
  7. DESCRIPTION="A variant of w3m with support for multiple character encodings"
  8. SRC_URI="http://pub.ks-and-ks.ne.jp/prog/pub/${MY_P}.tar.gz"
  9. HOMEPAGE="http://pub.ks-and-ks.ne.jp/prog/w3mmee/"
  10. SLOT="0"
  11. LICENSE="public-domain"
  12. KEYWORDS="amd64 ppc x86"
  13. DEPEND=">=sys-libs/ncurses-5.2-r3
  14. >=sys-libs/zlib-1.1.3-r2
  15. >=dev-libs/boehm-gc-7.2
  16. dev-lang/perl
  17. >=dev-libs/libmoe-1.5.3
  18. imlib? ( >=media-libs/imlib-1.9.8
  19. xface? ( media-libs/compface ) )
  20. gpm? ( >=sys-libs/gpm-1.19.3-r5 )
  21. nls? ( sys-devel/gettext )
  22. ssl? ( >=dev-libs/openssl-0.9.6b )"
  23. RDEPEND="${DEPEND}"
  24. S=${WORKDIR}/${MY_P}
  25. src_unpack() {
  26. unpack ${A}
  27. cd "${S}"
  28. epatch "${FILESDIR}"/${PN}-w3mman-gentoo.diff \
  29. "${FILESDIR}"/${PN}-gcc4{4,5}.patch \
  30. "${FILESDIR}"/${P}-glibc214.patch \
  31. "${FILESDIR}"/${P}-tinfo.patch \
  32. "${FILESDIR}"/${P}-boehm-gc.patch
  33. sed -ie "/^AR=/s:ar:$(tc-getAR):" XMakefile || die
  34. }
  35. src_compile() {
  36. local myconf myuse
  37. myuse="use_cookie=y use_ansi_color=y use_history=y
  38. display_code=E system_code=E"
  39. if use ssl ; then
  40. myconf="${myconf} --ssl-includedir=/usr/include/openssl
  41. --ssl-libdir=/usr/$(get_libdir)"
  42. myuse="${myuse} use_ssl=y use_ssl_verify=y use_digest_auth=y"
  43. else
  44. myuse="${myuse} use_ssl=n"
  45. fi
  46. if use gpm ; then
  47. myuse="${myuse} use_mouse=y"
  48. else
  49. myuse="${myuse} use_mouse=n"
  50. fi
  51. if use nls ; then
  52. myconf="${myconf} -locale_dir=/usr/share/locale"
  53. else
  54. myconf="${myconf} -locale_dir='(NONE)'"
  55. fi
  56. if use imlib ; then
  57. myuse="${myuse} use_image=y use_w3mimg_x11=y
  58. use_w3mimg_fb=n w3mimgdisplay_setuid=n"
  59. if use xface ; then
  60. myuse="${myuse} use_xface=y"
  61. else
  62. myuse="${myuse} use_xface=n"
  63. fi
  64. else
  65. myuse="${myuse} use_image=n"
  66. fi
  67. cat >>config.param<<-EOF
  68. lang=MANY
  69. accept_lang=en
  70. EOF
  71. env CC=$(tc-getCC) ${myuse} ./configure -nonstop \
  72. -prefix=/usr \
  73. -suffix=mee \
  74. -auxbindir=/usr/$(get_libdir)/w3mmee \
  75. -libdir=/usr/$(get_libdir)/w3mmee/cgi-bin \
  76. -helpdir=/usr/share/w3mmee \
  77. -mandir=/usr/share/man \
  78. -sysconfdir=/etc/w3mmee \
  79. -model=custom \
  80. -libmoe=/usr/$(get_libdir) \
  81. -mb_h=/usr/include/moe \
  82. -mk_btri=/usr/libexec/moe \
  83. -cflags="${CFLAGS}" -ldflags="${LDFLAGS}" \
  84. ${myconf} || die
  85. emake || die "emake failed"
  86. }
  87. src_install() {
  88. make DESTDIR="${D}" install || die
  89. # w3mman and manpages conflict with those from w3m
  90. mv "${D}"/usr/share/man/ja/man1/w3m{,mee}.1 || die
  91. mv "${D}"/usr/share/man/man1/w3m{,mee}.1 || die
  92. dodoc ChangeLog NEWS* README
  93. dohtml 00INCOMPATIBLE.html
  94. docinto en
  95. dodoc doc/HISTORY doc/README* doc/keymap.* doc/menu.*
  96. dohtml doc/*
  97. docinto jp
  98. dodoc doc-jp/HISTORY doc-jp/README* doc-jp/keymap* doc-jp/menu.*
  99. dohtml doc-jp/*
  100. }
  101. pkg_postinst() {
  102. w3m_alternatives
  103. einfo
  104. einfo "If you want to render multilingual text, please refer to"
  105. einfo "/usr/share/doc/${PF}/en/README.mee or"
  106. einfo "/usr/share/doc/${PF}/jp/README.mee"
  107. einfo "and set W3MLANG variable respectively."
  108. einfo
  109. }
  110. pkg_postrm() {
  111. w3m_alternatives
  112. }
  113. w3m_alternatives() {
  114. if [ ! -f /usr/bin/w3m ] ; then
  115. alternatives_makesym /usr/bin/w3m \
  116. /usr/bin/w3m{m17n,mee}
  117. alternatives_makesym /usr/bin/w3mman \
  118. /usr/bin/w3m{man-m17n,meeman}
  119. alternatives_makesym /usr/share/man/ja/man1/w3m.1.gz \
  120. /usr/share/man/ja/man1/w3m{m17n,mee}.1.gz
  121. alternatives_makesym /usr/share/man/man1/w3m.1.gz \
  122. /usr/share/man/man1/w3m{m17n,mee}.1.gz
  123. alternatives_makesym /usr/share/man/man1/w3mman.1.gz \
  124. /usr/share/man/man1/w3m{man-m17n,meeman}.1.gz
  125. fi
  126. }