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