source: net-libs/c-client/c-client-2007f-r4.ebuild @ 4dedeb6

Revision 4dedeb6, 4.2 KB checked in by Mario Fetka <mario.fetka@…>, 7 years ago (diff)

add correct libs to the compile

  • Property mode set to 100644
Line 
1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/net-libs/c-client/c-client-2007f-r4.ebuild,v 1.12 2012/12/30 16:37:05 armin76 Exp $
4
5EAPI=4
6
7inherit flag-o-matic eutils libtool toolchain-funcs multilib
8
9MY_PN=imap
10MY_P="${MY_PN}-${PV}"
11S=${WORKDIR}/${MY_P}
12
13CHAPPA_PL=115
14DESCRIPTION="UW IMAP c-client library"
15HOMEPAGE="http://www.washington.edu/imap/"
16SRC_URI="ftp://ftp.cac.washington.edu/imap/${MY_P}.tar.Z
17        chappa? ( mirror://gentoo/${P}-chappa-${CHAPPA_PL}-all.patch.gz )"
18
19LICENSE="Apache-2.0"
20SLOT="0"
21KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
22IUSE="doc +ipv6 kerberos kernel_linux kernel_FreeBSD pam ssl static-libs topal chappa"
23
24RDEPEND="ssl? ( dev-libs/openssl )
25        !net-mail/uw-imap
26        kerberos? ( virtual/krb5 )"
27DEPEND="${RDEPEND}
28        kernel_linux? ( pam? ( >=sys-libs/pam-0.72 ) )"
29
30src_prepare() {
31        # Tarball packed with bad file perms
32        chmod -R u+rwX,go-w .
33
34        # lots of things need -fPIC, including various platforms, and this library
35        # generally should be built with it anyway.
36        append-flags -fPIC
37
38        # Modifications so we can build it optimally and correctly
39        sed \
40                -e "s:BASECFLAGS=\".*\":BASECFLAGS=:g" \
41                -e 's:SSLDIR=/usr/local/ssl:SSLDIR=/usr:g' \
42                -e 's:SSLCERTS=$(SSLDIR)/certs:SSLCERTS=/etc/ssl/certs:g' \
43                -i src/osdep/unix/Makefile || die "Makefile sed fixing failed"
44
45        # Make the build system more multilib aware
46        sed \
47                -e "s:^SSLLIB=\$(SSLDIR)/lib:SSLLIB=\$(SSLDIR)/$(get_libdir):" \
48                -e "s:^AFSLIB=\$(AFSDIR)/lib:AFSLIB=\$(AFSDIR)/$(get_libdir):" \
49                -i src/osdep/unix/Makefile || die "Makefile sed fixing failed"
50
51        # Targets should use the Gentoo (ie linux) fs
52        sed -e '/^bsf:/,/^$/ s:ACTIVEFILE=.*:ACTIVEFILE=/var/lib/news/active:g' \
53                -i src/osdep/unix/Makefile || die "Makefile sex fixing failed for FreeBSD"
54
55        # Apply a patch to only build the stuff we need for c-client
56        epatch "${FILESDIR}"/${PN}-2006k_GENTOO_Makefile.patch
57
58        # Apply patch to add the compilation of a .so for PHP
59        # This was previously conditional, but is more widely useful.
60        epatch "${FILESDIR}"/${PN}-2006k_GENTOO_amd64-so-fix.patch
61
62        # heimdal
63        if has_version app-crypt/heimdal ; then
64                epatch "${FILESDIR}"/${PN}-2007e-heimdal.patch
65        fi
66
67        # Remove the pesky checks about SSL stuff
68        sed -e '/read.*exit/d' -i Makefile || die
69
70        # Respect LDFLAGS
71        epatch "${FILESDIR}"/${PN}-2007f-ldflags.patch
72        sed -e "s/CC=cc/CC=$(tc-getCC)/" \
73                -e "s/ARRC=ar/ARRC=$(tc-getAR)/" \
74                -e "s/RANLIB=ranlib/RANLIB=$(tc-getRANLIB)/" \
75                -i src/osdep/unix/Makefile || die "Respecting build flags"
76
77        use topal && epatch "${FILESDIR}/${P}-topal.patch"
78        use chappa && epatch "${DISTDIR}/${P}-chappa-${CHAPPA_PL}-all.patch.gz"
79
80        elibtoolize
81}
82
83src_compile() {
84        local mymake ipver ssltype target passwdtype
85        ipver='IP=4'
86        use ipv6 && ipver="IP=6" && touch ip6
87        use ssl && ssltype="unix" || ssltype="none"
88        if use kernel_linux ; then
89                use pam && target=lnp passwdtype=pam || target=lnx passwdtype=std
90        elif use kernel_FreeBSD ; then
91                target=bsf passwdtype=pam
92        fi
93        if use kerberos ; then
94                mymake="EXTRAAUTHENTICATORS=gss"
95                if has_version app-crypt/heimdal ; then
96                        EXTRALIBS="-lgssapi -lkrb5 -lhcrypto -lcom_err"
97                else
98                        EXTRALIBS="-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
99                fi
100        fi
101        # no parallel builds supported!
102        emake -j1 SSLTYPE=${ssltype} $target \
103                PASSWDTYPE=${passwdtype} ${ipver} ${mymake} \
104                EXTRACFLAGS="${CFLAGS}" \
105                EXTRALDFLAGS="${LDFLAGS}" \
106                EXTRALIBS="${EXTRALIBS}" \
107                GSSDIR=/usr
108}
109
110src_install() {
111        if use static-libs; then
112                # Library binary
113                dolib.a c-client/c-client.a
114                dosym c-client.a /usr/$(get_libdir)/libc-client.a
115        fi
116
117        # Now the shared library
118        dolib.so c-client/libc-client.so.1.0.0
119
120        dosym libc-client.so.1.0.0 /usr/$(get_libdir)/libc-client.so
121        dosym libc-client.so.1.0.0 /usr/$(get_libdir)/libc-client.so.1
122
123        # Headers
124        insinto /usr/include/imap
125        doins src/osdep/unix/*.h
126        doins src/c-client/*.h
127        doins c-client/linkage.h
128        doins c-client/linkage.c
129        doins c-client/osdep.h
130        if use ssl; then
131                echo "  ssl_onceonlyinit ();" >> "${D}"/usr/include/imap/linkage.c || die
132        fi
133        # Docs
134        dodoc README docs/*.txt docs/BUILD docs/CONFIG docs/RELNOTES docs/SSLBUILD
135        if use doc; then
136                docinto rfc
137                dodoc docs/rfc/*.txt
138                docinto draft
139                dodoc docs/draft/*
140        fi
141}
Note: See TracBrowser for help on using the repository browser.