summaryrefslogtreecommitdiff
blob: a9625d6e1db68136b3e5d6e87a3f154e5e34bcf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/net-mail/cyrus-imap-admin/cyrus-imap-admin-2.1.10.ebuild,v 1.2 2002/12/09 04:33:13 manson Exp $

inherit perl-module

S=${WORKDIR}/cyrus-imapd-${PV}

DESCRIPTION="Utilities to administer a Cyrus IMAP Server (includes Perl modules)"
HOMEPAGE="http://asg.web.cmu.edu/cyrus/imapd/"
SRC_URI="ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-imapd-${PV}.tar.gz"

LICENSE="as-is"
SLOT="0"
KEYWORDS="~x86 -ppc -sparc "

PROVIDE="virtual/imapd"
DEPEND="virtual/glibc
	afs? ( >=net-fs/openafs-1.2.2 )
	snmp? ( >=net-analyzer/ucd-snmp-4.2.3 )
	ssl? ( >=dev-libs/openssl-0.9.6 )
    	>=sys-devel/perl-5.6.1
	kerberos? ( >=app-crypt/krb5-1.2.5 )
	>=sys-libs/db-3.2
	>=sys-libs/pam-0.75
	>=dev-libs/cyrus-sasl-2.1.2
	>=sys-apps/tcp-wrappers-7.6
	dev-perl/ExtUtils-MakeMaker"

src_unpack() {

	unpack ${A}
	cd ${S}

	patch < ${FILESDIR}/config.diff || die "patch failed"

        # Kerberos libraries have changed
        cp configure configure.orig
        sed -e "s:-ldes:-ldes425:" \
                < configure.orig > configure || die "patch failed"

        # libsieve buffer overflow fix - bug #11537
        patch -p1 < ${FILESDIR}/libsieve-overflow.diff || die "patch failed"

        # imap buffer overflow fix - bug #11537
        patch -p1 < ${FILESDIR}/imap-overflow.diff || die "patch failed"

}

src_compile() {

	local myconf
	
	use afs && myconf="--with-afs" \
		|| myconf="--without-afs"

	use snmp && myconf="${myconf} --with-ucdsnmp=/usr" \
		|| myconf="${myconf} --without-ucdsnmp"

	use ssl && myconf="${myconf} --with-openssl=/usr" \
		|| myconf="${myconf} --without-openssl"

	use kerberos && myconf="${myconf} --with-krb --with-auth=krb" \
		|| myconf="${myconf} --without-krb --with-auth=unix"

	econf \
		--enable-listext \
		--with-cyrus-group=mail \
		--enable-netscapehack \
		--with-com_err=yes \
		--with-perl=/usr/bin/perl \
		--enable-cyradm \
		${myconf} || die "bad ./configure"

	# make depends break with -f... in CFLAGS
	make depend CFLAGS="" || die "make depend problem"

	cd ${S}/lib
	make || die "compile problem"
	cd ${S}/perl
	make || die "compile problem"

}

src_install () {

	echo "Installation of perl-modules"
	export DESTDIR=${D}
	cd ${S}/perl/imap
		perl-module_src_prep
                perl-module_src_compile
                perl-module_src_install
        cd ${S}/perl/sieve
		perl-module_src_prep
                perl-module_src_compile
                perl-module_src_test
                perl-module_src_install

}