Merge media-sound/spotify: Fix homepage URL
[gentoo.git] / www-client / links / links-2.9-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit autotools eutils fdo-mime
7
8 DEBIAN_REVISION=2.9-2
9
10 DESCRIPTION="A fast and lightweight web browser running in both graphics and text mode"
11 HOMEPAGE="http://links.twibright.com/"
12 SRC_URI="http://${PN}.twibright.com/download/${P}.tar.bz2
13         mirror://debian/pool/main/${PN:0:1}/${PN}2/${PN}2_${DEBIAN_REVISION}.debian.tar.xz"
14
15 LICENSE="GPL-2"
16 SLOT="2"
17 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~x64-solaris ~x86-solaris"
18 IUSE="bzip2 directfb fbcon gpm ipv6 jpeg livecd lzma ssl suid svga tiff unicode X zlib"
19
20 GRAPHICS_DEPEND="media-libs/libpng:0="
21
22 RDEPEND=">=sys-libs/ncurses-5.7-r7
23         bzip2? ( app-arch/bzip2 )
24         directfb? (
25                 ${GRAPHICS_DEPEND}
26                 dev-libs/DirectFB
27                 )
28         fbcon? ( ${GRAPHICS_DEPEND} )
29         gpm? ( sys-libs/gpm )
30         jpeg? ( virtual/jpeg:0 )
31         livecd? (
32                 ${GRAPHICS_DEPEND}
33                 sys-libs/gpm
34                 virtual/jpeg:0
35                 )
36         lzma? ( app-arch/xz-utils )
37         ssl? ( dev-libs/openssl:0 )
38         svga? (
39                 ${GRAPHICS_DEPEND}
40                 media-libs/svgalib
41                 )
42         tiff? ( media-libs/tiff:0 )
43         X? (
44                 ${GRAPHICS_DEPEND}
45                 x11-libs/libXext
46                 )
47         zlib? ( sys-libs/zlib )"
48
49 DEPEND="${RDEPEND}
50         virtual/pkgconfig
51         fbcon? ( virtual/os-headers )
52         livecd? ( virtual/os-headers )"
53
54 REQUIRED_USE="!livecd? ( fbcon? ( gpm ) )
55         svga? ( suid )"
56
57 DOCS=( AUTHORS BRAILLE_HOWTO ChangeLog KEYS NEWS README SITES )
58
59 src_prepare() {
60         epatch "${WORKDIR}"/debian/patches/verify-ssl-certs-510417.diff
61
62         if use unicode; then
63                 pushd intl >/dev/null
64                 ./gen-intl || die
65                 ./synclang || die
66                 popd >/dev/null
67         fi
68
69         # error: conditional "am__fastdepCXX" was never defined (for eautoreconf)
70         sed -i \
71                 -e '/AC_PROG_CXX/s:dnl ::' \
72                 -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \
73                 configure.in || die #467020
74
75         # Upstream configure produced by broken autoconf-2.13. This also fixes
76         # toolchain detection.
77         eautoreconf #131440 and #103483#c23
78 }
79
80 src_configure() {
81         local myconf
82
83         if use livecd; then
84                 export ac_cv_lib_gpm_Gpm_Open=yes
85                 myconf+=' --with-fb --with-libjpeg'
86         else
87                 export ac_cv_lib_gpm_Gpm_Open=$(usex gpm)
88         fi
89
90         if use X || use fbcon || use directfb || use svga || use livecd; then
91                 myconf+=' --enable-graphics'
92         fi
93
94         econf \
95                 $(use_with ipv6) \
96                 $(use_with ssl) \
97                 $(use_with zlib) \
98                 $(use_with bzip2) \
99                 $(use_with lzma) \
100                 $(use_with svga svgalib) \
101                 $(use_with X x) \
102                 $(use_with fbcon fb) \
103                 $(use_with directfb) \
104                 $(use_with jpeg libjpeg) \
105                 $(use_with tiff libtiff) \
106                 ${myconf}
107 }
108
109 src_install() {
110         default
111
112         if use X; then
113                 newicon Links_logo.png links.png
114                 make_desktop_entry 'links -g %u' Links links 'Network;WebBrowser'
115                 local d="${ED}"/usr/share/applications
116                 echo 'MimeType=x-scheme-handler/http;' >> "${d}"/*.desktop
117                 use ssl && sed -i -e 's:x-scheme-handler/http;:&x-scheme-handler/https;:' \
118                         "${d}"/*.desktop
119         fi
120
121         dohtml doc/links_cal/*
122         use suid && fperms 4755 /usr/bin/links
123 }
124
125 pkg_postinst() {
126         use X && fdo-mime_desktop_database_update
127 }
128
129 pkg_postrm() {
130         use X && fdo-mime_desktop_database_update
131 }