]> git.pld-linux.org Git - packages/courier-imap.git/blob - courier-imap.spec
- todo updated
[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:        2
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
164 %{__make}
165
166 %install
167 rm -rf $RPM_BUILD_ROOT
168 install -d $RPM_BUILD_ROOT{/etc/{pam.d,rc.d/init.d,security},%{_certsdir}}
169
170 %{__make} -j1 install \
171         DESTDIR=$RPM_BUILD_ROOT
172
173 install courier-imap $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap
174 install courier-imap-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-imap-ssl
175 install courier-pop3 $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3
176 install courier-pop3-ssl $RPM_BUILD_ROOT/etc/rc.d/init.d/courier-pop3-ssl
177 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/imap
178 install %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/pop3
179
180 rm -rf $RPM_BUILD_ROOT%{_sbindir}/mk*cert
181
182 install imap/README README.imap
183 install imap/ChangeLog ChangeLog
184 install maildir/README.maildirquota.txt README.maildirquota
185
186 mv -f $RPM_BUILD_ROOT%{_datadir}/mk*cert $RPM_BUILD_ROOT%{_sbindir}
187
188 install tcpd/couriertls.1 $RPM_BUILD_ROOT%{_mandir}/man8/couriertls.8
189 install imap/courierpop3d.8 $RPM_BUILD_ROOT%{_mandir}/man8/courierpop3d.8
190
191 touch $RPM_BUILD_ROOT/etc/security/blacklist.{pop3,imap}
192 touch $RPM_BUILD_ROOT%{_sysconfdir}/shared/index
193
194 # make config files
195 ./sysconftool $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
196
197 # set yes to start imapd and pop3d
198 sed -i 's/^POP3DSTART.*/POP3DSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/pop3d
199 sed -i 's/^IMAPDSTART.*/IMAPDSTART=YES/' $RPM_BUILD_ROOT%{_sysconfdir}/imapd
200
201 # remove unpackaged files
202 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.dist
203
204 %clean
205 rm -rf $RPM_BUILD_ROOT
206
207 %post
208 /sbin/chkconfig --add courier-imap
209 /sbin/chkconfig --add courier-imap-ssl
210 %service courier-imap restart "courier-imap daemon"
211 %service courier-imap-ssl restart "courier-imap-ssl daemon"
212
213 %preun
214 if [ "$1" = "0" ]; then
215         %service courier-imap stop
216         /sbin/chkconfig --del courier-imap
217 fi
218
219 if [ "$1" = "0" ]; then
220         %service courier-imap-ssl stop
221         /sbin/chkconfig --del courier-imap-ssl
222 fi
223
224
225 %triggerin -- %{name} < 3.0.5
226 if [ -f /var/lib/openssl/certs/imapd.pem ]; then
227         echo
228         echo imapd.pem has been moved automatically to %{_certsdir}
229         echo
230         mv -f /var/lib/openssl/certs/imapd.pem %{_certsdir}
231 fi
232 if [ -f /etc/sysconfig/courier-imap ]; then
233         . /etc/sysconfig/courier-imap
234         for opt in `grep ^[^#] /etc/sysconfig/courier-imap |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
235         do
236                 eval opt2=\$$opt
237                 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd
238                 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/imapd-ssl
239         done
240         sed -i s/^SSLADDRESS=.*/"SSLADDRESS=$ADDRESS_SSL"/ %{_sysconfdir}/imapd-ssl
241         sed -i s/^SSLPORT=.*/"SSLPORT=$PORTS_SSL"/ %{_sysconfdir}/imapd-ssl
242         sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd-ssl
243         sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/imapd
244         echo
245         echo IMAPD config file has been rewriten to %{_sysconfdir}/imapd,imapd-ssl
246         echo please look at them
247         echo
248 fi
249 %service -q courier-imap restart
250
251 %triggerin -- %{name} < 3.0.6
252 . %{_sysconfdir}/imapd-ssl
253 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
254         sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/imapd-ssl
255 fi
256
257 %triggerin -n %{name}-common -- %{name}-userdb
258 echo
259 echo courier-imap-userdb is obsolete
260 echo install courier-authlib-userdb package
261 echo
262
263 %triggerin -n %{name}-common -- %{name}-common < 3.0.5
264 /sbin/chkconfig --del authdaemon
265 if [ -f /var/lock/subsys/authdaemon ]; then
266         kill `cat /var/lib/authdaemon/pid`
267         rm -f /var/lock/subsys/authdaemon
268 fi
269 if [ -f /etc/sysconfig/authdaemon ]; then
270         . /etc/sysconfig/authdaemon
271         sed -i s/^version.*/version=authdaemond.$METHOD/ %{_sysconfdir}/authdaemonrc
272 fi
273 echo
274 echo Changes to version 3.0.5 :
275 echo - config files has been splited and moved to %{_sysconfdir}
276 echo - certificates directory has changed to %{_certsdir}
277 echo
278
279 %post pop3
280 /sbin/chkconfig --add courier-pop3
281 /sbin/chkconfig --add courier-pop3-ssl
282 /sbin/chkconfig --del courier-imap-pop3 >/dev/null 2>&1 || :
283 if [ -f /var/lock/subsys/courier-imap-pop3 ]; then
284         /sbin/service courier-imap-pop3 stop >&2
285         /sbin/service courier-pop3 start >&2
286 else
287         %service courier-pop3 restart "courier-pop3 daemon"
288 fi
289 %service courier-pop3-ssl restart "courier-pop3-ssl daemon"
290
291 %preun pop3
292 if [ "$1" = "0" ]; then
293         %service courier-pop3 stop
294         /sbin/chkconfig --del courier-pop3
295         %service courier-pop3-ssl stop
296         /sbin/chkconfig --del courier-pop3-ssl
297 fi
298
299 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.5
300 if [ -f /var/lib/openssl/certs/pop3d.pem ]; then
301         echo
302         echo pop3d.pem has been moved automatically to %{_certsdir}
303         echo
304         mv -f /var/lib/openssl/certs/pop3d.pem %{_certsdir}
305 fi
306 if [ -f /etc/sysconfig/courier-pop3 ]; then
307         . /etc/sysconfig/courier-pop3
308         for opt in `grep ^[^#] /etc/sysconfig/courier-pop3 |grep -v TLS_CERTFILE |grep -v MAILDIR |grep -v COURIERTLS |cut -d= -f1`;
309         do
310                 eval opt2=\$$opt
311                 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d
312                 sed -i s/^$opt=.*/"$opt=\"$opt2\""/ %{_sysconfdir}/pop3d-ssl
313         done
314         sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d-ssl
315         sed -i s!^MAILDIRPATH=.*!"MAILDIRPATH=\"$MAILDIR\""! %{_sysconfdir}/pop3d
316         echo
317         echo POP3D config file has been rewriten to %{_sysconfdir}/{pop3d,pop3d-ssl}
318         echo please look at them
319         echo
320 fi
321 %service courier-pop3 restart
322
323 %triggerin -n %{name}-pop3 -- %{name}-pop3 < 3.0.6
324 . %{_sysconfdir}/pop3d-ssl
325 if [ $TLS_CACHEFILE = "/var/couriersslcache" ]; then
326         sed -i s/^TLS_CACHEFILE=.*/"TLS_CACHEFILE=\/var\/spool\/courier-imap\/couriersslcache"/ %{_sysconfdir}/pop3d-ssl
327 fi
328
329 %files
330 %defattr(644,root,root,755)
331 %doc maildir/README.sharedfolders.txt imap/README.proxy tcpd/README.couriertls
332 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/imap
333 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
334 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd
335 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd-ssl
336 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/imapd.cnf
337 %attr(754,root,root) /etc/rc.d/init.d/courier-imap
338 %attr(754,root,root) /etc/rc.d/init.d/courier-imap-ssl
339 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared
340 %attr(755,daemon,daemon) %dir %{_sysconfdir}/shared.tmp
341 %attr(644,daemon,daemon) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/shared/index
342 %attr(755,root,root) %{_bindir}/imapd
343 %attr(755,root,root) %{_bindir}/maildiracl
344 %attr(755,root,root) %{_bindir}/maildirkw
345 %attr(755,root,root) %{_sbindir}/imaplogin
346 %attr(755,root,root) %{_sbindir}/mkimapdcert
347 %attr(755,root,root) %{_sbindir}/sharedindexinstall
348 %attr(755,root,root) %{_sbindir}/sharedindexsplit
349 %attr(755,root,root) %{_libexecdir}/imapd.rc
350 %attr(755,root,root) %{_libexecdir}/imapd-ssl.rc
351 %{_mandir}/man8/imapd*
352 %{_mandir}/man1/maildiracl.1*
353 %{_mandir}/man1/maildirkw.1*
354
355 %files common
356 %defattr(644,root,root,755)
357 %doc AUTHORS ChangeLog imap/BUGS INSTALL README*
358 %attr(751,root,root) %dir %{_sysconfdir}
359 %attr(750,root,root) %dir %{_certsdir}
360 %attr(770,daemon,daemon) %dir %{_localstatedir}
361 %dir %{_libexecdir}
362 %{_sysconfdir}/quotawarnmsg.example
363 %attr(755,root,root) %{_bindir}/couriertls
364 %attr(755,root,root) %{_libexecdir}/couriertcpd
365 %{_mandir}/man1/couriert*
366 %{_mandir}/man8/couriert*
367 %{_mandir}/man8/mk*
368
369 %files deliverquota
370 %defattr(644,root,root,755)
371 %attr(755,root,root) %{_bindir}/deliverquota
372 %{_mandir}/man8/deliverquota*
373
374 %files maildirmake
375 %defattr(644,root,root,755)
376 %attr(755,root,root) %{_bindir}/maildirmake
377 %{_mandir}/man1/maildirmake*
378
379 %files pop3
380 %defattr(644,root,root,755)
381 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/pop3
382 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.pop3
383 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d
384 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d-ssl
385 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pop3d.cnf
386 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3
387 %attr(754,root,root) /etc/rc.d/init.d/courier-pop3-ssl
388 %attr(755,root,root) %{_bindir}/pop3d
389 %attr(755,root,root) %{_sbindir}/mkpop3dcert
390 %attr(755,root,root) %{_sbindir}/pop3login
391 %attr(755,root,root) %{_libexecdir}/pop3d.rc
392 %attr(755,root,root) %{_libexecdir}/pop3d-ssl.rc
393 %{_mandir}/man8/courierpop*
This page took 0.055422 seconds and 4 git commands to generate.