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