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