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