]> git.pld-linux.org Git - packages/dovecot.git/blob - dovecot.spec
- rel 2; fix tests on 32 bit arch
[packages/dovecot.git] / dovecot.spec
1 #
2 # Conditional build:
3 %bcond_without  gssapi  # without GSSAPI support
4 %bcond_without  ldap    # without LDAP auth
5 %bcond_without  lua     # without Lua auth
6 %bcond_without  mysql   # without MySQL auth
7 %bcond_without  pgsql   # without PostgreSQL auth
8 %bcond_without  sqlite  # without SQLite3 auth
9 %bcond_without  sasl    # without SASL auth
10 %bcond_without  tests   # tests
11
12 Summary:        IMAP and POP3 server written with security primarily in mind
13 Summary(pl.UTF-8):      Serwer IMAP i POP3 pisany głównie z myślą o bezpieczeństwie
14 Name:           dovecot
15 Version:        2.3.11.3
16 Release:        2
17 Epoch:          1
18 License:        MIT (libraries), LGPL v2.1 (the rest)
19 Group:          Networking/Daemons
20 Source0:        http://dovecot.org/releases/2.3/%{name}-%{version}.tar.gz
21 # Source0-md5:  f06f2272fad04e7b0207f8d00a291f66
22 Source1:        %{name}.pamd
23 Source2:        %{name}.init
24 Source3:        %{name}.sysconfig
25 Source4:        %{name}.tmpfiles
26 Patch0:         %{name}-config.patch
27 Patch1:         %{name}-rpath.patch
28 Patch2:         %{name}-shebang.patch
29 Patch3:         tests.patch
30 URL:            http://dovecot.org/
31 BuildRequires:  autoconf
32 BuildRequires:  automake
33 BuildRequires:  bzip2-devel
34 BuildRequires:  clucene-core-devel >= 2.3.3.4
35 BuildRequires:  curl-devel
36 %{?with_sasl:BuildRequires:     cyrus-sasl-devel >= 2.0}
37 BuildRequires:  expat-devel
38 BuildRequires:  gettext-tools
39 %{?with_gssapi:BuildRequires:   heimdal-devel}
40 BuildRequires:  libapparmor-devel
41 BuildRequires:  libcap-devel
42 BuildRequires:  libicu-devel
43 BuildRequires:  libstemmer-devel
44 BuildRequires:  libexttextcat-devel
45 BuildRequires:  libtool
46 %{?with_lua:BuildRequires:      lua53-devel}
47 BuildRequires:  lz4-devel
48 %{?with_mysql:BuildRequires:    mysql-devel}
49 %{?with_ldap:BuildRequires:     openldap-devel >= 2.3.3}
50 BuildRequires:  openssl-devel >= 0.9.7d
51 BuildRequires:  pam-devel
52 BuildRequires:  pkgconfig
53 %{?with_pgsql:BuildRequires:    postgresql-devel}
54 BuildRequires:  rpmbuild(macros) >= 1.647
55 BuildRequires:  sed >= 4.0
56 %{?with_sqlite:BuildRequires:   sqlite3-devel}
57 BuildRequires:  xz-devel
58 BuildRequires:  zlib-devel
59 Requires(post,preun):   /sbin/chkconfig
60 Requires(postun):       /usr/sbin/groupdel
61 Requires(postun):       /usr/sbin/userdel
62 Requires(pre):  /bin/id
63 Requires(pre):  /usr/bin/getgid
64 Requires(pre):  /usr/sbin/groupadd
65 Requires(pre):  /usr/sbin/useradd
66 Requires:       %{name}-libs = %{epoch}:%{version}-%{release}
67 Requires:       pam >= 0.79.0
68 Provides:       group(dovecot)
69 Provides:       imapdaemon
70 Provides:       pop3daemon
71 Provides:       user(dovecot)
72 # heimdal-daemons in PLD contained only "popper" (kerberized POP3 daemon)
73 %{?with_gssapi:Obsoletes:       heimdal-daemons}
74 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75
76 %define         no_install_post_check_so        1
77
78 %description
79 Dovecot is an IMAP and POP3 server for Linux/UNIX-like systems,
80 written with security primarily in mind. Although it's written with C,
81 it uses several coding techniques to avoid most of the common
82 pitfalls.
83
84 Dovecot can work with standard mbox and maildir formats and it's fully
85 compatible with UW-IMAP and Courier IMAP servers as well as mail
86 clients accessing the mailboxes directly. It's also planned to support
87 storing mails in SQL databases.
88
89 Dovecot is easy to set up and doesn't require special maintenance.
90 Only thing you need is to get the authentication working properly - if
91 your users are in /etc/passwd there's hardly anything you have to do.
92
93 Dovecot should be pretty fast, mostly because of index files that
94 Dovecot maintains; instead of having to scan through all the data in
95 mailbox, Dovecot can get most of the wanted information from index
96 with little effort.
97
98 Status:
99 - should be quite ready for use with normal IMAP clients
100 - complete IMAP4rev1 and POP3 support
101 - supports THREAD, SORT and IDLE extensions, required by many IMAP
102   webmails
103 - complete TLS/SSL support
104 - IPv6 ready
105 - shared mailboxes aren't yet supported
106 - Maildir++ quota is supported, bad hard filesystem quota can be
107   problematic
108
109 %description -l pl.UTF-8
110 Dovecot to serwer IMAP i POP3 dla systemów linuksowych/uniksowych,
111 pisany głównie z myślą o bezpieczeństwie. Chociaż jest pisany w C,
112 używa kilku technik kodowania zapobiegających większości popularnych
113 pułapek.
114
115 Dovecot może działać ze standardowymi formatami mbox i maildir, jest
116 całkowicie kompatybilny z serwerami UW-IMAP i Courier IMAP, a także z
117 klientami pocztowymi bezpośrednio dostającymi się do skrzynek.
118 Planowana jest także obsługa przechowywania listów w bazach SQL.
119
120 Dovecot jest łatwy do skonfigurowania i nie wymaga specjalnego
121 nadzoru. Wystarczy tylko doprowadzić do działania uwierzytelnianie -
122 jeśli użytkownicy są w /etc/passwd, to właściwie nie trzeba nic
123 zmieniać.
124
125 Dovecot powinien być w miarę szybki, głównie z powodu plików
126 indeksowych utrzymywanych przez serwer; zamiast potrzeby skanowania
127 wszystkich danych w skrzynce, Dovecot może małym kosztem uzyskać
128 większość potrzebnych informacji z indeksu.
129
130 Stan:
131 - powinien być gotowy do użycia ze zwykłymi klientami IMAP
132 - pełna obsługa IMAP4rev1 i POP3
133 - obsługa rozszerzeń THREAD, SORT i IDLE, wymaganych przez wiele
134   webmaili IMAP
135 - obsługa IPv6
136 - pełna obsługa TLS/SSL
137 - quota Maildir++ jest obsługiwana, ale twarda quota na systemach
138   plików może być problematyczna
139
140 %package libs
141 Summary:        Dovecot shared libraries
142 Summary(pl.UTF-8):      Współdzielone biblioteki Dovecota
143 Group:          Development/Libraries
144
145 %description libs
146 Dovecot shared libraries.
147
148 %description libs -l pl.UTF-8
149 Współdzielone biblioteki Dovecota.
150
151 %package devel
152 Summary:        Development package for Dovecot plugins
153 Summary(pl.UTF-8):      Pakiet programistyczny do tworzenia wtyczek dla Dovecota
154 Group:          Development/Libraries
155 Requires:       %{name}-libs = %{epoch}:%{version}-%{release}
156
157 %description devel
158 Development package for Dovecot plugins.
159
160 %description devel -l pl.UTF-8
161 Pakiet programistyczny do tworzenia wtyczek dla Dovecota.
162
163 %prep
164 %setup -q
165 %patch0 -p1
166 %patch1 -p1
167 %patch2 -p1
168 %patch3 -p1
169
170 %{__sed} -i 's,/usr/lib/dovecot,%{_libdir}/dovecot,g' doc/example-config/*.conf doc/example-config/conf.d/*.conf
171
172 %{__sed} -i 's,#!/usr/bin/env bash,#!/bin/bash,' src/util/health-check.sh
173
174 %build
175 touch config.rpath
176 %{__libtoolize}
177 %{__aclocal} -I . -I m4
178 %{__autoconf}
179 %{__autoheader}
180 %{__automake}
181 %configure \
182         ac_cv_prog_VALGRIND=no \
183         CPPFLAGS="%{rpmcppflags} -I/usr/include/libstemmer -D_LINUX_QUOTA_VERSION=2" \
184         --disable-static \
185         --enable-hardening \
186         %{?debug:--enable-debug} \
187         %{?with_ldap:--with-ldap=yes} \
188         %{?with_mysql:--with-mysql} \
189         %{?with_pgsql:--with-pgsql} \
190         %{?with_sqlite:--with-sqlite} \
191         %{?with_gssapi:--with-gssapi=plugin} \
192         %{?with_lua:--with-lua=plugin} \
193         --with-lucene \
194         --with-stemmer \
195         --with-solr \
196         --with-sql=plugin \
197         --with-pam \
198         --with-zlib \
199         --with-bzlib \
200         --with-libcap \
201         --with-ssl=openssl \
202 %ifarch x32
203         --without-libunwind \
204 %endif
205         --with-moduledir=%{_libdir}/%{name}/plugins \
206         --with-ssldir=/var/lib/openssl \
207         --sysconfdir=%{_sysconfdir} \
208         --with-systemdsystemunitdir=%{systemdunitdir}
209
210 %{__make}
211
212 %{?with_tests:%{__make} check}
213
214 %install
215 rm -rf $RPM_BUILD_ROOT
216 install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,sysconfig,security} \
217         $RPM_BUILD_ROOT{/var/lib/dovecot,/var/run/dovecot/login} \
218         $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
219
220 %{__make} install \
221         DESTDIR=$RPM_BUILD_ROOT
222
223 mv -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/example-config/* $RPM_BUILD_ROOT%{_sysconfdir}/dovecot
224
225 cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/%{name}
226 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
227 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
228 install %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
229
230 touch $RPM_BUILD_ROOT/etc/security/blacklist.imap
231
232 find $RPM_BUILD_ROOT%{_libdir}/%{name} -name '*.la' | xargs rm
233
234 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
235 %{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/README
236
237 %clean
238 rm -rf $RPM_BUILD_ROOT
239
240 %pre
241 %groupadd -g 172 dovecot
242 %useradd -u 172 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovecot dovecot
243 %groupadd -g 254 dovenull
244 %useradd -u 254 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovenull dovenull
245
246 %post
247 /sbin/chkconfig --add dovecot
248 %service dovecot restart
249 %systemd_post dovecot.socket dovecot.service
250
251 %preun
252 if [ "$1" = "0" ]; then
253         %service dovecot stop
254         /sbin/chkconfig --del dovecot
255 fi
256 %systemd_preun dovecot.service dovecot.socket
257
258 %postun
259 if [ "$1" = "0" ]; then
260         %userremove dovecot
261         %groupremove dovecot
262         %userremove dovenull
263         %groupremove dovenull
264 fi
265 %systemd_reload
266
267 %post   libs -p /sbin/ldconfig
268 %postun libs -p /sbin/ldconfig
269
270 %triggerin -- pam
271 # restart devocot if pam is upgraded
272 # (dovecot is linked with old libpam but tries to open modules linked with new libpam)
273 if [ "$2" != 1 ]; then
274         %service -q dovecot restart
275 fi
276
277 %triggerpostun -- dovecot < 1:2.0.0
278 # upgrading dovecot < 1.1
279 echo "Configuration change default_mail_env -> mail_location"
280 %{__sed} -i -e "s/^default_mail_env/mail_location/" /etc/dovecot/dovecot.conf
281 # upgrading dovecot < 2.0
282 i=0
283 for a in /etc/dovecot/dovecot-db-example.conf \
284         /etc/dovecot/dovecot-dict-sql-example.conf \
285         /etc/dovecot/dovecot-ldap-example.conf \
286         /etc/dovecot/dovecot-sql-example.conf \
287         /etc/dovecot/dovecot.conf; do
288         if [ -f "$a" ]; then
289                 [ "$i" -eq 0 ] && echo "Read http://wiki2.dovecot.org/Upgrading/2.0"
290                 i=1
291                 echo "Trying to migrate $a config file to dovecot 2."
292                 cp -a "$a" "$a-1.2.org"
293                 :> "$a.log"
294                 chmod 600 "$a.log"
295                 # convert config and prefix stderr lines with #
296                 %{_bindir}/doveconf -n -c "$a-1.2.org" > "$a" 2> "$a.log" || :
297         fi
298 done
299 if [ "$i" -eq 1 ]; then
300         echo "Please verify contents of %{_sysconfdir}/%{name}/* files."
301 fi
302
303 %triggerpostun -- %{name} < 1:2.2.4-2
304 %systemd_trigger dovecot.service dovecot.socket
305
306 %files
307 %defattr(644,root,root,755)
308 # COPYING contains some notes, not actual LGPL text
309 %doc AUTHORS COPYING ChangeLog NEWS README TODO doc/*.txt doc/*.c*f doc/wiki/*.txt
310 %attr(755,root,root) %{_bindir}/doveadm
311 %attr(755,root,root) %{_bindir}/doveconf
312 %attr(755,root,root) %{_bindir}/dovecot-sysreport
313 %attr(755,root,root) %{_bindir}/dsync
314 %attr(755,root,root) %{_sbindir}/%{name}
315 %attr(751,root,root) %dir %{_sysconfdir}/%{name}
316 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
317 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.ext
318 %attr(751,root,root) %dir %{_sysconfdir}/%{name}/conf.d
319 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.conf
320 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.ext
321 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/%{name}
322 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
323 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
324 %attr(754,root,root) /etc/rc.d/init.d/%{name}
325 %if "%{_libexecdir}" != "%{_libdir}"
326 %dir %{_libexecdir}/%{name}
327 %endif
328 %attr(755,root,root) %{_libexecdir}/%{name}/aggregator
329 %attr(755,root,root) %{_libexecdir}/%{name}/anvil
330 %attr(755,root,root) %{_libexecdir}/%{name}/auth
331 %attr(755,root,root) %{_libexecdir}/%{name}/checkpassword-reply
332 %attr(755,root,root) %{_libexecdir}/%{name}/config
333 %attr(755,root,root) %{_libexecdir}/%{name}/decode2text.sh
334 %attr(755,root,root) %{_libexecdir}/%{name}/deliver
335 %attr(755,root,root) %{_libexecdir}/%{name}/dict
336 %attr(755,root,root) %{_libexecdir}/%{name}/director
337 %attr(755,root,root) %{_libexecdir}/%{name}/dns-client
338 %attr(755,root,root) %{_libexecdir}/%{name}/doveadm-server
339 %attr(755,root,root) %{_libexecdir}/%{name}/dovecot-lda
340 %attr(755,root,root) %{_libexecdir}/%{name}/gdbhelper
341 %attr(755,root,root) %{_libexecdir}/%{name}/health-check.sh
342 %attr(755,root,root) %{_libexecdir}/%{name}/imap
343 %attr(755,root,root) %{_libexecdir}/%{name}/imap-hibernate
344 %attr(755,root,root) %{_libexecdir}/%{name}/imap-login
345 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth
346 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth-login
347 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth-worker
348 %attr(755,root,root) %{_libexecdir}/%{name}/indexer
349 %attr(755,root,root) %{_libexecdir}/%{name}/indexer-worker
350 %attr(755,root,root) %{_libexecdir}/%{name}/ipc
351 %attr(755,root,root) %{_libexecdir}/%{name}/lmtp
352 %attr(755,root,root) %{_libexecdir}/%{name}/log
353 %attr(755,root,root) %{_libexecdir}/%{name}/maildirlock
354 %attr(755,root,root) %{_libexecdir}/%{name}/old-stats
355 %attr(755,root,root) %{_libexecdir}/%{name}/pop3
356 %attr(755,root,root) %{_libexecdir}/%{name}/pop3-login
357 %attr(755,root,root) %{_libexecdir}/%{name}/quota-status
358 %attr(755,root,root) %{_libexecdir}/%{name}/rawlog
359 %attr(755,root,root) %{_libexecdir}/%{name}/replicator
360 %attr(755,root,root) %{_libexecdir}/%{name}/script
361 %attr(755,root,root) %{_libexecdir}/%{name}/script-login
362 %attr(755,root,root) %{_libexecdir}/%{name}/stats
363 %attr(755,root,root) %{_libexecdir}/%{name}/submission
364 %attr(755,root,root) %{_libexecdir}/%{name}/submission-login
365 %attr(755,root,root) %{_libexecdir}/%{name}/xml2text
366 %attr(755,root,root) %{_libdir}/%{name}/libdcrypt_openssl.so
367 %dir %{_libdir}/%{name}/plugins
368 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
369 %dir %{_libdir}/%{name}/plugins/auth
370 %attr(755,root,root) %{_libdir}/%{name}/plugins/auth/*.so
371 %dir %{_libdir}/%{name}/plugins/dict
372 %attr(755,root,root) %{_libdir}/%{name}/plugins/dict/*.so
373 %dir %{_libdir}/%{name}/plugins/doveadm
374 %attr(755,root,root) %{_libdir}/%{name}/plugins/doveadm/*.so
375 %dir %{_libdir}/%{name}/plugins/old-stats
376 %attr(755,root,root) %{_libdir}/%{name}/plugins/old-stats/*.so
377 %{_datadir}/dovecot
378 %{systemdunitdir}/dovecot.service
379 %{systemdunitdir}/dovecot.socket
380 /usr/lib/tmpfiles.d/%{name}.conf
381 %dir /var/lib/dovecot
382 %dir /var/run/dovecot
383 %attr(750,root,dovenull) %dir /var/run/dovecot/login
384
385 %{_mandir}/man1/deliver.1*
386 %{_mandir}/man1/dove*.1*
387 %{_mandir}/man1/dsync.1*
388 %{_mandir}/man7/doveadm-search-query.7*
389
390 %files libs
391 %defattr(644,root,root,755)
392 %dir %{_libdir}/%{name}
393
394 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0.0.0
395 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0.0.0
396 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0.0.0
397 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0.0.0
398 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0.0.0
399 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0.0.0}
400 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0.0.0
401 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0.0.0
402 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0.0.0
403 # Note: we are in %{_libdir}/dovecot, ldconfig does not look into this
404 # directory. This is why the following files are not %ghost
405 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0
406 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0
407 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0
408 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0
409 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0
410 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0}
411 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0
412 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0
413 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0
414
415 %files devel
416 %defattr(644,root,root,755)
417 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so
418 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so
419 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so
420 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so
421 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so
422 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so}
423 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so
424 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so
425 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so
426 %{_libdir}/%{name}/%{name}-config
427 %{_includedir}/%{name}
428 %{_aclocaldir}/dovecot.m4
This page took 0.07183 seconds and 3 git commands to generate.