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