]> git.pld-linux.org Git - packages/dovecot.git/blob - dovecot.spec
Release 3 (by relup.sh)
[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.3.2.1
15 Release:        3
16 Epoch:          1
17 License:        MIT (libraries), LGPL v2.1 (the rest)
18 Group:          Networking/Daemons
19 Source0:        http://dovecot.org/releases/2.3/%{name}-%{version}.tar.gz
20 # Source0-md5:  77a7fa95b38bd6686e6191b2b3f2b87b
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:         crypt.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 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:       pop3daemon
68 Provides:       user(dovecot)
69 # heimdal-daemons in PLD contained only "popper" (kerberized POP3 daemon)
70 %{?with_gssapi:Obsoletes:       heimdal-daemons}
71 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72
73 %define         no_install_post_check_so        1
74
75 %description
76 Dovecot is an IMAP and POP3 server for Linux/UNIX-like systems,
77 written with security primarily in mind. Although it's written with C,
78 it uses several coding techniques to avoid most of the common
79 pitfalls.
80
81 Dovecot can work with standard mbox and maildir formats and it's fully
82 compatible with UW-IMAP and Courier IMAP servers as well as mail
83 clients accessing the mailboxes directly. It's also planned to support
84 storing mails in SQL databases.
85
86 Dovecot is easy to set up and doesn't require special maintenance.
87 Only thing you need is to get the authentication working properly - if
88 your users are in /etc/passwd there's hardly anything you have to do.
89
90 Dovecot should be pretty fast, mostly because of index files that
91 Dovecot maintains; instead of having to scan through all the data in
92 mailbox, Dovecot can get most of the wanted information from index
93 with little effort.
94
95 Status:
96 - should be quite ready for use with normal IMAP clients
97 - complete IMAP4rev1 and POP3 support
98 - supports THREAD, SORT and IDLE extensions, required by many IMAP
99   webmails
100 - complete TLS/SSL support
101 - IPv6 ready
102 - shared mailboxes aren't yet supported
103 - Maildir++ quota is supported, bad hard filesystem quota can be
104   problematic
105
106 %description -l pl.UTF-8
107 Dovecot to serwer IMAP i POP3 dla systemów linuksowych/uniksowych,
108 pisany głównie z myślą o bezpieczeństwie. Chociaż jest pisany w C,
109 używa kilku technik kodowania zapobiegających większości popularnych
110 pułapek.
111
112 Dovecot może działać ze standardowymi formatami mbox i maildir, jest
113 całkowicie kompatybilny z serwerami UW-IMAP i Courier IMAP, a także z
114 klientami pocztowymi bezpośrednio dostającymi się do skrzynek.
115 Planowana jest także obsługa przechowywania listów w bazach SQL.
116
117 Dovecot jest łatwy do skonfigurowania i nie wymaga specjalnego
118 nadzoru. Wystarczy tylko doprowadzić do działania uwierzytelnianie -
119 jeśli użytkownicy są w /etc/passwd, to właściwie nie trzeba nic
120 zmieniać.
121
122 Dovecot powinien być w miarę szybki, głównie z powodu plików
123 indeksowych utrzymywanych przez serwer; zamiast potrzeby skanowania
124 wszystkich danych w skrzynce, Dovecot może małym kosztem uzyskać
125 większość potrzebnych informacji z indeksu.
126
127 Stan:
128 - powinien być gotowy do użycia ze zwykłymi klientami IMAP
129 - pełna obsługa IMAP4rev1 i POP3
130 - obsługa rozszerzeń THREAD, SORT i IDLE, wymaganych przez wiele
131   webmaili IMAP
132 - obsługa IPv6
133 - pełna obsługa TLS/SSL
134 - quota Maildir++ jest obsługiwana, ale twarda quota na systemach
135   plików może być problematyczna
136
137 %package libs
138 Summary:        Dovecot shared libraries
139 Summary(pl.UTF-8):      Współdzielone biblioteki Dovecota
140 Group:          Development/Libraries
141
142 %description libs
143 Dovecot shared libraries.
144
145 %description libs -l pl.UTF-8
146 Współdzielone biblioteki Dovecota.
147
148 %package devel
149 Summary:        Development package for Dovecot plugins
150 Summary(pl.UTF-8):      Pakiet programistyczny do tworzenia wtyczek dla Dovecota
151 Group:          Development/Libraries
152 Requires:       %{name}-libs = %{epoch}:%{version}-%{release}
153
154 %description devel
155 Development package for Dovecot plugins.
156
157 %description devel -l pl.UTF-8
158 Pakiet programistyczny do tworzenia wtyczek dla Dovecota.
159
160 %prep
161 %setup -q
162 %patch0 -p1
163 %patch1 -p1
164 %patch2 -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 . -I m4
172 %{__autoconf}
173 %{__autoheader}
174 %{__automake}
175 %configure \
176         ac_cv_prog_VALGRIND=no \
177         CPPFLAGS="%{rpmcppflags} -I/usr/include/libstemmer -D_LINUX_QUOTA_VERSION=2" \
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 %if "%{_libexecdir}" != "%{_libdir}"
314 %dir %{_libexecdir}/%{name}
315 %endif
316 %attr(755,root,root) %{_libexecdir}/%{name}/aggregator
317 %attr(755,root,root) %{_libexecdir}/%{name}/anvil
318 %attr(755,root,root) %{_libexecdir}/%{name}/auth
319 %attr(755,root,root) %{_libexecdir}/%{name}/checkpassword-reply
320 %attr(755,root,root) %{_libexecdir}/%{name}/config
321 %attr(755,root,root) %{_libexecdir}/%{name}/decode2text.sh
322 %attr(755,root,root) %{_libexecdir}/%{name}/deliver
323 %attr(755,root,root) %{_libexecdir}/%{name}/dict
324 %attr(755,root,root) %{_libexecdir}/%{name}/director
325 %attr(755,root,root) %{_libexecdir}/%{name}/dns-client
326 %attr(755,root,root) %{_libexecdir}/%{name}/doveadm-server
327 %attr(755,root,root) %{_libexecdir}/%{name}/dovecot-lda
328 %attr(755,root,root) %{_libexecdir}/%{name}/gdbhelper
329 %attr(755,root,root) %{_libexecdir}/%{name}/imap
330 %attr(755,root,root) %{_libexecdir}/%{name}/imap-hibernate
331 %attr(755,root,root) %{_libexecdir}/%{name}/imap-login
332 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth
333 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth-login
334 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth-worker
335 %attr(755,root,root) %{_libexecdir}/%{name}/indexer
336 %attr(755,root,root) %{_libexecdir}/%{name}/indexer-worker
337 %attr(755,root,root) %{_libexecdir}/%{name}/ipc
338 %attr(755,root,root) %{_libexecdir}/%{name}/lmtp
339 %attr(755,root,root) %{_libexecdir}/%{name}/log
340 %attr(755,root,root) %{_libexecdir}/%{name}/maildirlock
341 %attr(755,root,root) %{_libexecdir}/%{name}/old-stats
342 %attr(755,root,root) %{_libexecdir}/%{name}/pop3
343 %attr(755,root,root) %{_libexecdir}/%{name}/pop3-login
344 %attr(755,root,root) %{_libexecdir}/%{name}/quota-status
345 %attr(755,root,root) %{_libexecdir}/%{name}/rawlog
346 %attr(755,root,root) %{_libexecdir}/%{name}/replicator
347 %attr(755,root,root) %{_libexecdir}/%{name}/script
348 %attr(755,root,root) %{_libexecdir}/%{name}/script-login
349 %attr(755,root,root) %{_libexecdir}/%{name}/stats
350 %attr(755,root,root) %{_libexecdir}/%{name}/submission
351 %attr(755,root,root) %{_libexecdir}/%{name}/submission-login
352 %attr(755,root,root) %{_libexecdir}/%{name}/xml2text
353 %attr(755,root,root) %{_libdir}/%{name}/libdcrypt_openssl.so
354 %dir %{_libdir}/%{name}/plugins
355 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
356 %dir %{_libdir}/%{name}/plugins/auth
357 %attr(755,root,root) %{_libdir}/%{name}/plugins/auth/*.so
358 %dir %{_libdir}/%{name}/plugins/dict
359 %attr(755,root,root) %{_libdir}/%{name}/plugins/dict/*.so
360 %dir %{_libdir}/%{name}/plugins/doveadm
361 %attr(755,root,root) %{_libdir}/%{name}/plugins/doveadm/*.so
362 %dir %{_libdir}/%{name}/plugins/old-stats
363 %attr(755,root,root) %{_libdir}/%{name}/plugins/old-stats/*.so
364 %{_datadir}/dovecot
365 %{systemdunitdir}/dovecot.service
366 %{systemdunitdir}/dovecot.socket
367 /usr/lib/tmpfiles.d/%{name}.conf
368 %dir /var/lib/dovecot
369 %dir /var/run/dovecot
370 %attr(750,root,dovenull) %dir /var/run/dovecot/login
371
372 %{_mandir}/man1/deliver.1*
373 %{_mandir}/man1/dove*.1*
374 %{_mandir}/man1/dsync.1*
375 %{_mandir}/man7/doveadm-search-query.7*
376
377 %files libs
378 %defattr(644,root,root,755)
379 %dir %{_libdir}/%{name}
380
381 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0.0.0
382 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0.0.0
383 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0.0.0
384 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0.0.0
385 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0.0.0
386 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0.0.0}
387 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0.0.0
388 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0.0.0
389 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0.0.0
390 # Note: we are in %{_libdir}/dovecot, ldconfig does not look into this
391 # directory. This is why the following files are not %ghost
392 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0
393 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0
394 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0
395 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0
396 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0
397 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0}
398 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0
399 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0
400 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0
401
402 %files devel
403 %defattr(644,root,root,755)
404 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so
405 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so
406 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so
407 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so
408 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so
409 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so}
410 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so
411 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so
412 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so
413 %{_libdir}/%{name}/%{name}-config
414 %{_includedir}/%{name}
415 %{_aclocaldir}/dovecot.m4
This page took 0.072521 seconds and 3 git commands to generate.