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