]>
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.90 | |
28 | Release: 5 | |
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: 29a14c4bd29b553c0dfc13036225ebdd | |
34 | Source1: ftp://ftp.exim.org/pub/exim/exim4/%{name}-html-%{version}.tar.bz2 | |
35 | # Source1-md5: a728618fb641f4b9eb56deeefdb0cf67 | |
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: 49c0ff1c92d6e19a052e5a2b615fc6e4 | |
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_DANE=yes | |
207 | EXPERIMENTAL_DCC=yes | |
208 | EXPERIMENTAL_PRDR=yes | |
209 | EXPERIMENTAL_DSN_INFO=yes | |
210 | EXPERIMENTAL_QUEUEFILE=yes | |
211 | SUPPORT_I18N=yes | |
212 | SUPPORT_I18N_2008=yes | |
213 | LDFLAGS+= -lidn -lidn2 | |
214 | SUPPORT_PROXY=yes | |
215 | %if %{with dmarc} | |
216 | EXPERIMENTAL_DMARC=yes | |
217 | LOOKUP_LIBS+=-lopendmarc | |
218 | %endif | |
219 | %if %{with spf} | |
220 | EXPERIMENTAL_SPF=yes | |
221 | LOOKUP_LIBS+=-lspf2 | |
222 | %endif | |
223 | %if %{with srs} | |
224 | EXPERIMENTAL_SRS=yes | |
225 | LOOKUP_LIBS+=-lsrs_alt | |
226 | %endif | |
227 | %if %{with hiredis} | |
228 | LOOKUP_REDIS=yes | |
229 | LOOKUP_LIBS+=-lhiredis | |
230 | %endif | |
231 | %if %{with mysql} | |
232 | LOOKUP_MYSQL=%{dynamic_type} | |
233 | # for dynamic | |
234 | LOOKUP_MYSQL_INCLUDE=-I%{_includedir}/mysql | |
235 | LOOKUP_MYSQL_LIBS=-lmysqlclient | |
236 | # for static | |
237 | LOOKUP_INCLUDE+=-I%{_includedir}/mysql | |
238 | LOOKUP_LIBS+=-lmysqlclient | |
239 | %endif | |
240 | %if %{with pgsql} | |
241 | LOOKUP_PGSQL=%{dynamic_type} | |
242 | # for dynamic | |
243 | LOOKUP_PGSQL_INCLUDE=-I%{_includedir}/pgsql | |
244 | LOOKUP_PGSQL_LIBS=-lpq | |
245 | # for static | |
246 | LOOKUP_INCLUDE+=-I%{_includedir}/pgsql | |
247 | LOOKUP_LIBS+=-lpq | |
248 | %endif | |
249 | %if %{with sqlite} | |
250 | LOOKUP_SQLITE=%{dynamic_type} | |
251 | # for dynamic | |
252 | LOOKUP_SQLITE_LIBS=-lsqlite3 | |
253 | # for static | |
254 | LOOKUP_LIBS+=-lsqlite3 | |
255 | %endif | |
256 | %if %{with whoson} | |
257 | LOOKUP_WHOSON=%{dynamic_type} | |
258 | # for dynamic | |
259 | LOOKUP_WHOSON_LIBS=-lwhoson | |
260 | # for static | |
261 | LOOKUP_LIBS+=-lwhoson | |
262 | %endif | |
263 | %if %{with sasl} | |
264 | AUTH_CYRUS_SASL=yes | |
265 | LOOKUP_LIBS+=-lsasl2 | |
266 | %endif | |
267 | %if %{with ldap} | |
268 | LOOKUP_LDAP=%{dynamic_type} | |
269 | LDAP_LIB_TYPE=OPENLDAP2 | |
270 | # for dynamic | |
271 | LOOKUP_LDAP_LIBS=-lldap -llber | |
272 | # for static | |
273 | LOOKUP_LIBS+=-lldap -llber | |
274 | %endif | |
275 | %if %{with lmdb} | |
276 | EXPERIMENTAL_LMDB=yes | |
277 | LOOKUP_LIBS+=-llmdb | |
278 | %endif | |
279 | EOF | |
280 | ||
281 | # have to be after Local/Makefile-Linux creation | |
282 | cp -f src/EDITME Local/Makefile | |
283 | cp -f exim_monitor/EDITME Local/eximon.conf | |
284 | ||
285 | %build | |
286 | %{__make} -e -j1 \ | |
287 | FULLECHO='' | |
288 | ||
289 | %install | |
290 | rm -rf $RPM_BUILD_ROOT | |
291 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail | |
292 | install -d $RPM_BUILD_ROOT/etc/{cron.daily,logrotate.d,rc.d/init.d,sysconfig,pam.d,security} | |
293 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man8,/usr/lib} | |
294 | install -d $RPM_BUILD_ROOT%{_var}/{spool/exim/{db,input,msglog},log/{archive,}/exim,mail} | |
295 | install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}} | |
296 | install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/modules | |
297 | ||
298 | install build-Linux-*/exim{,_fixdb,_tidydb,_dbmbuild,on.bin,_dumpdb,_lock} \ | |
299 | build-Linux-*/exi{cyclog,next,what} %{SOURCE10} \ | |
300 | build-Linux-*/{exigrep,exiqgrep,exipick,eximstats,exiqsumm,convert4r4} \ | |
301 | util/unknownuser.sh \ | |
302 | $RPM_BUILD_ROOT%{_bindir} | |
303 | install build-Linux-*/eximon.bin $RPM_BUILD_ROOT%{_bindir} | |
304 | install build-Linux-*/eximon $RPM_BUILD_ROOT%{_bindir} | |
305 | %{?with_dynamic:install build-Linux-*/*/*.so $RPM_BUILD_ROOT%{_libdir}/%{name}/modules} | |
306 | ||
307 | install %{SOURCE5} . | |
308 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.daily | |
309 | install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
310 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
311 | install %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} | |
312 | install exim4.conf $RPM_BUILD_ROOT%{_sysconfdir}/mail/exim.conf | |
313 | install {doc,man}/*.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
314 | install %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases | |
315 | install %{SOURCE15} $RPM_BUILD_ROOT/etc/pam.d/smtp | |
316 | ||
317 | ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/sendmail | |
318 | ln -sf %{_bindir}/exim $RPM_BUILD_ROOT/usr/lib/sendmail | |
319 | ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/mailq | |
320 | ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/rsmtp | |
321 | ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/rmail | |
322 | ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/runq | |
323 | ||
324 | install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir} | |
325 | install %{SOURCE16} $RPM_BUILD_ROOT%{_pixmapsdir} | |
326 | ||
327 | install -d $RPM_BUILD_ROOT%{_includedir}/%{name} | |
328 | install src/{local_scan,store,mytypes}.h $RPM_BUILD_ROOT%{_includedir}/%{name} | |
329 | install build-Linux-*/config.h $RPM_BUILD_ROOT%{_includedir}/%{name} | |
330 | ||
331 | touch $RPM_BUILD_ROOT%{_var}/log/exim/{main,reject,panic,process}.log | |
332 | ||
333 | touch $RPM_BUILD_ROOT/etc/security/blacklist.smtp | |
334 | ||
335 | %clean | |
336 | rm -rf $RPM_BUILD_ROOT | |
337 | ||
338 | %pre | |
339 | %groupadd -g 79 exim | |
340 | %useradd -u 79 -d /var/spool/exim -s /bin/false -c "Exim pseudo user" -g exim exim | |
341 | ||
342 | %post | |
343 | umask 022 | |
344 | /sbin/chkconfig --add %{name} | |
345 | %service %{name} restart "exim daemon" | |
346 | ||
347 | if [ ! -f /etc/mail/mailname ]; then | |
348 | rm -f /etc/mail/mailname && hostname -f > /etc/mail/mailname | |
349 | fi | |
350 | newaliases | |
351 | ||
352 | %preun | |
353 | if [ "$1" = "0" ]; then | |
354 | %service exim stop | |
355 | /sbin/chkconfig --del %{name} | |
356 | fi | |
357 | ||
358 | %postun | |
359 | if [ "$1" = "0" ]; then | |
360 | %userremove exim | |
361 | %groupremove exim | |
362 | fi | |
363 | ||
364 | %files | |
365 | %defattr(644,root,root,755) | |
366 | %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 | |
367 | %doc exim-html-*/doc/html | |
368 | %dir %{_sysconfdir}/mail | |
369 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/exim.conf | |
370 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/aliases | |
371 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/exim | |
372 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/exim | |
373 | %attr(754,root,root) /etc/rc.d/init.d/exim | |
374 | %attr(4755,root,root) %{_bindir}/exim | |
375 | %attr(770,root,exim) %dir %{_var}/spool/exim | |
376 | %attr(750,exim,exim) %dir %{_var}/spool/exim/db | |
377 | %attr(700,exim,root) %dir %{_var}/spool/exim/input | |
378 | %attr(750,exim,root) %dir %{_var}/spool/exim/msglog | |
379 | %attr(755,root,root) %{_bindir}/exim_* | |
380 | %attr(755,root,root) %{_bindir}/exinext | |
381 | %attr(755,root,root) %{_bindir}/exiwhat | |
382 | %attr(755,root,root) %{_bindir}/exicyclog | |
383 | %attr(755,root,root) %{_bindir}/exigrep | |
384 | %attr(755,root,root) %{_bindir}/exipick | |
385 | %attr(755,root,root) %{_bindir}/exiqgrep | |
386 | %attr(755,root,root) %{_bindir}/eximstats | |
387 | %attr(755,root,root) %{_bindir}/exiqsumm | |
388 | %attr(755,root,root) %{_bindir}/unknownuser.sh | |
389 | %attr(755,root,root) %{_bindir}/newaliases | |
390 | %attr(755,root,root) %{_bindir}/convert4r4 | |
391 | %attr(755,root,root) %{_sbindir}/mailq | |
392 | %attr(755,root,root) %{_sbindir}/rmail | |
393 | %attr(755,root,root) %{_sbindir}/rsmtp | |
394 | %attr(755,root,root) %{_sbindir}/runq | |
395 | %attr(755,root,root) %{_sbindir}/sendmail | |
396 | %attr(755,root,root) /usr/lib/sendmail | |
397 | %attr(754,root,root) /etc/cron.daily/exim.cron.db | |
398 | %attr(750,exim,root) %dir %{_var}/log/exim | |
399 | %attr(750,exim,root) %dir %{_var}/log/archive/exim | |
400 | %attr(640,exim,root) %ghost %{_var}/log/exim/* | |
401 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/smtp | |
402 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.smtp | |
403 | %if %{with dynamic} | |
404 | %dir %{_libdir}/%{name} | |
405 | %dir %{_libdir}/%{name}/modules | |
406 | %{?with_mysql:%attr(755,root,root) %{_libdir}/%{name}/modules/mysql.so} | |
407 | %{?with_pgsql:%attr(755,root,root) %{_libdir}/%{name}/modules/pgsql.so} | |
408 | %{?with_sqlite:%attr(755,root,root) %{_libdir}/%{name}/modules/sqlite.so} | |
409 | %{?with_whoson:%attr(755,root,root) %{_libdir}/%{name}/modules/whoson.so} | |
410 | %endif | |
411 | %{_mandir}/man8/* | |
412 | ||
413 | %files X11 | |
414 | %defattr(644,root,root,755) | |
415 | %attr(755,root,root) %{_bindir}/eximon | |
416 | %attr(755,root,root) %{_bindir}/eximon.bin | |
417 | %{_desktopdir}/eximon.desktop | |
418 | %{_pixmapsdir}/eximon.png | |
419 | ||
420 | %files devel | |
421 | %defattr(644,root,root,755) | |
422 | %{_includedir}/%{name} |