| 1 |
# Copyright 1999-2005 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/www-client/links/links-2.1_pre17-r2.ebuild,v 1.2 2005/06/09 01:14:43 mr_bones_ Exp $
|
| 4 |
|
| 5 |
inherit eutils toolchain-funcs
|
| 6 |
|
| 7 |
DESCRIPTION="links is a fast lightweight text tand graphic web-browser"
|
| 8 |
HOMEPAGE="http://atrey.karlin.mff.cuni.cz/~clock/twibright/links/"
|
| 9 |
# To handle pre-version ...
|
| 10 |
MY_P="${P/_/}"
|
| 11 |
S="${WORKDIR}/${MY_P}"
|
| 12 |
SRC_URI="${HOMEPAGE}/download/${MY_P}.tar.bz2
|
| 13 |
mirror://gentoo/${MY_P}-utf8.diff.bz2"
|
| 14 |
|
| 15 |
LICENSE="GPL-2"
|
| 16 |
SLOT="2"
|
| 17 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~ppc-macos ~s390 ~sparc ~x86"
|
| 18 |
IUSE="directfb ssl javascript png X gpm tiff fbcon svga jpeg unicode livecd"
|
| 19 |
|
| 20 |
# Note: if X or fbcon usegflag are enabled, links will be built in graphic
|
| 21 |
# mode. libpng is required to compile links in graphic mode
|
| 22 |
# (not required in text mode), so let's add libpng for X? and fbcon?
|
| 23 |
|
| 24 |
# We've also made USE=livecd compile in graphics mode. This closes bug #75685.
|
| 25 |
|
| 26 |
RDEPEND="ssl? ( >=dev-libs/openssl-0.9.6c )
|
| 27 |
gpm? ( sys-libs/gpm )
|
| 28 |
javascript? ( >=sys-devel/flex-2.5.4a )
|
| 29 |
png? ( >=media-libs/libpng-1.2.1 )
|
| 30 |
jpeg? ( >=media-libs/jpeg-6b )
|
| 31 |
tiff? ( >=media-libs/tiff-3.5.7 )
|
| 32 |
svga? ( >=media-libs/svgalib-1.4.3
|
| 33 |
>=media-libs/libpng-1.2.1 )
|
| 34 |
X? ( virtual/x11
|
| 35 |
>=media-libs/libpng-1.2.1 )
|
| 36 |
directfb? ( dev-libs/DirectFB )
|
| 37 |
fbcon? ( >=media-libs/libpng-1.2.1
|
| 38 |
sys-libs/gpm )
|
| 39 |
!ppc-macos? ( livecd?
|
| 40 |
( >=media-libs/jpeg-6b
|
| 41 |
>=media-libs/libpng-1.2.1
|
| 42 |
sys-libs/gpm ) )
|
| 43 |
sys-libs/zlib
|
| 44 |
virtual/libc
|
| 45 |
sys-libs/ncurses"
|
| 46 |
|
| 47 |
DEPEND="${RDEPEND}
|
| 48 |
sys-devel/automake
|
| 49 |
sys-devel/autoconf
|
| 50 |
sys-devel/gcc
|
| 51 |
dev-util/pkgconfig"
|
| 52 |
|
| 53 |
PROVIDE="virtual/textbrowser"
|
| 54 |
|
| 55 |
pkg_setup (){
|
| 56 |
|
| 57 |
if ! use gpm && use fbcon ; then
|
| 58 |
einfo
|
| 59 |
einfo "gpm has been installed since you have included fbcon in your USE flags."
|
| 60 |
einfo "The links framebuffer driver requires gpm in order to compile."
|
| 61 |
einfo
|
| 62 |
fi
|
| 63 |
|
| 64 |
}
|
| 65 |
|
| 66 |
src_unpack (){
|
| 67 |
unpack ${A}; cd ${S}
|
| 68 |
|
| 69 |
if use unicode ; then
|
| 70 |
epatch ${WORKDIR}/${MY_P}-utf8.diff
|
| 71 |
epatch ${FILESDIR}/${P}-auth.patch
|
| 72 |
export LANG=C
|
| 73 |
cd ${S}/intl && ./gen-intl && cd .. || die "gen-intl filed"
|
| 74 |
fi
|
| 75 |
}
|
| 76 |
|
| 77 |
src_compile (){
|
| 78 |
local myconf
|
| 79 |
|
| 80 |
if use X || use fbcon || use directfb || use svga || use livecd; then
|
| 81 |
myconf="${myconf} --enable-graphics"
|
| 82 |
fi
|
| 83 |
|
| 84 |
# Note: --enable-static breaks.
|
| 85 |
|
| 86 |
# Note: ./configure only support 'gpm' features auto-detection, so
|
| 87 |
# we use the autoconf trick
|
| 88 |
( use gpm || use fbcon || use livecd ) || export ac_cv_lib_gpm_Gpm_Open="no"
|
| 89 |
|
| 90 |
export LANG=C
|
| 91 |
|
| 92 |
if use fbcon || use livecd; then
|
| 93 |
myconf="${myconf} --with-fb"
|
| 94 |
else
|
| 95 |
myconf="${myconf} --without-fb"
|
| 96 |
fi
|
| 97 |
|
| 98 |
# force --with-libjpeg if livecd flag is set
|
| 99 |
if use livecd; then
|
| 100 |
myconf="${myconf} --with-libjpeg"
|
| 101 |
fi
|
| 102 |
|
| 103 |
# hack to allow cross-compilation
|
| 104 |
export CC="$(tc-getCC)"
|
| 105 |
|
| 106 |
econf \
|
| 107 |
$(use_with X x) \
|
| 108 |
$(use_with png libpng) \
|
| 109 |
$(use_with jpeg libjpeg) \
|
| 110 |
$(use_with tiff libtiff) \
|
| 111 |
$(use_with svga svgalib) \
|
| 112 |
$(use_with directfb) \
|
| 113 |
$(use_with ssl) \
|
| 114 |
$(use_enable javascript) \
|
| 115 |
${myconf} || die "configure failed"
|
| 116 |
emake || die "make failed"
|
| 117 |
}
|
| 118 |
|
| 119 |
src_install (){
|
| 120 |
einstall
|
| 121 |
|
| 122 |
# Only install links icon if X driver was compiled in ...
|
| 123 |
use X && doicon graphics/links.xpm
|
| 124 |
|
| 125 |
dodoc AUTHORS BUGS ChangeLog INSTALL NEWS README SITES TODO
|
| 126 |
dohtml doc/links_cal/*
|
| 127 |
|
| 128 |
# Install a compatibility symlink links2:
|
| 129 |
dosym links /usr/bin/links2
|
| 130 |
}
|
| 131 |
|
| 132 |
|
| 133 |
pkg_postinst() {
|
| 134 |
|
| 135 |
if use svga
|
| 136 |
then
|
| 137 |
einfo "You had the svga USE flag enabled, but for security reasons"
|
| 138 |
einfo "the links2 binary is NOT setuid by default. In order to"
|
| 139 |
einfo "enable links2 to work in SVGA, please change the permissions"
|
| 140 |
einfo "of /usr/bin/links2 to enable suid."
|
| 141 |
fi
|
| 142 |
}
|