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