]> git.pld-linux.org Git - packages/courier-imap.git/blob - courier-imap.spec
- pass sendmail path; rel 3
[packages/courier-imap.git] / courier-imap.spec
1 # TODO:
2 # - put imap-ssl and pop3-ssl to separate packages - some want to have
3 #   ssl-only system (or non-ssl only system)
4 #   see also http://thread.gmane.org/gmane.linux.pld.devel.english/2509/focus=2509
5 #
6 %bcond_with     toplevel        # Allow toplevel folders. More info: http://www.ricky-chan.co.uk/courier/
7 #
8 Summary:        Courier-IMAP server
9 Summary(pl):    Serwer Courier-IMAP
10 Name:           courier-imap
11 Version:        4.1.1
12 Release:        3
13 License:        GPL
14 Group:          Networking/Daemons
15 Source0:        http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
16 # Source0-md5:  f423a609d9cce0dcf193cac64eb4cbdd
17 Source1:        %{name}.init
18 Source2:        %{name}-ssl.init
19 Source3:        %{name}-pop3.init
20 Source4:        %{name}-pop3-ssl.init
21 Source5:        %{name}.pamd
22 Source6:        %{name}-pop3.pamd
23 Patch0:         %{name}-dirs.patch
24 Patch1:         %{name}-certsdir.patch
25 Patch2:         %{name}-maildir.patch
26 Patch3:         %{name}-toplevel.patch
27 Patch4:         %{name}-drop-makedat.patch
28 URL:            http://www.courier-mta.org/imap/
29 BuildRequires:  autoconf >= 2.54
30 BuildRequires:  automake
31 BuildRequires:  courier-authlib-devel >= 0.57
32 BuildRequires:  db-devel
33 BuildRequires:  fam-devel
34 BuildRequires:  libstdc++-devel
35 BuildRequires:  openssl-devel >= 0.9.7d
36 BuildRequires:  procps
37 BuildRequires:  rpmbuild(macros) >= 1.268
38 BuildRequires:  sed >= 4.0
39 BuildRequires:  sysconftool
40 Requires(post,preun):   /sbin/chkconfig
41 Requires:       %{name}-common = %{version}-%{release}
42 Requires:       /sbin/chkconfig
43 Requires:       pam >= 0.79.0
44 Requires:       rc-scripts
45 Provides:       imapdaemon
46 Obsoletes:      imapdaemon
47 Conflicts:      cyrus-imapd
48 Conflicts:      imap
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %define         _libexecdir     /usr/%{_lib}/courier-imap
52 %define         _sysconfdir     /etc/courier-imap
53 %define         _certsdir       %{_sysconfdir}/certs
54 %define         _localstatedir  /var/spool/courier-imap
55
56 %description
57 Courier-IMAP is an IMAP server for Maildir mailboxes.
58
59 %description -l pl
60 Courier-IMAP jest serwerem IMAP dla skrzynek pocztowych Maildir.
61
62 %package common
63 Summary:        Common files for imap and pop3 daemons
64 Summary(pl):    Pliki wspólne dla serwerów imap i pop3
65 Group:          Networking/Daemons
66 Requires(post,preun):   /sbin/chkconfig
67 Requires:       /sbin/chkconfig
68 Requires:       courier-authlib
69 Requires:       procps
70 Requires:       rc-scripts
71
72 %description common
73 Common files for imap and pop3 daemons.
74
75 %description common -l pl
76 Pliki wspólne dla serwerów imap i pop3.
77
78 %package deliverquota
79 Summary:        Deliver to a Maildir with a quota
80 Summary(pl):    Obs³uga quoty przy dostarczaniu poczty do skrzynek Maildir
81 Group:          Networking/Daemons
82
83 %description deliverquota
84 deliverquota is a temporary hack to implement E-mail delivery to a
85 Maildir with a software-imposed quota.
86
87 %description deliverquota -l pl
88 deliverquota jest tymczasowym rozwi±zaniem implementuj±cym
89 dostarczanie e-maili do skrzynek Maildir z programowo narzucon± quot±.
90
91 %package maildirmake
92 Summary:        Tool for making mail folders in Maildir format
93 Summary(pl):    Narzêdzie do tworzenia folderów w formacie Maildir
94 Group:          Networking/Daemons
95 Conflicts:      qmail-maildirmake
96
97 %description maildirmake
98 Maildirmake is a tool for making mail folders in Maildir format.
99
100 %description maildirmake -l pl
101 Maildirmake jest narzêdziem do tworzenia folderów pocztowych w
102 formacie Maildir.
103
104 %package pop3
105 Summary:        Courier-IMAP POP3 Server
106 Summary(pl):    Serwer Courier-IMAP POP3
107 Group:          Networking/Daemons
108 Requires:       %{name}-common = %{version}-%{release}
109 Requires:       pam >= 0.77.3
110 Provides:       pop3daemon
111 Obsoletes:      pop3daemon
112 Conflicts:      cyrus-imapd
113 Conflicts:      imap-pop3
114 Conflicts:      solid-pop3d
115 Conflicts:      tpop3d
116
117 %description pop3
118 Courier-IMAP POP3 is an POP3 server for Maildir mailboxes.
119
120 %description pop3 -l pl
121 Courier-IMAP POP3 jest serwerem POP3 dla skrzynek pocztowych Maildir.
122
123 %prep
124 %setup -q
125 %patch0 -p1
126 %patch1 -p1
127 %patch2 -p1
128 %if %{with toplevel}
129 %patch3 -p1
130 %endif
131 %patch4 -p1
132
133 install %{SOURCE1} courier-imap.in
134 install %{SOURCE2} courier-imap-ssl.in
135 install %{SOURCE3} courier-pop3.in
136 install %{SOURCE4} courier-pop3-ssl.in
137 rm -f makedat/configure.in
138
139 %build
140
141 # Change Makefile.am files and force recreate Makefile.in's.
142 find -type f -a '(' -name configure.in -o -name configure.ac ')' | while read FILE; do
143         cd "$(dirname "$FILE")"
144
145         if [ -f Makefile.am ]; then
146                 %{__sed} -i -e '/_[L]DFLAGS=-static/d' Makefile.am
147         fi
148
149         %{__libtoolize}
150         %{__aclocal}
151         %{__autoconf}
152         %{__autoheader}
153         %{__automake}
154
155         cd -
156 done
157
158 %configure \
159         --with-db=db \
160         --enable-unicode \
161         --with-authchangepwdir=/var/tmp \
162         --with-certsdir=%{_certsdir} \
163         --with-mailer=/usr/lib/sendmail
164
165 %{__make}
166
167 %install
168 rm -rf $RPM_BUILD_ROOT
169 install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
170
171 %{__make} -j1 install \
172         DESTDIR=$RPM_BUILD_ROOT
173
174 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
175 install courier-imap-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap-ssl
176 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
177 install courier-pop3-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3-ssl
178 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/imap
179 install %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/pop3
180
181 rm -rf $RPM_BUILD_ROOT%{_sbindir}/mk*cert
182
183 install imap/README README.imap
184 install imap/ChangeLog ChangeLog
185 install maildir/README.maildirquota.txt README.maildirquota
186
187 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert $RPM_BUILD_ROOT%{_sbindir}
188
189 install tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
190 install imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
191
192 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
193 touch $RPM_BUILD_ROOT%{_sysconfdir}/shared/index
194
195 # make config files
196 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
197
198 # set yes to start imapd and pop3d
199 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
200 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
201
202 # remove unpackaged files
203 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
204
205 %clean
206 rm -rf $RPM_BUILD_ROOT
207
208 %post
209 /sbin/chkconfig --add courier-imap
210 /sbin/chkconfig --add courier-imap-ssl
211 %service courier-imap restart "courier-imap daemon"
212 %service courier-imap-ssl restart "courier-imap-ssl daemon"
213
214 %preun
215 if [ "$1" = "0" ]; then
216         %service courier-imap stop
217         /sbin/chkconfig --del courier-imap
218 fi
219
220 if [ "$1" = "0" ]; then
221         %service courier-imap-ssl stop
222         /sbin/chkconfig --del courier-imap-ssl
223 fi
224
225
226 %triggerin -- %{name} < 3.0.5
227 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
228         echo
229         echo imapd.pem has been moved automatically to %{_certsdir}
230         echo
231         mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
232 fi
233 if [ -f /etc/sysconfig/courier-imap ]; then
234         . /etc/sysconfig/courier-imap
235         for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
236         do
237                 eval opt2=\$$opt
238                 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd
239                 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd-ssl
240         done
241         sed -i s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ %{_sysconfdir}/imapd-ssl
242         sed -i s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ %{_sysconfdir}/imapd-ssl
243         sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd-ssl
244         sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd
245         echo
246         echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
247         echo please look at them
248         echo
249 fi
250 %service -q courier-imap restart
251
252 %triggerin -- %{name} < 3.0.6
253 . %{_sysconfdir}/imapd-ssl
254 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
255         sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/imapd-ssl
256 fi
257
258 %triggerin -n %{name}-common -- %{name}-userdb
259 echo
260 echo courier-imap-userdb is obsolete
261 echo install courier-authlib-userdb package
262 echo
263
264 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
265 /sbin/chkconfig --del authdaemon
266 if [ -f /var/lock/subsys/authdaemon ]; then
267         kill `cat /var/lib/authdaemon/pid`
268         rm -f /var/lock/subsys/authdaemon
269 fi
270 if [ -f /etc/sysconfig/authdaemon ]; then
271         . /etc/sysconfig/authdaemon
272         sed -i s/^version.*/version=authdaemond.$METHOD/ %{_sysconfdir}/authdaemonrc
273 fi
274 echo
275 echo Changes to version 3.0.5 :
276 echo - config files has been splited and moved to %{_sysconfdir}
277 echo - certificates directory has changed to %{_certsdir}
278 echo
279
280 %post pop3
281 /sbin/chkconfig --add courier-pop3
282 /sbin/chkconfig --add courier-pop3-ssl
283 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
284 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
285         /sbin/service courier-imap-pop3 stop >&2
286         /sbin/service courier-pop3 start >&2
287 else
288         %service courier-pop3 restart "courier-pop3 daemon"
289 fi
290 %service courier-pop3-ssl restart "courier-pop3-ssl daemon"
291
292 %preun pop3
293 if [ "$1" = "0" ]; then
294         %service courier-pop3 stop
295         /sbin/chkconfig --del courier-pop3
296         %service courier-pop3-ssl stop
297         /sbin/chkconfig --del courier-pop3-ssl
298 fi
299
300 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
301 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
302         echo
303         echo pop3d.pem has been moved automatically to %{_certsdir}
304         echo
305         mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
306 fi
307 if [ -f /etc/sysconfig/courier-pop3 ]; then
308         . /etc/sysconfig/courier-pop3
309         for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
310         do
311                 eval opt2=\$$opt
312                 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d
313                 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d-ssl
314         done
315         sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d-ssl
316         sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d
317         echo
318         echo POP3D config file has been rewriten to %{_sysconfdir}/{pop3d,pop3d-ssl}
319         echo please look at them
320         echo
321 fi
322 %service courier-pop3 restart
323
324 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
325 . %{_sysconfdir}/pop3d-ssl
326 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
327         sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/pop3d-ssl
328 fi
329
330 %files
331 %defattr(644,root,root,755)
332 %doc maildir/README.sharedfolders.txt imap/README.proxy tcpd/README.couriertls
333 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/imap
334 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
335 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd
336 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd-ssl
337 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd.cnf
338 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
339 %attr(754,root,root) /etc/rc.d/init.d/courier-imap-ssl
340 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
341 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
342 %attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/shared/index
343 %attr(755,root,root) %{_bindir}/imapd
344 %attr(755,root,root) %{_bindir}/maildiracl
345 %attr(755,root,root) %{_bindir}/maildirkw
346 %attr(755,root,root) %{_sbindir}/imaplogin
347 %attr(755,root,root) %{_sbindir}/mkimapdcert
348 %attr(755,root,root) %{_sbindir}/sharedindexinstall
349 %attr(755,root,root) %{_sbindir}/sharedindexsplit
350 %attr(755,root,root) %{_libexecdir}/imapd.rc
351 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
352 %{_mandir}/man8/imapd*
353 %{_mandir}/man1/maildiracl.1*
354 %{_mandir}/man1/maildirkw.1*
355
356 %files common
357 %defattr(644,root,root,755)
358 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
359 %attr(751,root,root) %dir %{_sysconfdir}
360 %attr(750,root,root) %dir %{_certsdir}
361 %attr(770,daemon,daemon) %dir %{_localstatedir}
362 %dir %{_libexecdir}
363 %{_sysconfdir}/quotawarnmsg.example
364 %attr(755,root,root) %{_bindir}/couriertls
365 %attr(755,root,root) %{_libexecdir}/couriertcpd
366 %{_mandir}/man1/couriert*
367 %{_mandir}/man8/couriert*
368 %{_mandir}/man8/mk*
369
370 %files deliverquota
371 %defattr(644,root,root,755)
372 %attr(755,root,root) %{_bindir}/deliverquota
373 %{_mandir}/man8/deliverquota*
374
375 %files maildirmake
376 %defattr(644,root,root,755)
377 %attr(755,root,root) %{_bindir}/maildirmake
378 %{_mandir}/man1/maildirmake*
379
380 %files pop3
381 %defattr(644,root,root,755)
382 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/pop3
383 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.pop3
384 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d
385 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d-ssl
386 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d.cnf
387 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
388 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3-ssl
389 %attr(755,root,root) %{_bindir}/pop3d
390 %attr(755,root,root) %{_sbindir}/mkpop3dcert
391 %attr(755,root,root) %{_sbindir}/pop3login
392 %attr(755,root,root) %{_libexecdir}/pop3d.rc
393 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
394 %{_mandir}/man8/courierpop*
This page took 0.078501 seconds and 4 git commands to generate.