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