Magellan Linux

Contents of /trunk/extras/dovecot/dovecot-1.2.10-r4.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5092 - (show annotations) (download)
Thu Mar 4 19:45:58 2010 UTC (14 years, 1 month ago) by niro
File size: 5944 byte(s)
-rev bump to -r4; some minor changes and disabled NO_HARDCODED_LDAP
1 # $Id$
2
3 PNAME="dovecot"
4 PVER="1.2.10"
5 PBUILD="r4"
6
7 PCATEGORIE="net-mail"
8 STATE="unstable"
9
10 #DESCRIPTION="Dovecot is an IMAP and POP3 server written with security primarily in mind."
11 HOMEPAGE="http://dovecot.org/"
12
13 SDEPEND=">= net-mail/mail-base-files-0.1
14 >= sys-libs/pam-1.1
15 >= sys-libs/libcap-2.17
16 >= dev-libs/openssl-0.9.8k
17 >= net-nds/openldap-2.4
18 >= dev-db/mysql5-5.1
19 >= dev-db/sqlite-3.6
20 >= dev-db/db-4.8"
21
22
23 SRCFILE="${PNAME}-${PVER}.tar.gz"
24 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
25
26 # set to 'yes' to disable hardcorded ldap
27 # this generates an extra ldap split-package too (very experimental!)
28 NO_HARDCODED_LDAP=no
29
30 # rc cvs revision
31 RC_CVS_REV=1.2
32
33 SPLIT_PACKAGES="${PNAME} ${PNAME}-mysql ${PNAME}-sqlite"
34 [[ ${NO_HARDCODED_LDAP} = yes ]] && SPLIT_PACKAGES+=" ${PNAME}-ldap"
35
36 sminclude mtools cleanutils
37
38 SRC_URI=(
39 http://dovecot.org/releases/${PVER%.*}/${SRCFILE}
40 mirror://${PNAME}/${SRCFILE}
41 mirror://${PNAME}/dovecot.rc-${RC_CVS_REV}
42 mirror://${PNAME}/${PNAME}-${PVER}-magellan-defaults.patch
43 mirror://${PNAME}/${PNAME}-${PVER}-magellan-defaults-maildir.patch
44 mirror://${PNAME}/${PNAME}-${PVER}-magellan-defaults-pam.patch
45 mirror://${PNAME}/${PNAME}-${PVER}-magellan-defaults-ipv4a6.patch
46 mirror://${PNAME}/${PNAME}-${PVER}-config-install.patch
47 )
48
49 UP2DATE="updatecmd ${HOMEPAGE}/download.html | grep -A3 'Stable' | grep 'Download' | sed 's:.*v\(.*\)\ sources.*:\1:'"
50
51 split_info_dovecot()
52 {
53 DESCRIPTION="Dovecot is an IMAP and POP3 server written with security primarily in mind."
54 DEPEND=">= net-mail/mail-base-files-0.1
55 >= sys-libs/pam-1.1
56 >= sys-libs/libcap-2.17
57 >= dev-libs/openssl-0.9.8k
58 >= dev-db/db-4.8"
59
60 if [[ ${NO_HARDCODED_LDAP} != yes ]]
61 then
62 DEPEND="${DEPEND}
63 >= net-nds/openldap-2.4"
64 fi
65
66 preinstall()
67 {
68 # adding proftpd user
69 ${MLIBDIR}/mgroupadd -o "-g 97" dovecot
70 ${MLIBDIR}/museradd -o "-u 97 -g dovecot -d /dev/null -s /bin/false" dovecot
71 }
72
73 postinstall()
74 {
75 # generate a self-signed ssl-cert
76 if [[ ! -f /etc/ssl/certs/dovecot.pem ]]
77 then
78 echo
79 echo "You need to generate a certificate to run this daemon."
80 echo "Just run: 'openssl-make-certs dovecot'."
81 echo
82 fi
83
84 mstartservice dovecot
85 }
86
87 postremove()
88 {
89 mstopservice dovecot
90 }
91 }
92
93 split_info_dovecot-mysql()
94 {
95 DESCRIPTION="Plugin to add MySQL support to the Dovecot Mail server."
96 DEPEND="== net-mail/dovecot-${PVER}
97 >= dev-db/mysql5-5.1"
98 }
99
100 split_info_dovecot-sqlite()
101 {
102 DESCRIPTION="Plugin to add SQLite support to the Dovecot Mail server."
103 DEPEND="== net-mail/dovecot-${PVER}
104 >= dev-db/sqlite-3.6"
105 }
106
107 if [[ ${NO_HARDCODED_LDAP} = yes ]]
108 then
109 split_info_dovecot-ldap()
110 {
111 DESCRIPTION="Plugin to add LDAP support to the Dovecot Mail server."
112 DEPEND="== net-mail/dovecot-${PVER}
113 >= net-nds/openldap-2.4"
114 }
115 fi
116
117 src_prepare()
118 {
119 munpack ${SRCFILE} || die
120 cd ${SRCDIR}
121
122 # apply our default settings
123 mpatch ${PNAME}-${PVER}-magellan-defaults.patch || die
124
125 # enable maildir as default
126 mpatch ${PNAME}-${PVER}-magellan-defaults-maildir.patch || die
127
128 # we're using pam files (imap and pop3) provided by mailbase
129 mpatch ${PNAME}-${PVER}-magellan-defaults-pam.patch || die
130
131 # use ipv4 and ipv6 support
132 mpatch ${PNAME}-${PVER}-magellan-defaults-ipv4a6.patch || die
133
134 # install only devcot.conf and not any examples to /etc/dovecot
135 mpatch ${PNAME}-${PVER}-config-install.patch || die
136 }
137
138 src_compile()
139 {
140 cd ${SRCDIR}
141
142 mconfigure \
143 --sysconfdir=/etc/dovecot \
144 --libexecdir=/usr/$(mlibdir)/dovecot \
145 --with-moduledir=/usr/$(mlibdir)/dovecot \
146 --localstatedir=/var \
147 --enable-header-install \
148 --enable-ipv6 \
149 --disable-debug \
150 --disable-static \
151 --with-ioloop=best \
152 --with-poll=best \
153 --with-libcap \
154 --with-ssl=openssl \
155 --with-ssldir=/etc/ssl \
156 --with-ldap=plugin \
157 --with-sql=plugin \
158 --with-sql-drivers \
159 --with-mysql \
160 --with-sqlite \
161 --with-db \
162 --with-pam \
163 || die
164
165 # build dovecot normally
166 mmake || die
167
168 if [[ ${NO_HARDCODED_LDAP} = yes ]]
169 then
170 # save all ldap plugins linked against -lldap
171 cp src/auth/.libs/libauthdb_ldap.so libauthdb_ldap.so.no-ldap || die
172
173 # then rebuild dovecot without hardcoded ldap
174 make clean || die
175 mmake LIBS='-lrt' LDAP_LIBS='' || die
176 fi
177 }
178
179 src_install_dovecot()
180 {
181 cd ${SRCDIR}
182 mmake DESTDIR=${BINDIR} install || die
183
184 # install our initscript
185 minstallrc dovecot.rc-${RC_CVS_REV} dovecot || die
186
187 # remove unwanted docs
188 rm -rf ${BINDIR}/usr/share/doc/dovecot || die
189
190 # needed directories
191 mkeepdir /var/run/dovecot/login || die
192 mchown root:dovecot /var/run/dovecot/login || die
193 mchmod 0700 /var/run/dovecot/login || die
194
195 minstalldocs AUTHORS ChangeLog COPYING* NEWS README TODO || die
196 minstalldocs dovecot-example.conf || die
197 minstalldocs doc/dovecot-db-example.conf || die
198 minstalldocs doc/dovecot-sql-example.conf || die
199 minstalldocs doc/dovecot-ldap-example.conf || die
200 }
201
202 src_install_dovecot-mysql()
203 {
204 cd ${SRCDIR}
205 mmake DESTDIR=${BINDIR} install || die
206
207 # first keep the whole modulesdir
208 zapmost ${BINDIR} usr/$(mlibdir)/dovecot || die
209 # now seperate all modules
210 zapmost ${BINDIR}/usr/$(mlibdir)/dovecot auth/libdriver_mysql.* dict/libdriver_mysql.* sql/libdriver_mysql.* || die
211 }
212
213 src_install_dovecot-sqlite()
214 {
215 cd ${SRCDIR}
216 mmake DESTDIR=${BINDIR} install || die
217
218 # first keep the whole modulesdir
219 zapmost ${BINDIR} usr/$(mlibdir)/dovecot || die
220 # now seperate all modules
221 zapmost ${BINDIR}/usr/$(mlibdir)/dovecot auth/libdriver_sqlite.* dict/libdriver_sqlite.* sql/libdriver_sqlite.* || die
222 }
223
224 if [[ ${NO_HARDCODED_LDAP} = yes ]]
225 then
226 src_install_dovecot-ldap()
227 {
228 cd ${SRCDIR}
229 mmake DESTDIR=${BINDIR} install || die
230
231 # first keep the whole modulesdir
232 zapmost ${BINDIR} usr/$(mlibdir)/dovecot || die
233 # now seperate all modules
234 zapmost ${BINDIR}/usr/$(mlibdir)/dovecot auth/libauthdb_ldap.* || die
235
236 # install saved ldap plugins linked against -lldap
237 minstallexec libauthdb_ldap.so.no-ldap /usr/$(mlibdir)/dovecot/auth/libauthdb_ldap.so || die
238 }
239 fi

Properties

Name Value
svn:keywords Id