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