/[gentoo-x86]/net-mail/dbmail/dbmail-3.0.2.ebuild
Gentoo

Contents of /net-mail/dbmail/dbmail-3.0.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Dec 4 11:10:35 2012 UTC (2 years ago) by ago
Branch: MAIN
Changes since 1.2: +2 -2 lines
Stable for x86, wrt bug #439056

(Portage version: 2.1.11.31/cvs/Linux x86_64, unsigned Manifest commit)

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-mail/dbmail/dbmail-3.0.2.ebuild,v 1.2 2012/10/24 09:58:14 ago Exp $
4
5 EAPI="4"
6 inherit eutils multilib python versionator
7
8 DESCRIPTION="DBMail is an open-source project that enables storage of mail messages in a relational database."
9 HOMEPAGE="http://www.dbmail.org/"
10 SRC_URI="http://www.dbmail.org/download/$(get_version_component_range 1-2)/${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 x86"
15 IUSE="ldap sieve +sqlite ssl static python"
16
17 DEPEND="dev-db/libzdb
18 sieve? ( >=mail-filter/libsieve-2.2.1 )
19 ldap? ( >=net-nds/openldap-2.3.33 )
20 python? ( net-zope/zope-interface )
21 app-text/asciidoc
22 app-text/xmlto
23 app-crypt/mhash
24 sys-libs/zlib
25 >=dev-libs/gmime-2.4.6:2.4
26 >=dev-libs/glib-2.16
27 dev-libs/libevent
28 ssl? ( dev-libs/openssl )"
29 #asciidoc and xmlto needed?
30 RDEPEND="${DEPEND}"
31
32 pkg_setup() {
33 python_pkg_setup
34 enewgroup dbmail
35 enewuser dbmail -1 -1 /var/lib/dbmail dbmail
36 }
37
38 src_configure() {
39 local myconf=""
40 use ldap && myconf=${myconf}" --with-auth-ldap"
41
42 econf \
43 --sysconfdir=/etc/dbmail \
44 $(use_enable static) \
45 $(use_with sieve) \
46 ${myconf}
47 }
48
49 src_compile() {
50 emake || die "emake failed"
51 }
52
53 src_install() {
54 emake DESTDIR="${D}" install || die "emake install failed"
55
56 dodoc AUTHORS BUGS ChangeLog README* INSTALL NEWS THANKS UPGRADING
57
58 # docinto sql/mysql
59 # dodoc sql/mysql/*
60 # docinto sql/postgresql
61 # dodoc sql/postgresql/*
62 # docinto sql/sqlite
63 # dodoc sql/sqlite/*
64 # docinto test-scripts
65 # dodoc test-scripts/*
66 # docinto contrib/sql2sql
67 # dodoc contrib/sql2sql/*
68 # docinto contrib/mailbox2dbmail
69 # dodoc contrib/mailbox2dbmail/README
70 # docinto contrib
71 # dodoc contrib/dbmailclient.php
72 dodoc -r sql
73 dodoc -r test-scripts
74 dodoc -r contrib
75 ## TODO: install other contrib stuff
76
77 sed -i -e "s:nobody:dbmail:" dbmail.conf
78 sed -i -e "s:nogroup:dbmail:" dbmail.conf
79 sed -i -e "s:/var/run:/var/run/dbmail:" dbmail.conf
80 #sed -i -e "s:#library_directory:library_directory:" dbmail.conf
81
82 insinto /etc/dbmail
83 newins dbmail.conf dbmail.conf.dist
84
85 # change config path to our default and use the conf.d and init.d files from the contrib dir
86 sed -i -e "s:/etc/dbmail.conf:/etc/dbmail/dbmail.conf:" contrib/startup-scripts/gentoo/init.d-dbmail
87 sed -i -e "s:exit 0:return 1:" contrib/startup-scripts/gentoo/init.d-dbmail
88 sed -i -e "s:/var/run:/var/run/dbmail:" contrib/startup-scripts/gentoo/init.d-dbmail
89 newconfd contrib/startup-scripts/gentoo/conf.d-dbmail dbmail
90 newinitd contrib/startup-scripts/gentoo/init.d-dbmail dbmail
91
92 dobin contrib/mailbox2dbmail/mailbox2dbmail
93 doman contrib/mailbox2dbmail/mailbox2dbmail.1
94 #doman man/*.{1,5,8}
95
96 # ldap schema
97 if use ldap; then
98 insinto /etc/openldap/schema
99 doins "${S}/dbmail.schema"
100 fi
101
102 if use python; then
103 insinto $(python_get_sitedir)/dbmail
104 doins python/*.py
105 insinto $(python_get_sitedir)/dbmail/app
106 doins python/app/*.py
107 insinto $(python_get_sitedir)/dbmail/bin
108 doins python/bin/*.py
109 insinto $(python_get_sitedir)/dbmail/lib
110 doins python/lib/*.py
111 insinto $(python_get_sitedir)/dbmail/tests
112 doins python/tests/*.py
113 fi
114
115 keepdir /var/lib/dbmail
116 fperms 750 /var/lib/dbmail
117 fowners dbmail:dbmail /var/lib/dbmail
118 keepdir /var/run/dbmail
119 fowners dbmail:dbmail /var/run/dbmail
120 }
121
122 pkg_postinst() {
123 if use python; then
124 python_mod_optimize dbmail
125 fi
126 elog "Please read the INSTALL file in /usr/share/doc/${PF}/"
127 elog "for remaining instructions on setting up dbmail users and "
128 elog "for finishing configuration to connect to your MTA and "
129 elog "to connect to your db."
130 echo
131 elog "DBMail requires either SQLite, PostgreSQL or MySQL."
132 elog "Database schemes can be found in /usr/share/doc/${PF}/"
133 elog "You will also want to follow the installation instructions"
134 elog "on setting up the maintenance program to delete old messages."
135 elog "Don't forget to edit /etc/dbmail/dbmail.conf as well."
136 echo
137 elog "For regular maintenance, add this to crontab:"
138 elog "0 3 * * * /usr/bin/dbmail-util -cpdy >/dev/null 2>&1"
139 echo
140 elog "Please make sure to run etc-update."
141 elog "If you get an error message about plugins not found"
142 elog "please add the library_directory configuration switch to"
143 elog "dbmail.conf and set it to the correct path"
144 elog "(usually /usr/lib/dbmail or /usr/lib64/dbmail on amd64)"
145 elog "A sample can be found in dbmail.conf.dist after etc-update."
146 echo
147 elog "We are now using the init script from upstream."
148 elog "Please edit /etc/conf.d/dbmail to set which services to start"
149 elog "and delete /etc/init.d/dbmail-* when you are done. (don't"
150 elog "forget to rc-update del dbmail-* first)"
151 echo
152 elog "Changed pid directory to /var/run/dbmail (see"
153 elog "http://www.dbmail.org/mantis/view.php?id=949 for details)"
154 echo
155 }
156
157 pkg_postrm() {
158 python_mod_cleanup dbmail
159 }

  ViewVC Help
Powered by ViewVC 1.1.20