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