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