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