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