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