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