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