Ticket #234: gnutls-2.8.1.ebuild

File gnutls-2.8.1.ebuild, 2.7 KB (added by arussello, 3 years ago)

New ebuild with cross compile patch for gnutls 2.8.1 and examples keyword support

Line 
1# Copyright 1999-2009 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/net-libs/gnutls/gnutls-2.8.0.ebuild,v 1.1 2009/05/28 17:33:30 arfrever Exp $
4
5EAPI="2"
6
7inherit autotools libtool toolchain-funcs
8
9DESCRIPTION="A TLS 1.0 and SSL 3.0 implementation for the GNU project"
10HOMEPAGE="http://www.gnutls.org/"
11
12if [[ "${PV}" == *pre* ]]; then
13        SRC_URI="http://daily.josefsson.org/${P%.*}/${P%.*}-${PV#*pre}.tar.gz"
14else
15        MINOR_VERSION="${PV#*.}"
16        MINOR_VERSION="${MINOR_VERSION%.*}"
17        if [[ $((MINOR_VERSION % 2)) == 0 ]]; then
18                #SRC_URI="ftp://ftp.gnu.org/pub/gnu/${PN}/${P}.tar.bz2"
19                SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
20        else
21                SRC_URI="ftp://alpha.gnu.org/gnu/${PN}/${P}.tar.bz2"
22        fi
23        unset MINOR_VERSION
24fi
25
26# GPL-3 for the gnutls-extras library and LGPL for the gnutls library.
27LICENSE="LGPL-2.1 GPL-3"
28SLOT="0"
29KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
30IUSE="bindist +cxx doc guile lzo nls zlib"
31
32RDEPEND="dev-libs/libgpg-error
33        >=dev-libs/libgcrypt-1.4.0
34        >=dev-libs/libtasn1-0.3.4
35        nls? ( virtual/libintl )
36        guile? ( dev-scheme/guile[networking] )
37        zlib? ( >=sys-libs/zlib-1.1 )
38        !bindist? ( lzo? ( >=dev-libs/lzo-2 ) )"
39DEPEND="${RDEPEND}
40        sys-devel/libtool
41        doc? ( dev-util/gtk-doc )
42        nls? ( sys-devel/gettext )"
43
44S="${WORKDIR}/${P%_pre*}"
45
46pkg_setup() {
47        if use lzo && use bindist; then
48                ewarn "lzo support was disabled for binary distribution of gnutls"
49                ewarn "due to licensing issues. See Bug 202381 for details."
50                epause 5
51        fi
52}
53
54src_prepare() {
55        # Make gnutls cross-compile by removing the libdir from the search path
56        epatch "${FILESDIR}/${P}-cross-configure.patch"
57        echo "Patched build"
58
59        local dir
60        for dir in m4 lib/m4 libextra/m4 ; do
61                rm -f "${dir}/lt"* "${dir}/libtool.m4"
62        done
63        find . -name ltmain.sh -exec rm {} \;
64        for dir in . lib libextra ; do
65                pushd "${dir}" > /dev/null
66                eautoreconf
67                popd > /dev/null
68        done
69
70        elibtoolize # for sane .so versioning on FreeBSD
71}
72
73src_configure() {
74        local myconf
75        use bindist && myconf="--without-lzo" || myconf="$(use_with lzo)"
76
77        if tc-is-cross-compiler ; then
78                myconf="${myconf} \
79                        --without-libgcrypt-prefix \
80                        --without-libtasn1-prefix \
81                        --without-libreadline-prefix"
82        fi
83
84        econf  \
85                $(use_enable cxx) \
86                $(use_enable doc gtk-doc) \
87                $(use_enable guile) \
88                $(use_enable nls) \
89                $(use_with zlib) \
90                ${myconf}
91}
92
93src_install() {
94        emake DESTDIR="${D}" install || die "emake install failed"
95
96        dodoc AUTHORS ChangeLog NEWS README THANKS doc/TODO
97
98        if use doc ; then
99                dodoc doc/README.autoconf doc/tex/gnutls.ps
100                docinto examples
101        fi
102
103        if use examples; then
104                docinto examples
105                dodoc doc/examples/*.c
106        fi
107
108}