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