]> TLD Linux GIT Repositories - packages/dovecot.git/blob - dovecot.spec
- release 3
[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 Patch0:         %{name}-config.patch
25 Patch1:         %{name}-rpath.patch
26 Patch2:         crypt.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 %{?with_gssapi:Obsoletes:       heimdal-daemons}
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 libs
136 Summary:        Dovecot shared libraries
137 Summary(pl.UTF-8):      Współdzielone biblioteki Dovecota
138 Group:          Development/Libraries
139
140 %description libs
141 Dovecot shared libraries.
142
143 %description libs -l pl.UTF-8
144 Współdzielone biblioteki Dovecota.
145
146 %package devel
147 Summary:        Development package for Dovecot plugins
148 Summary(pl.UTF-8):      Pakiet programistyczny do tworzenia wtyczek dla Dovecota
149 Group:          Development/Libraries
150 Requires:       %{name}-libs = %{epoch}:%{version}-%{release}
151
152 %description devel
153 Development package for Dovecot plugins.
154
155 %description devel -l pl.UTF-8
156 Pakiet programistyczny do tworzenia wtyczek dla Dovecota.
157
158 %prep
159 %setup -q
160 %patch0 -p1
161 %patch1 -p1
162 %patch2 -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
196 %{__make}
197
198 %{?with_tests:%{__make} check}
199
200 %install
201 rm -rf $RPM_BUILD_ROOT
202 install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,sysconfig,security} \
203         $RPM_BUILD_ROOT{/var/lib/dovecot,/var/run/dovecot/login}
204
205 %{__make} install \
206         DESTDIR=$RPM_BUILD_ROOT
207
208 mv -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/example-config/* $RPM_BUILD_ROOT%{_sysconfdir}/dovecot
209
210 cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/%{name}
211 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
212 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
213
214 touch $RPM_BUILD_ROOT/etc/security/blacklist.imap
215
216 find $RPM_BUILD_ROOT%{_libdir}/%{name} -name '*.la' | xargs rm
217
218 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
219 %{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/README
220
221 %clean
222 rm -rf $RPM_BUILD_ROOT
223
224 %pre
225 %groupadd -g 172 dovecot
226 %useradd -u 172 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovecot dovecot
227 %groupadd -g 254 dovenull
228 %useradd -u 254 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovenull dovenull
229
230 %post
231 /sbin/chkconfig --add dovecot
232 %service dovecot restart
233
234 %preun
235 if [ "$1" = "0" ]; then
236         %service dovecot stop
237         /sbin/chkconfig --del dovecot
238 fi
239
240 %postun
241 if [ "$1" = "0" ]; then
242         %userremove dovecot
243         %groupremove dovecot
244         %userremove dovenull
245         %groupremove dovenull
246 fi
247
248 %post   libs -p /sbin/ldconfig
249 %postun libs -p /sbin/ldconfig
250
251 %triggerin -- pam
252 # restart devocot if pam is upgraded
253 # (dovecot is linked with old libpam but tries to open modules linked with new libpam)
254 if [ "$2" != 1 ]; then
255         %service -q dovecot restart
256 fi
257
258 %triggerpostun -- dovecot < 1:2.0.0
259 # upgrading dovecot < 1.1
260 echo "Configuration change default_mail_env -> mail_location"
261 %{__sed} -i -e "s/^default_mail_env/mail_location/" /etc/dovecot/dovecot.conf
262 # upgrading dovecot < 2.0
263 i=0
264 for a in /etc/dovecot/dovecot-db-example.conf \
265         /etc/dovecot/dovecot-dict-sql-example.conf \
266         /etc/dovecot/dovecot-ldap-example.conf \
267         /etc/dovecot/dovecot-sql-example.conf \
268         /etc/dovecot/dovecot.conf; do
269         if [ -f "$a" ]; then
270                 [ "$i" -eq 0 ] && echo "Read http://wiki2.dovecot.org/Upgrading/2.0"
271                 i=1
272                 echo "Trying to migrate $a config file to dovecot 2."
273                 cp -a "$a" "$a-1.2.org"
274                 :> "$a.log"
275                 chmod 600 "$a.log"
276                 # convert config and prefix stderr lines with #
277                 %{_bindir}/doveconf -n -c "$a-1.2.org" > "$a" 2> "$a.log" || :
278         fi
279 done
280 if [ "$i" -eq 1 ]; then
281         echo "Please verify contents of %{_sysconfdir}/%{name}/* files."
282 fi
283
284 %files
285 %defattr(644,root,root,755)
286 # COPYING contains some notes, not actual LGPL text
287 %doc AUTHORS COPYING ChangeLog NEWS README TODO doc/*.txt doc/*.c*f doc/wiki/*.txt
288 %attr(755,root,root) %{_bindir}/doveadm
289 %attr(755,root,root) %{_bindir}/doveconf
290 %attr(755,root,root) %{_bindir}/dsync
291 %attr(755,root,root) %{_sbindir}/%{name}
292 %attr(751,root,root) %dir %{_sysconfdir}/%{name}
293 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
294 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.ext
295 %attr(751,root,root) %dir %{_sysconfdir}/%{name}/conf.d
296 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.conf
297 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.ext
298 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/%{name}
299 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
300 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
301 %attr(754,root,root) /etc/rc.d/init.d/%{name}
302 %if "%{_libexecdir}" != "%{_libdir}"
303 %dir %{_libexecdir}/%{name}
304 %endif
305 %attr(755,root,root) %{_libexecdir}/%{name}/aggregator
306 %attr(755,root,root) %{_libexecdir}/%{name}/anvil
307 %attr(755,root,root) %{_libexecdir}/%{name}/auth
308 %attr(755,root,root) %{_libexecdir}/%{name}/checkpassword-reply
309 %attr(755,root,root) %{_libexecdir}/%{name}/config
310 %attr(755,root,root) %{_libexecdir}/%{name}/decode2text.sh
311 %attr(755,root,root) %{_libexecdir}/%{name}/deliver
312 %attr(755,root,root) %{_libexecdir}/%{name}/dict
313 %attr(755,root,root) %{_libexecdir}/%{name}/director
314 %attr(755,root,root) %{_libexecdir}/%{name}/dns-client
315 %attr(755,root,root) %{_libexecdir}/%{name}/doveadm-server
316 %attr(755,root,root) %{_libexecdir}/%{name}/dovecot-lda
317 %attr(755,root,root) %{_libexecdir}/%{name}/gdbhelper
318 %attr(755,root,root) %{_libexecdir}/%{name}/imap
319 %attr(755,root,root) %{_libexecdir}/%{name}/imap-hibernate
320 %attr(755,root,root) %{_libexecdir}/%{name}/imap-login
321 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth
322 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth-login
323 %attr(755,root,root) %{_libexecdir}/%{name}/imap-urlauth-worker
324 %attr(755,root,root) %{_libexecdir}/%{name}/indexer
325 %attr(755,root,root) %{_libexecdir}/%{name}/indexer-worker
326 %attr(755,root,root) %{_libexecdir}/%{name}/ipc
327 %attr(755,root,root) %{_libexecdir}/%{name}/lmtp
328 %attr(755,root,root) %{_libexecdir}/%{name}/log
329 %attr(755,root,root) %{_libexecdir}/%{name}/maildirlock
330 %attr(755,root,root) %{_libexecdir}/%{name}/old-stats
331 %attr(755,root,root) %{_libexecdir}/%{name}/pop3
332 %attr(755,root,root) %{_libexecdir}/%{name}/pop3-login
333 %attr(755,root,root) %{_libexecdir}/%{name}/quota-status
334 %attr(755,root,root) %{_libexecdir}/%{name}/rawlog
335 %attr(755,root,root) %{_libexecdir}/%{name}/replicator
336 %attr(755,root,root) %{_libexecdir}/%{name}/script
337 %attr(755,root,root) %{_libexecdir}/%{name}/script-login
338 %attr(755,root,root) %{_libexecdir}/%{name}/stats
339 %attr(755,root,root) %{_libexecdir}/%{name}/submission
340 %attr(755,root,root) %{_libexecdir}/%{name}/submission-login
341 %attr(755,root,root) %{_libexecdir}/%{name}/xml2text
342 %attr(755,root,root) %{_libdir}/%{name}/libdcrypt_openssl.so
343 %dir %{_libdir}/%{name}/plugins
344 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
345 %dir %{_libdir}/%{name}/plugins/auth
346 %attr(755,root,root) %{_libdir}/%{name}/plugins/auth/*.so
347 %dir %{_libdir}/%{name}/plugins/dict
348 %attr(755,root,root) %{_libdir}/%{name}/plugins/dict/*.so
349 %dir %{_libdir}/%{name}/plugins/doveadm
350 %attr(755,root,root) %{_libdir}/%{name}/plugins/doveadm/*.so
351 %dir %{_libdir}/%{name}/plugins/old-stats
352 %attr(755,root,root) %{_libdir}/%{name}/plugins/old-stats/*.so
353 %{_datadir}/dovecot
354 %dir /var/lib/dovecot
355 %dir /var/run/dovecot
356 %attr(750,root,dovenull) %dir /var/run/dovecot/login
357
358 %{_mandir}/man1/deliver.1*
359 %{_mandir}/man1/dove*.1*
360 %{_mandir}/man1/dsync.1*
361 %{_mandir}/man7/doveadm-search-query.7*
362
363 %files libs
364 %defattr(644,root,root,755)
365 %dir %{_libdir}/%{name}
366
367 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0.0.0
368 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0.0.0
369 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0.0.0
370 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0.0.0
371 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0.0.0
372 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0.0.0}
373 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0.0.0
374 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0.0.0
375 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0.0.0
376 # Note: we are in %{_libdir}/dovecot, ldconfig does not look into this
377 # directory. This is why the following files are not %ghost
378 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0
379 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0
380 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0
381 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so.0
382 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0
383 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so.0}
384 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0
385 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0
386 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0
387
388 %files devel
389 %defattr(644,root,root,755)
390 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so
391 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so
392 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so
393 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-fts.so
394 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so
395 %{?with_ldap:%attr(755,root,root) %{_libdir}/%{name}/libdovecot-ldap.so}
396 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so
397 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so
398 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so
399 %{_libdir}/%{name}/%{name}-config
400 %{_includedir}/%{name}
401 %{_aclocaldir}/dovecot.m4