- rel 6; small fixes from upstream
[packages/exim.git] / exim.spec
1 #
2 # Conditional build:
3 %bcond_without  pgsql   # without PostgreSQL support
4 %bcond_without  mysql   # without MySQL support
5 %bcond_without  sqlite  # without sqlite
6 %bcond_without  whoson  # without whoson support
7 %bcond_without  sasl    # without SASL
8 %bcond_without  ldap    # without LDAP support
9 %bcond_without  spf     # without spf support
10 %bcond_without  srs     # without srs support
11 %bcond_without  dynamic # dynamic modules
12 %bcond_without  hiredis # without redis
13 # opendmarc.spec not ready, so off by default
14 %bcond_with     dmarc   # DMARC support
15 %bcond_without  lmdb    # LMDB support
16
17 %if "%{pld_release}" == "ac"
18 # hiredis build segfaults on ac-alpha
19 %undefine       with_hiredis
20 %endif
21
22 %include        /usr/lib/rpm/macros.perl
23 Summary:        University of Cambridge Mail Transfer Agent
24 Summary(pl.UTF-8):      Agent Transferu Poczty Uniwersytetu w Cambridge
25 Summary(pt_BR.UTF-8):   Servidor de correio eletrônico exim
26 Name:           exim
27 Version:        4.91
28 Release:        6
29 Epoch:          2
30 License:        GPL
31 Group:          Networking/Daemons/SMTP
32 Source0:        ftp://ftp.exim.org/pub/exim/exim4/%{name}-%{version}.tar.bz2
33 # Source0-md5:  e4db1e9013227539acfd662c3cf816d9
34 Source1:        ftp://ftp.exim.org/pub/exim/exim4/%{name}-html-%{version}.tar.bz2
35 # Source1-md5:  587e1e9018b593f5c0a19a8205235db9
36 Source2:        %{name}.init
37 Source3:        %{name}.cron.db
38 Source4:        %{name}4.conf
39 Source5:        analyse-log-errors
40 Source6:        %{name}on.desktop
41 # 20021016: http://www.logic.univie.ac.at/~ametzler/debian/exim4manpages/
42 Source7:        %{name}4-man-021016.tar.bz2
43 # Source7-md5:  b552704ebf853a401946038a2b7e8e98
44 Source9:        %{name}.aliases
45 Source10:       newaliases
46 Source11:       %{name}.logrotate
47 Source12:       %{name}.sysconfig
48 Source14:       ftp://ftp.exim.org/pub/exim/exim4/old/config.samples.tar.bz2
49 # Source14-md5: 4b93321938a800caa6127c48ad60a42b
50 Source15:       %{name}4-smtp.pamd
51 Source16:       %{name}on.png
52 # sh branch.sh
53 Patch100:       %{name}-git.patch
54 # Patch100-md5: 3b3cf0026749ce512daf950b0b3f5e8a
55 Patch0:         %{name}4-EDITME.patch
56 Patch1:         %{name}4-monitor-EDITME.patch
57 Patch2:         %{name}4-cflags.patch
58 Patch3:         exim-defs.patch
59 Patch4:         %{name}4-Makefile-Default.patch
60 # http://marc.merlins.org/linux/exim/files/sa-exim-cvs/localscan_dlopen_exim_4.20_or_better.patch
61 Patch5:         localscan_dlopen_%{name}_4.20_or_better.patch
62
63 Patch8:         %{name}-spam-timeout.patch
64
65 Patch20:        %{name}4-disableSSLv3.patch
66 URL:            http://www.exim.org/
67 %{?with_sasl:BuildRequires:     cyrus-sasl-devel >= 2.1.0}
68 BuildRequires:  db-devel
69 %{?with_dmarc:BuildRequires:    opendmarc-devel}
70 %{?with_hiredis:BuildRequires:  hiredis-devel}
71 BuildRequires:  libidn-devel
72 BuildRequires:  libidn2-devel
73 %{?with_spf:BuildRequires:      libspf2-devel >= 1.2.5-2}
74 %{?with_srs:BuildRequires:      libsrs_alt-devel >= 1.0}
75 %{?with_lmdb:BuildRequires:     lmdb-devel}
76 %{?with_mysql:BuildRequires:    mysql-devel}
77 %{?with_ldap:BuildRequires:     openldap-devel >= 2.3.0}
78 BuildRequires:  openssl-devel >= 0.9.7d
79 BuildRequires:  pam-devel
80 BuildRequires:  pcre-devel
81 BuildRequires:  perl-devel >= 1:5.6.0
82 %{?with_pgsql:BuildRequires:    postgresql-devel}
83 BuildRequires:  readline-devel
84 BuildRequires:  rpm >= 4.4.9-56
85 BuildRequires:  rpm-perlprov >= 4.1-13
86 BuildRequires:  rpmbuild(macros) >= 1.268
87 %{?with_sqlite:BuildRequires:   sqlite3-devel}
88 %{?with_whoson:BuildRequires:   whoson-devel}
89 %if "%{pld_release}" != "ac"
90 BuildRequires:  xorg-lib-libX11-devel
91 BuildRequires:  xorg-lib-libXaw-devel
92 %else
93 BuildRequires:  XFree86-devel
94 %endif
95 Requires(post): /bin/hostname
96 Requires(post): fileutils
97 Requires(post,preun):   /sbin/chkconfig
98 Requires(postun):       /usr/sbin/groupdel
99 Requires(postun):       /usr/sbin/userdel
100 Requires(pre):  /bin/id
101 Requires(pre):  /usr/bin/getgid
102 Requires(pre):  /usr/sbin/groupadd
103 Requires(pre):  /usr/sbin/useradd
104 Requires:       findutils
105 Requires:       pam >= 0.79.0
106 Requires:       rc-scripts
107 Requires:       which
108 Provides:       group(exim)
109 Provides:       smtpdaemon
110 Provides:       user(exim)
111 Obsoletes:      exipick
112 Obsoletes:      smtpdaemon
113 Conflicts:      logrotate < 3.8.3
114 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
115
116 %description
117 Smail like Mail Transfer Agent with single configuration file.
118 Features: flexible retry algorithms, header & envelope rewriting,
119 multiple deliveries down single connection or multiple deliveries in
120 parallel, regular expressions in configuration parameters, file
121 lookups, supports sender and/or reciever verification, selective
122 relaying, supports virtual domains, built-in mail filtering and can be
123 configured to drop root privilleges when possible.
124
125 %description -l pl.UTF-8
126 Agent transferu poczty (MTA) z pojedynczym plikiem konfiguracyjnym.
127 Jego zalety: świetne algorytmy, możliwość przepisywania nagłówków &
128 koperty, wielokrotne dostarczanie poczty podczas jednego połączenia
129 lub równoległe dostarczanie poczty, wyrażenia regularne w parametrach
130 konfiguracyjnych, weryfikacja nadawcy i/lub odbiorcy, selektywne
131 relayowanie, wsparcie dla wirtualnych domen, wbudowany system filtrów,
132 możliwość odrzucania praw roota kiedy jest to możliwe.
133
134 %description -l pt_BR.UTF-8
135 O exim é um agente de transporte de correio eletrônico (MTA),
136 desenvolvido na Universidade de Cambridge para uso em sistemas Unix
137 conectados a Internet. Similar em estilo ao smail 3, suas facilidades
138 são mais extensivas e em particular ele tem opções para verificação do
139 remetente e destinatário, para recusar mensagens de máquinas, redes ou
140 remetentes específicos.
141
142 %package X11
143 Summary:        X11 based Exim administration tool
144 Summary(pl.UTF-8):      Narzędzia administracyjne exima dla X11
145 Summary(pt_BR.UTF-8):   Monitor X11 para o exim
146 Group:          X11/Applications
147
148 %description X11
149 X11 based monitor & administration utility for the Exim Mail Transfer
150 Agent.
151
152 %description X11 -l pl.UTF-8
153 Bazujące na X11 narzędzia dla Exima - monitor i program
154 administracyjny.
155
156 %description X11 -l pt_BR.UTF-8
157 O monitor exim é um suplemento opcional ao pacote exim. Ele mostra
158 informações sobre o processamento do exim em uma janela X11. O
159 administrador pode executar uma série de ações de controle a partir
160 desta interface.
161
162 %package devel
163 Summary:        Header files for Exim
164 Summary(pl.UTF-8):      Pliki nagłówkowe dla Exima
165 Group:          Development/Libraries
166 Requires:       %{name} = %{epoch}:%{version}-%{release}
167
168 %description devel
169 Header files for Exim.
170
171 %description devel -l pl.UTF-8
172 Pliki nagłówkowe dla Exima.
173
174 %global dynamic_type    yes
175 %{?with_dynamic:%global dynamic_type 2}
176
177 %prep
178 %setup -q -a1 -a7
179 %patch100 -p2
180
181 %patch0 -p1
182 %patch1 -p1
183 %patch2 -p1
184 %patch3 -p1
185 %patch4 -p1
186 %patch5 -p1
187
188 %patch8 -p1
189
190 install %{SOURCE4} exim4.conf
191 install %{SOURCE14} doc/config.samples.tar.bz2
192 %patch20 -p1
193 install -d Local
194 cat << 'EOF' >> Local/Makefile-Linux
195 CC=%{__cc}
196 CUSTOM_CFLAGS=%{rpmcppflags} %{rpmcflags}
197 CFLAGS_DYNAMIC=-shared -rdynamic -fPIC %{rpmldflags}
198 LOOKUP_CDB=yes
199 XLFLAGS=-L%{_prefix}/X11R6/%{_lib}
200 X11_LD_LIB=%{_prefix}/X11R6/%{_lib}
201 %{?with_dynamic:LOOKUP_MODULE_DIR=%{_libdir}/%{name}/modules}
202 EXPERIMENTAL_ARC=yes
203 EXPERIMENTAL_DCC=yes
204 EXPERIMENTAL_PRDR=yes
205 EXPERIMENTAL_DSN_INFO=yes
206 EXPERIMENTAL_QUEUEFILE=yes
207 SUPPORT_DANE=yes
208 SUPPORT_I18N=yes
209 SUPPORT_I18N_2008=yes
210 LDFLAGS+= -lidn -lidn2
211 SUPPORT_PROXY=yes
212 %if %{with dmarc}
213 EXPERIMENTAL_DMARC=yes
214 LOOKUP_LIBS+=-lopendmarc
215 %endif
216 %if %{with spf}
217 SUPPORT_SPF=yes
218 LOOKUP_LIBS+=-lspf2
219 %endif
220 %if %{with srs}
221 EXPERIMENTAL_SRS=yes
222 LOOKUP_LIBS+=-lsrs_alt
223 %endif
224 %if %{with hiredis}
225 LOOKUP_REDIS=yes
226 LOOKUP_LIBS+=-lhiredis
227 %endif
228 %if %{with mysql}
229 LOOKUP_MYSQL=%{dynamic_type}
230 # for dynamic
231 LOOKUP_MYSQL_INCLUDE=-I%{_includedir}/mysql
232 LOOKUP_MYSQL_LIBS=-lmysqlclient
233 # for static
234 LOOKUP_INCLUDE+=-I%{_includedir}/mysql
235 LOOKUP_LIBS+=-lmysqlclient
236 %endif
237 %if %{with pgsql}
238 LOOKUP_PGSQL=%{dynamic_type}
239 # for dynamic
240 LOOKUP_PGSQL_INCLUDE=-I%{_includedir}/pgsql
241 LOOKUP_PGSQL_LIBS=-lpq
242 # for static
243 LOOKUP_INCLUDE+=-I%{_includedir}/pgsql
244 LOOKUP_LIBS+=-lpq
245 %endif
246 %if %{with sqlite}
247 LOOKUP_SQLITE=%{dynamic_type}
248 # for dynamic
249 LOOKUP_SQLITE_LIBS=-lsqlite3
250 # for static
251 LOOKUP_LIBS+=-lsqlite3
252 %endif
253 %if %{with whoson}
254 LOOKUP_WHOSON=%{dynamic_type}
255 # for dynamic
256 LOOKUP_WHOSON_LIBS=-lwhoson
257 # for static
258 LOOKUP_LIBS+=-lwhoson
259 %endif
260 %if %{with sasl}
261 AUTH_CYRUS_SASL=yes
262 LOOKUP_LIBS+=-lsasl2
263 %endif
264 %if %{with ldap}
265 LOOKUP_LDAP=%{dynamic_type}
266 LDAP_LIB_TYPE=OPENLDAP2
267 # for dynamic
268 LOOKUP_LDAP_LIBS=-lldap -llber
269 # for static
270 LOOKUP_LIBS+=-lldap -llber
271 %endif
272 %if %{with lmdb}
273 EXPERIMENTAL_LMDB=yes
274 LOOKUP_LIBS+=-llmdb
275 %endif
276 EOF
277
278 # have to be after Local/Makefile-Linux creation
279 cp -f src/EDITME Local/Makefile
280 cp -f exim_monitor/EDITME Local/eximon.conf
281
282 %build
283 %{__make} -e -j1 \
284         FULLECHO=''
285
286 %install
287 rm -rf $RPM_BUILD_ROOT
288 install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail
289 install -d $RPM_BUILD_ROOT/etc/{cron.daily,logrotate.d,rc.d/init.d,sysconfig,pam.d,security}
290 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man8,/usr/lib}
291 install -d $RPM_BUILD_ROOT%{_var}/{spool/exim/{db,input,msglog},log/{archive,}/exim,mail}
292 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
293 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/modules
294
295 install build-Linux-*/exim{,_fixdb,_tidydb,_dbmbuild,on.bin,_dumpdb,_lock} \
296         build-Linux-*/exi{cyclog,next,what} %{SOURCE10} \
297         build-Linux-*/{exigrep,exiqgrep,exipick,eximstats,exiqsumm,convert4r4} \
298         util/unknownuser.sh \
299         $RPM_BUILD_ROOT%{_bindir}
300 install build-Linux-*/eximon.bin $RPM_BUILD_ROOT%{_bindir}
301 install build-Linux-*/eximon $RPM_BUILD_ROOT%{_bindir}
302 %{?with_dynamic:install build-Linux-*/*/*.so $RPM_BUILD_ROOT%{_libdir}/%{name}/modules}
303
304 install %{SOURCE5} .
305 install %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.daily
306 install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
307 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
308 install %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
309 install exim4.conf $RPM_BUILD_ROOT%{_sysconfdir}/mail/exim.conf
310 install {doc,man}/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
311 install %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
312 install %{SOURCE15} $RPM_BUILD_ROOT/etc/pam.d/smtp
313
314 ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/sendmail
315 ln -sf %{_bindir}/exim $RPM_BUILD_ROOT/usr/lib/sendmail
316 ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/mailq
317 ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/rsmtp
318 ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/rmail
319 ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/runq
320
321 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}
322 install %{SOURCE16} $RPM_BUILD_ROOT%{_pixmapsdir}
323
324 install -d $RPM_BUILD_ROOT%{_includedir}/%{name}
325 install src/{local_scan,store,mytypes}.h $RPM_BUILD_ROOT%{_includedir}/%{name}
326 install build-Linux-*/config.h $RPM_BUILD_ROOT%{_includedir}/%{name}
327
328 touch $RPM_BUILD_ROOT%{_var}/log/exim/{main,reject,panic,process}.log
329
330 touch $RPM_BUILD_ROOT/etc/security/blacklist.smtp
331
332 %clean
333 rm -rf $RPM_BUILD_ROOT
334
335 %pre
336 %groupadd -g 79 exim
337 %useradd -u 79 -d /var/spool/exim -s /bin/false -c "Exim pseudo user" -g exim exim
338
339 %post
340 umask 022
341 /sbin/chkconfig --add %{name}
342 %service %{name} restart "exim daemon"
343
344 if [ ! -f /etc/mail/mailname ]; then
345         rm -f /etc/mail/mailname && hostname -f > /etc/mail/mailname
346 fi
347 newaliases
348
349 %preun
350 if [ "$1" = "0" ]; then
351         %service exim stop
352         /sbin/chkconfig --del %{name}
353 fi
354
355 %postun
356 if [ "$1" = "0" ]; then
357         %userremove exim
358         %groupremove exim
359 fi
360
361 %files
362 %defattr(644,root,root,755)
363 %doc README* NOTICE LICENCE analyse-log-errors doc/{ChangeLog,NewStuff,dbm.discuss.txt,filter.txt,spec.txt,Exim*.upgrade,OptionLists.txt,experimental-spec.txt} build-Linux-*/transport-filter.pl
364 %doc exim-html-*/doc/html
365 %dir %{_sysconfdir}/mail
366 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/exim.conf
367 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/aliases
368 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/exim
369 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/exim
370 %attr(754,root,root) /etc/rc.d/init.d/exim
371 %attr(4755,root,root) %{_bindir}/exim
372 %attr(770,root,exim) %dir %{_var}/spool/exim
373 %attr(750,exim,exim) %dir %{_var}/spool/exim/db
374 %attr(700,exim,root) %dir %{_var}/spool/exim/input
375 %attr(750,exim,root) %dir %{_var}/spool/exim/msglog
376 %attr(755,root,root) %{_bindir}/exim_*
377 %attr(755,root,root) %{_bindir}/exinext
378 %attr(755,root,root) %{_bindir}/exiwhat
379 %attr(755,root,root) %{_bindir}/exicyclog
380 %attr(755,root,root) %{_bindir}/exigrep
381 %attr(755,root,root) %{_bindir}/exipick
382 %attr(755,root,root) %{_bindir}/exiqgrep
383 %attr(755,root,root) %{_bindir}/eximstats
384 %attr(755,root,root) %{_bindir}/exiqsumm
385 %attr(755,root,root) %{_bindir}/unknownuser.sh
386 %attr(755,root,root) %{_bindir}/newaliases
387 %attr(755,root,root) %{_bindir}/convert4r4
388 %attr(755,root,root) %{_sbindir}/mailq
389 %attr(755,root,root) %{_sbindir}/rmail
390 %attr(755,root,root) %{_sbindir}/rsmtp
391 %attr(755,root,root) %{_sbindir}/runq
392 %attr(755,root,root) %{_sbindir}/sendmail
393 %attr(755,root,root) /usr/lib/sendmail
394 %attr(754,root,root) /etc/cron.daily/exim.cron.db
395 %attr(750,exim,root) %dir %{_var}/log/exim
396 %attr(750,exim,root) %dir %{_var}/log/archive/exim
397 %attr(640,exim,root) %ghost %{_var}/log/exim/*
398 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/smtp
399 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.smtp
400 %if %{with dynamic}
401 %dir %{_libdir}/%{name}
402 %dir %{_libdir}/%{name}/modules
403 %{?with_mysql:%attr(755,root,root) %{_libdir}/%{name}/modules/mysql.so}
404 %{?with_pgsql:%attr(755,root,root) %{_libdir}/%{name}/modules/pgsql.so}
405 %{?with_sqlite:%attr(755,root,root) %{_libdir}/%{name}/modules/sqlite.so}
406 %{?with_whoson:%attr(755,root,root) %{_libdir}/%{name}/modules/whoson.so}
407 %endif
408 %{_mandir}/man8/*
409
410 %files X11
411 %defattr(644,root,root,755)
412 %attr(755,root,root) %{_bindir}/eximon
413 %attr(755,root,root) %{_bindir}/eximon.bin
414 %{_desktopdir}/eximon.desktop
415 %{_pixmapsdir}/eximon.png
416
417 %files devel
418 %defattr(644,root,root,755)
419 %{_includedir}/%{name}
This page took 0.096489 seconds and 3 git commands to generate.