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