Magellan Linux

Annotation of /trunk/extras/dovecot/dovecot-1.2.10-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id