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