]> git.pld-linux.org Git - packages/dovecot.git/blob - dovecot.spec
fa7f942ab844daa484091e5dba5afdf52f7711d8
[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.15
15 Release:        2
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:  c6c176943bd832c780fbb5d2f8850952
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:         %{name}-exttextcat.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-devel
37 %{?with_gssapi:BuildRequires:   heimdal-devel}
38 BuildRequires:  libcap-devel
39 BuildRequires:  libstemmer-devel
40 BuildRequires:  libexttextcat-devel
41 BuildRequires:  libtool
42 BuildRequires:  lz4-devel
43 %{?with_mysql:BuildRequires:    mysql-devel}
44 %{?with_ldap:BuildRequires:     openldap-devel >= 2.3.3}
45 BuildRequires:  openssl-devel >= 0.9.7d
46 BuildRequires:  pam-devel
47 BuildRequires:  pkgconfig
48 %{?with_pgsql:BuildRequires:    postgresql-devel}
49 BuildRequires:  rpmbuild(macros) >= 1.647
50 BuildRequires:  sed >= 4.0
51 %{?with_sqlite:BuildRequires:   sqlite3-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 -p1
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         --with-systemdsystemunitdir=%{systemdunitdir}
192
193 %{__make}
194
195 %{?with_tests:%{__make} check}
196
197 %install
198 rm -rf $RPM_BUILD_ROOT
199 install -d $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,sysconfig,security} \
200         $RPM_BUILD_ROOT{/var/lib/dovecot,/var/run/dovecot/login} \
201         $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
202
203 %{__make} install \
204         DESTDIR=$RPM_BUILD_ROOT
205
206 mv -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/example-config/* $RPM_BUILD_ROOT%{_sysconfdir}/dovecot
207
208 cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/%{name}
209 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
210 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
211 install %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
212
213 touch $RPM_BUILD_ROOT/etc/security/blacklist.imap
214
215 find $RPM_BUILD_ROOT%{_libdir}/%{name} -name '*.la' | xargs rm
216
217 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
218 %{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/README
219
220 %clean
221 rm -rf $RPM_BUILD_ROOT
222
223 %pre
224 %groupadd -g 172 dovecot
225 %useradd -u 172 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovecot dovecot
226 %groupadd -g 254 dovenull
227 %useradd -u 254 -d /usr/share/empty -s /bin/false -c "Dovecot server" -g dovenull dovenull
228
229 %post
230 /sbin/chkconfig --add dovecot
231 %service dovecot restart
232 %systemd_post dovecot.socket dovecot.service
233
234 %preun
235 if [ "$1" = "0" ]; then
236         %service dovecot stop
237         /sbin/chkconfig --del dovecot
238 fi
239 %systemd_preun dovecot.service dovecot.socket
240
241 %postun
242 if [ "$1" = "0" ]; then
243         %userremove dovecot
244         %groupremove dovecot
245         %userremove dovenull
246         %groupremove dovenull
247 fi
248 %systemd_reload
249
250 %post   libs -p /sbin/ldconfig
251 %postun libs -p /sbin/ldconfig
252
253 %triggerin -- pam
254 # restart devocot if pam is upgraded
255 # (dovecot is linked with old libpam but tries to open modules linked with new libpam)
256 if [ "$2" != 1 ]; then
257         %service -q dovecot restart
258 fi
259
260 %triggerpostun -- dovecot < 1:2.0.0
261 # upgrading dovecot < 1.1
262 echo "Configuration change default_mail_env -> mail_location"
263 %{__sed} -i -e "s/^default_mail_env/mail_location/" /etc/dovecot/dovecot.conf
264 # upgrading dovecot < 2.0
265 i=0
266 for a in /etc/dovecot/dovecot-db-example.conf \
267         /etc/dovecot/dovecot-dict-sql-example.conf \
268         /etc/dovecot/dovecot-ldap-example.conf \
269         /etc/dovecot/dovecot-sql-example.conf \
270         /etc/dovecot/dovecot.conf; do
271         if [ -f "$a" ]; then
272                 [ "$i" -eq 0 ] && echo "Read http://wiki2.dovecot.org/Upgrading/2.0"
273                 i=1
274                 echo "Trying to migrate $a config file to dovecot 2."
275                 cp -a "$a" "$a-1.2.org"
276                 :> "$a.log"
277                 chmod 600 "$a.log"
278                 # convert config and prefix stderr lines with #
279                 %{_bindir}/doveconf -n -c "$a-1.2.org" > "$a" 2> "$a.log" || :
280         fi
281 done
282 if [ "$i" -eq 1 ]; then
283         echo "Please verify contents of %{_sysconfdir}/%{name}/* files."
284 fi
285
286 %triggerpostun -- %{name} < 1:2.2.4-2
287 %systemd_trigger dovecot.service dovecot.socket
288
289 %files
290 %defattr(644,root,root,755)
291 # COPYING contains some notes, not actual LGPL text
292 %doc AUTHORS COPYING ChangeLog NEWS README TODO doc/*.txt doc/*.c*f doc/wiki/*.txt
293 %attr(755,root,root) %{_bindir}/doveadm
294 %attr(755,root,root) %{_bindir}/doveconf
295 %attr(755,root,root) %{_bindir}/dsync
296 %attr(755,root,root) %{_sbindir}/%{name}
297 %attr(751,root,root) %dir %{_sysconfdir}/%{name}
298 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
299 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.ext
300 %attr(751,root,root) %dir %{_sysconfdir}/%{name}/conf.d
301 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.conf
302 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/conf.d/*.ext
303 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/%{name}
304 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.imap
305 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
306 %attr(754,root,root) /etc/rc.d/init.d/%{name}
307 %attr(755,root,root) %{_libdir}/%{name}/aggregator
308 %attr(755,root,root) %{_libdir}/%{name}/anvil
309 %attr(755,root,root) %{_libdir}/%{name}/auth
310 %attr(755,root,root) %{_libdir}/%{name}/checkpassword-reply
311 %attr(755,root,root) %{_libdir}/%{name}/config
312 %attr(755,root,root) %{_libdir}/%{name}/decode2text.sh
313 %attr(755,root,root) %{_libdir}/%{name}/deliver
314 %attr(755,root,root) %{_libdir}/%{name}/dict
315 %attr(755,root,root) %{_libdir}/%{name}/director
316 %attr(755,root,root) %{_libdir}/%{name}/dns-client
317 %attr(755,root,root) %{_libdir}/%{name}/doveadm-server
318 %attr(755,root,root) %{_libdir}/%{name}/dovecot-lda
319 %attr(755,root,root) %{_libdir}/%{name}/gdbhelper
320 %attr(755,root,root) %{_libdir}/%{name}/imap
321 %attr(755,root,root) %{_libdir}/%{name}/imap-login
322 %attr(755,root,root) %{_libdir}/%{name}/imap-urlauth
323 %attr(755,root,root) %{_libdir}/%{name}/imap-urlauth-login
324 %attr(755,root,root) %{_libdir}/%{name}/imap-urlauth-worker
325 %attr(755,root,root) %{_libdir}/%{name}/indexer
326 %attr(755,root,root) %{_libdir}/%{name}/indexer-worker
327 %attr(755,root,root) %{_libdir}/%{name}/ipc
328 %attr(755,root,root) %{_libdir}/%{name}/lmtp
329 %attr(755,root,root) %{_libdir}/%{name}/log
330 %attr(755,root,root) %{_libdir}/%{name}/maildirlock
331 %attr(755,root,root) %{_libdir}/%{name}/pop3
332 %attr(755,root,root) %{_libdir}/%{name}/pop3-login
333 %attr(755,root,root) %{_libdir}/%{name}/quota-status
334 %attr(755,root,root) %{_libdir}/%{name}/rawlog
335 %attr(755,root,root) %{_libdir}/%{name}/replicator
336 %attr(755,root,root) %{_libdir}/%{name}/script
337 %attr(755,root,root) %{_libdir}/%{name}/script-login
338 %attr(755,root,root) %{_libdir}/%{name}/ssl-params
339 %attr(755,root,root) %{_libdir}/%{name}/stats
340 %attr(755,root,root) %{_libdir}/%{name}/xml2text
341 %dir %{_libdir}/%{name}/plugins
342 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
343 %dir %{_libdir}/%{name}/plugins/auth
344 %attr(755,root,root) %{_libdir}/%{name}/plugins/auth/*.so
345 %dir %{_libdir}/%{name}/plugins/dict
346 %attr(755,root,root) %{_libdir}/%{name}/plugins/dict/*.so
347 %dir %{_libdir}/%{name}/plugins/doveadm
348 %attr(755,root,root) %{_libdir}/%{name}/plugins/doveadm/*.so
349 %{systemdunitdir}/dovecot.service
350 %{systemdunitdir}/dovecot.socket
351 /usr/lib/tmpfiles.d/%{name}.conf
352 %dir /var/lib/dovecot
353 %dir /var/run/dovecot
354 %attr(750,root,dovenull) %dir /var/run/dovecot/login
355
356 %{_mandir}/man1/deliver.1*
357 %{_mandir}/man1/dove*.1*
358 %{_mandir}/man1/dsync.1*
359 %{_mandir}/man7/doveadm-search-query.7*
360
361 %files devel
362 %defattr(644,root,root,755)
363 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so
364 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so
365 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so
366 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so
367 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so
368 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so
369 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so
370 %{_libdir}/%{name}/%{name}-config
371 %{_includedir}/%{name}
372 %{_aclocaldir}/dovecot.m4
373
374 %files libs
375 %defattr(644,root,root,755)
376 %dir %{_libdir}/%{name}
377
378 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0.0.0
379 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0.0.0
380 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0.0.0
381 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0.0.0
382 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0.0.0
383 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0.0.0
384 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0.0.0
385 # Note: we are in %{_libdir}/dovecot, ldconfig does not look into this
386 # directory. This is why the following files are not %ghost
387 %attr(755,root,root) %{_libdir}/%{name}/libdovecot.so.0
388 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-compression.so.0
389 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-dsync.so.0
390 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-lda.so.0
391 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-login.so.0
392 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-sql.so.0
393 %attr(755,root,root) %{_libdir}/%{name}/libdovecot-storage.so.0
This page took 0.059691 seconds and 3 git commands to generate.