]> Pileus Git - ~andy/sunrise/blob - net-mail/dbmail/dbmail-2.2.2-r1.ebuild
net-mail/dbmail: Added patch to fix an issue with postgresql: http://www.gossamer...
[~andy/sunrise] / net-mail / dbmail / dbmail-2.2.2-r1.ebuild
1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils
6
7 DESCRIPTION="A mail storage and retrieval daemon that uses MySQL or PostgreSQL as its data store"
8 HOMEPAGE="http://www.dbmail.org/"
9 SRC_URI="http://www.dbmail.org/download/2.2/${P}.tar.gz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~x86"
14 IUSE="ldap mysql postgres sieve sqlite3 ssl static"
15
16 DEPEND="ssl? ( dev-libs/openssl )
17         postgres? ( >=dev-db/postgresql-7.4 )
18         mysql? ( >=virtual/mysql-4.1 )
19         sqlite3? ( >=dev-db/sqlite-3.0 )
20         sieve? ( >=mail-filter/libsieve-2.2.1 )
21         app-text/asciidoc
22         app-text/xmlto
23         sys-libs/zlib
24         >=dev-libs/gmime-2.1
25         >=dev-libs/glib-2.8"
26
27 pkg_setup() {
28         enewgroup dbmail
29         enewuser dbmail -1 -1  /var/lib/dbmail dbmail
30 }
31
32 src_unpack() {
33         unpack ${A}
34         cd "${S}"
35
36         epatch "${FILESDIR}/${P}-removeversion.patch"
37         epatch "${FILESDIR}/${P}-messages.patch"
38 }
39
40 src_compile() {
41         use sqlite3 && myconf="--with-sqlite"
42         use ldap && myconf=${myconf}" --with-auth-ldap"
43
44         econf \
45                 --sysconfdir=/etc/dbmail \
46                 ${myconf} \
47                 $(use_enable static) \
48                 $(use_with sieve) \
49                 $(use_with ssl) \
50                 $(use_with postgres) \
51                 $(use_with mysql) || die "econf failed"
52         emake || die "emake failed"
53 }
54
55 src_install() {
56         emake DESTDIR="${D}" install || die "emake install failed"
57
58         dodoc AUTHORS BUGS UPGRADING ChangeLog README* INSTALL* NEWS THANKS
59         dodoc sql/mysql/*
60         dodoc sql/postgresql/*
61         dodoc sql/sqlite/*
62
63         sed -i -e "s:nobody:dbmail:" dbmail.conf
64         sed -i -e "s:nogroup:dbmail:" dbmail.conf
65         insinto /etc/dbmail
66         newins dbmail.conf dbmail.conf.dist
67
68         newinitd "${FILESDIR}"/dbmail-imapd.initd dbmail-imapd
69         newinitd "${FILESDIR}"/dbmail-lmtpd.initd dbmail-lmtpd
70         newinitd "${FILESDIR}"/dbmail-pop3d.initd dbmail-pop3d
71         use sieve && newinitd "${FILESDIR}"/dbmail-timsieved.initd dbmail-timsieved
72
73         dobin contrib/mailbox2dbmail/mailbox2dbmail
74         doman contrib/mailbox2dbmail/mailbox2dbmail.1
75
76         keepdir /var/lib/dbmail
77         fperms 750 /var/lib/dbmail
78
79 }
80
81 pkg_postinst() {
82         elog "If you update from 2.1.7 please apply 2_1_7-2_2_0.<YOUR_DB>.gz"
83         elog "to your dbmail database and run dbmail-util -by ."
84         einfo
85         elog "Please read /usr/share/doc/${PF}/INSTALL.gz"
86         elog "for remaining instructions on setting up dbmail users and "
87         elog "for finishing configuration to connect to your MTA and "
88         elog "to connect to your db."
89         einfo
90         elog "Database schemes can be found in /usr/share/doc/${PF}/"
91         elog "You will also want to follow the installation instructions"
92         elog "on setting up the maintenance program to delete old messages."
93         elog "Don't forget to edit /etc/dbmail/dbmail.conf as well. :)"
94         elog ">>> --- For maintenance ---"
95         elog ">>> add this to crontab: 0 3 * * * /usr/bin/dbmail-util -cpdy >/dev/null 2>&1 "
96 }