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