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