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