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