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