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