| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/www-client/elinks/elinks-0.12_pre5-r2.ebuild,v 1.12 2012/12/29 08:51:42 ago Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
inherit eutils autotools flag-o-matic
|
| 7 |
|
| 8 |
MY_P="${P/_/}"
|
| 9 |
DESCRIPTION="Advanced and well-established text-mode web browser"
|
| 10 |
HOMEPAGE="http://elinks.or.cz/"
|
| 11 |
SRC_URI="http://elinks.or.cz/download/${MY_P}.tar.bz2
|
| 12 |
http://dev.gentoo.org/~spock/portage/distfiles/elinks-0.10.4.conf.bz2
|
| 13 |
http://dev.gentoo.org/~axs/distfiles/${P}-js185-patches.tar.bz2"
|
| 14 |
|
| 15 |
LICENSE="GPL-2"
|
| 16 |
SLOT="0"
|
| 17 |
KEYWORDS="alpha amd64 hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
|
| 18 |
IUSE="bittorrent bzip2 debug finger ftp gopher gpm guile idn ipv6 \
|
| 19 |
javascript lua +mouse nls nntp perl ruby samba ssl unicode X zlib"
|
| 20 |
RESTRICT="test"
|
| 21 |
|
| 22 |
DEPEND="dev-libs/boehm-gc
|
| 23 |
>=dev-libs/expat-1.95.4
|
| 24 |
bzip2? ( >=app-arch/bzip2-1.0.2 )
|
| 25 |
ssl? ( >=dev-libs/openssl-0.9.6g )
|
| 26 |
X? ( x11-libs/libX11 x11-libs/libXt )
|
| 27 |
zlib? ( >=sys-libs/zlib-1.1.4 )
|
| 28 |
lua? ( >=dev-lang/lua-5 )
|
| 29 |
gpm? ( >=sys-libs/ncurses-5.2 >=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? ( sys-devel/libperl )
|
| 33 |
ruby? ( dev-lang/ruby dev-ruby/rubygems )
|
| 34 |
samba? ( net-fs/samba )
|
| 35 |
javascript? ( dev-lang/spidermonkey )"
|
| 36 |
RDEPEND="${DEPEND}"
|
| 37 |
|
| 38 |
S="${WORKDIR}/${MY_P}"
|
| 39 |
|
| 40 |
src_prepare() {
|
| 41 |
cd "${WORKDIR}"
|
| 42 |
epatch "${FILESDIR}"/${PN}-0.10.4.conf-syscharset.diff
|
| 43 |
mv "${PN}-0.10.4.conf" "${PN}.conf"
|
| 44 |
if ! use ftp ; then
|
| 45 |
sed -i -e 's/\(.*protocol.ftp.*\)/# \1/' ${PN}.conf
|
| 46 |
fi
|
| 47 |
sed -i -e 's/\(.*set protocol.ftp.use_epsv.*\)/# \1/' ${PN}.conf
|
| 48 |
cd "${S}"
|
| 49 |
|
| 50 |
if use lua && has_version ">=dev-lang/lua-5.1"; then
|
| 51 |
epatch "${FILESDIR}"/${PN}-0.11.2-lua-5.1.patch
|
| 52 |
fi
|
| 53 |
|
| 54 |
epatch "${FILESDIR}"/${PN}-0.11.5-makefile.patch
|
| 55 |
epatch "${FILESDIR}"/${P}-compilation-fix.patch
|
| 56 |
|
| 57 |
if use javascript ; then
|
| 58 |
if has_version ">=dev-lang/spidermonkey-1.8"; then
|
| 59 |
if has_version ">=dev-lang/spidermonkey-1.8.5"; then
|
| 60 |
epatch "${WORKDIR}"/patches/${P}-js185-1-heartbeat.patch
|
| 61 |
epatch "${WORKDIR}"/patches/${P}-js185-2-up.patch
|
| 62 |
epatch "${WORKDIR}"/patches/${P}-js185-3-histback.patch
|
| 63 |
epatch "${FILESDIR}"/${P}-sm185-jsval-fixes.patch
|
| 64 |
if has_version ">=dev-lang/spidermonkey-1.8.7"; then
|
| 65 |
# fix lib order in configure check and add mozjs187
|
| 66 |
# (these seds are necessary so that @preserved-libs copies are not used)
|
| 67 |
sed -i -e 's:for spidermonkeylib in js .*$:for spidermonkeylib in mozjs187 mozjs185 mozjs js smjs; do:' \
|
| 68 |
configure.in || die
|
| 69 |
else
|
| 70 |
# fix lib order in configure check
|
| 71 |
# (these seds are necessary so that @preserved-libs copies are not used)
|
| 72 |
sed -i -e 's:for spidermonkeylib in js .*$:for spidermonkeylib in mozjs185 mozjs js smjs; do:' \
|
| 73 |
configure.in || die
|
| 74 |
fi
|
| 75 |
else
|
| 76 |
# fix lib order in configure check
|
| 77 |
# (these seds are necessary so that @preserved-libs copies are not used)
|
| 78 |
epatch "${FILESDIR}"/${MY_P}-spidermonkey-callback.patch
|
| 79 |
sed -i -e 's:for spidermonkeylib in js .*$:for spidermonkeylib in mozjs js smjs; do:' \
|
| 80 |
configure.in || die
|
| 81 |
fi
|
| 82 |
fi
|
| 83 |
fi
|
| 84 |
epatch "${FILESDIR}"/${P}-ruby-1.9.patch
|
| 85 |
# Regenerate acinclude.m4 - based on autogen.sh.
|
| 86 |
cat > acinclude.m4 <<- _EOF
|
| 87 |
dnl Automatically generated from config/m4/ files.
|
| 88 |
dnl Do not modify!
|
| 89 |
_EOF
|
| 90 |
cat config/m4/*.m4 >> acinclude.m4
|
| 91 |
|
| 92 |
sed -i -e 's/-Werror//' configure*
|
| 93 |
|
| 94 |
eautoreconf
|
| 95 |
}
|
| 96 |
|
| 97 |
src_configure() {
|
| 98 |
# NOTE about GNUTSL SSL support (from the README -- 25/12/2002)
|
| 99 |
# As GNUTLS is not yet 100% stable and its support in ELinks is not so well
|
| 100 |
# tested yet, it's recommended for users to give a strong preference to OpenSSL whenever possible.
|
| 101 |
local myconf=""
|
| 102 |
|
| 103 |
if use debug ; then
|
| 104 |
myconf="--enable-debug"
|
| 105 |
else
|
| 106 |
myconf="--enable-fastmem"
|
| 107 |
fi
|
| 108 |
|
| 109 |
if use ssl ; then
|
| 110 |
myconf="${myconf} --with-openssl=${EPREFIX}/usr"
|
| 111 |
else
|
| 112 |
myconf="${myconf} --without-openssl --without-gnutls"
|
| 113 |
fi
|
| 114 |
|
| 115 |
econf \
|
| 116 |
--sysconfdir="${EPREFIX}"/etc/elinks \
|
| 117 |
--enable-leds \
|
| 118 |
--enable-88-colors \
|
| 119 |
--enable-256-colors \
|
| 120 |
--enable-true-color \
|
| 121 |
--enable-html-highlight \
|
| 122 |
$(use_with gpm) \
|
| 123 |
$(use_with zlib) \
|
| 124 |
$(use_with bzip2 bzlib) \
|
| 125 |
$(use_with X x) \
|
| 126 |
$(use_with lua) \
|
| 127 |
$(use_with guile) \
|
| 128 |
$(use_with perl) \
|
| 129 |
$(use_with ruby) \
|
| 130 |
$(use_with idn) \
|
| 131 |
$(use_with javascript spidermonkey) \
|
| 132 |
$(use_enable bittorrent) \
|
| 133 |
$(use_enable nls) \
|
| 134 |
$(use_enable ipv6) \
|
| 135 |
$(use_enable ftp) \
|
| 136 |
$(use_enable gopher) \
|
| 137 |
$(use_enable nntp) \
|
| 138 |
$(use_enable finger) \
|
| 139 |
$(use_enable samba smb) \
|
| 140 |
$(use_enable mouse) \
|
| 141 |
${myconf}
|
| 142 |
}
|
| 143 |
|
| 144 |
src_install() {
|
| 145 |
emake DESTDIR="${D}" install
|
| 146 |
|
| 147 |
insopts -m 644 ; insinto /etc/elinks
|
| 148 |
doins "${WORKDIR}"/elinks.conf
|
| 149 |
newins contrib/keybind-full.conf keybind-full.sample
|
| 150 |
newins contrib/keybind.conf keybind.conf.sample
|
| 151 |
|
| 152 |
dodoc AUTHORS BUGS ChangeLog INSTALL NEWS README SITES THANKS TODO doc/*.*
|
| 153 |
docinto contrib ; dodoc contrib/{README,colws.diff,elinks[-.]vim*}
|
| 154 |
insinto /usr/share/doc/${PF}/contrib/lua ; doins contrib/lua/{*.lua,elinks-remote}
|
| 155 |
insinto /usr/share/doc/${PF}/contrib/conv ; doins contrib/conv/*.*
|
| 156 |
insinto /usr/share/doc/${PF}/contrib/guile ; doins contrib/guile/*.scm
|
| 157 |
|
| 158 |
# Remove some conflicting files on OSX. The files provided by OSX 10.4
|
| 159 |
# are more or less the same. -- Fabian Groffen (2005-06-30)
|
| 160 |
rm -f "${ED}"/usr/share/locale/locale.alias "${ED}"/usr/lib/charset.alias || die
|
| 161 |
}
|
| 162 |
|
| 163 |
pkg_postinst() {
|
| 164 |
einfo "This ebuild provides a default config for ELinks."
|
| 165 |
einfo "Please check /etc/elinks/elinks.conf"
|
| 166 |
einfo
|
| 167 |
einfo "You may want to convert your html.cfg and links.cfg of"
|
| 168 |
einfo "Links or older ELinks versions to the new ELinks elinks.conf"
|
| 169 |
einfo "using /usr/share/doc/${PF}/contrib/conv/conf-links2elinks.pl"
|
| 170 |
einfo
|
| 171 |
einfo "Please have a look at /etc/elinks/keybind-full.sample and"
|
| 172 |
einfo "/etc/elinks/keybind.conf.sample for some bindings examples."
|
| 173 |
einfo
|
| 174 |
einfo "You will have to set your TERM variable to 'xterm-256color'"
|
| 175 |
einfo "to be able to use 256 colors in elinks."
|
| 176 |
echo
|
| 177 |
}
|