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