elinks-9999.ebuild 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. PYTHON_REQ_USE="threads"
  6. inherit autotools eutils git-r3 flag-o-matic python-any-r1
  7. EGIT_REPO_URI="git://repo.or.cz/elinks.git"
  8. MY_P="${P/_/}"
  9. DESCRIPTION="Advanced and well-established text-mode web browser"
  10. HOMEPAGE="http://elinks.or.cz/"
  11. SRC_URI="https://dev.gentoo.org/~spock/portage/distfiles/elinks-0.10.4.conf.bz2"
  12. LICENSE="GPL-2"
  13. SLOT="0"
  14. KEYWORDS=""
  15. IUSE="bittorrent bzip2 debug finger ftp gc gopher gpm guile idn ipv6
  16. javascript libressl lua +mouse nls nntp perl ruby samba ssl unicode X xml zlib"
  17. RESTRICT="test"
  18. DEPEND="
  19. bzip2? ( >=app-arch/bzip2-1.0.2 )
  20. gc? ( dev-libs/boehm-gc )
  21. ssl? (
  22. !libressl? ( dev-libs/openssl:0= )
  23. libressl? ( dev-libs/libressl:0= )
  24. )
  25. xml? ( >=dev-libs/expat-1.95.4 )
  26. X? ( x11-libs/libX11 x11-libs/libXt )
  27. zlib? ( >=sys-libs/zlib-1.1.4 )
  28. lua? ( >=dev-lang/lua-5:0= )
  29. gpm? ( >=sys-libs/ncurses-5.2:0= >=sys-libs/gpm-1.20.0-r5 )
  30. guile? ( >=dev-scheme/guile-1.6.4-r1[deprecated,discouraged] )
  31. idn? ( net-dns/libidn )
  32. perl? ( dev-lang/perl:= )
  33. ruby? ( dev-lang/ruby:* dev-ruby/rubygems:* )
  34. samba? ( net-fs/samba )
  35. javascript? ( >=dev-lang/spidermonkey-1.8.5:0= )"
  36. RDEPEND="${DEPEND}"
  37. src_unpack() {
  38. default
  39. git-r3_src_unpack
  40. }
  41. src_prepare() {
  42. mv "${WORKDIR}/${PN}-0.10.4.conf" "${WORKDIR}/${PN}.conf"
  43. if ! use ftp ; then
  44. sed -i -e 's/\(.*protocol.ftp.*\)/# \1/' "${WORKDIR}"/${PN}.conf
  45. fi
  46. sed -i -e 's/\(.*set protocol.ftp.use_epsv.*\)/# \1/' "${WORKDIR}"/${PN}.conf
  47. epatch "${FILESDIR}"/${P}-parallel-make.patch
  48. epatch_user
  49. # Regenerate acinclude.m4 - based on autogen.sh.
  50. cat > acinclude.m4 <<- _EOF
  51. dnl Automatically generated from config/m4/ files.
  52. dnl Do not modify!
  53. _EOF
  54. cat config/m4/*.m4 >> acinclude.m4
  55. sed -i -e 's/-Werror//' configure*
  56. eautoreconf
  57. }
  58. src_configure() {
  59. # NOTE about GNUTSL SSL support (from the README -- 25/12/2002)
  60. # As GNUTLS is not yet 100% stable and its support in ELinks is not so well
  61. # tested yet, it's recommended for users to give a strong preference to OpenSSL whenever possible.
  62. local myconf=""
  63. if use debug ; then
  64. myconf="--enable-debug"
  65. else
  66. myconf="--enable-fastmem"
  67. fi
  68. if use ssl ; then
  69. myconf="${myconf} --with-openssl=${EPREFIX}/usr"
  70. else
  71. myconf="${myconf} --without-openssl --without-gnutls"
  72. fi
  73. econf \
  74. --sysconfdir="${EPREFIX}"/etc/elinks \
  75. --enable-leds \
  76. --enable-88-colors \
  77. --enable-256-colors \
  78. --enable-true-color \
  79. --enable-html-highlight \
  80. $(use_with gpm) \
  81. $(use_with zlib) \
  82. $(use_with bzip2 bzlib) \
  83. $(use_with gc) \
  84. $(use_with X x) \
  85. $(use_with lua) \
  86. $(use_with guile) \
  87. $(use_with perl) \
  88. $(use_with ruby) \
  89. $(use_with idn) \
  90. $(use_with javascript spidermonkey) \
  91. $(use_enable bittorrent) \
  92. $(use_enable nls) \
  93. $(use_enable ipv6) \
  94. $(use_enable ftp) \
  95. $(use_enable gopher) \
  96. $(use_enable nntp) \
  97. $(use_enable finger) \
  98. $(use_enable samba smb) \
  99. $(use_enable mouse) \
  100. $(use_enable xml xbel) \
  101. ${myconf}
  102. }
  103. src_compile() {
  104. emake V=1
  105. }
  106. src_install() {
  107. emake V=1 DESTDIR="${D}" install
  108. insopts -m 644 ; insinto /etc/elinks
  109. doins "${WORKDIR}"/elinks.conf
  110. newins contrib/keybind-full.conf keybind-full.sample
  111. newins contrib/keybind.conf keybind.conf.sample
  112. dodoc AUTHORS BUGS ChangeLog INSTALL NEWS README SITES THANKS TODO doc/*.*
  113. docinto contrib ; dodoc contrib/{README,colws.diff,elinks[-.]vim*}
  114. insinto /usr/share/doc/${PF}/contrib/lua ; doins contrib/lua/{*.lua,elinks-remote}
  115. insinto /usr/share/doc/${PF}/contrib/conv ; doins contrib/conv/*.*
  116. insinto /usr/share/doc/${PF}/contrib/guile ; doins contrib/guile/*.scm
  117. # Remove some conflicting files on OSX. The files provided by OSX 10.4
  118. # are more or less the same. -- Fabian Groffen (2005-06-30)
  119. rm -f "${ED}"/usr/share/locale/locale.alias "${ED}"/usr/lib/charset.alias || die
  120. }
  121. pkg_postinst() {
  122. einfo "This ebuild provides a default config for ELinks."
  123. einfo "Please check /etc/elinks/elinks.conf"
  124. einfo
  125. einfo "You may want to convert your html.cfg and links.cfg of"
  126. einfo "Links or older ELinks versions to the new ELinks elinks.conf"
  127. einfo "using /usr/share/doc/${PF}/contrib/conv/conf-links2elinks.pl"
  128. einfo
  129. einfo "Please have a look at /etc/elinks/keybind-full.sample and"
  130. einfo "/etc/elinks/keybind.conf.sample for some bindings examples."
  131. einfo
  132. einfo "You will have to set your TERM variable to 'xterm-256color'"
  133. einfo "to be able to use 256 colors in elinks."
  134. echo
  135. }