]> git.pld-linux.org Git - packages/exim.git/blob - exim.spec
- add Patch6 to address CAN-2005-0021
[packages/exim.git] / exim.spec
1 # Conditional build:
2 %bcond_without  pgsql   # without PostgreSQL support
3 %bcond_without  mysql   # without MySQL support
4 %bcond_without  whoson  # without whoson support
5 %bcond_without  sasl    # without SASL
6 %bcond_without  ldap    # without LDAP support
7 %bcond_without  exiscan # without exiscan support
8 %bcond_without  spf     # without spf support
9 %bcond_without  srs     # without srs support
10 %bcond_with     saexim  # with sa-exim support
11 #
12 %define         exiscan_version 4.43-28
13 %define         saexim_version 3.1
14 Summary:        University of Cambridge Mail Transfer Agent
15 Summary(pl):    Agent Transferu Poczty Uniwersytetu w Cambridge
16 Summary(pt_BR): Servidor de correio eletrônico exim
17 Name:           exim
18 Version:        4.43
19 Release:        5
20 Epoch:          2
21 License:        GPL
22 Group:          Networking/Daemons
23 Source0:        ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/%{name}-%{version}.tar.bz2
24 # Source0-md5:  f8f646d4920660cb5579becd9265a3bf
25 Source1:        ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/%{name}-texinfo-4.40.tar.bz2
26 # Source1-md5:  cc91bd804ee0f7fd70991e2e6b529033
27 Source2:        %{name}.init
28 Source3:        %{name}.cron.db
29 Source4:        %{name}4.conf
30 Source5:        analyse-log-errors
31 Source6:        %{name}on.desktop
32 # 20021016: http://www.logic.univie.ac.at/~ametzler/debian/exim4manpages/
33 Source7:        %{name}4-man-021016.tar.bz2
34 # Source7-md5:  b552704ebf853a401946038a2b7e8e98
35 Source8:        http://duncanthrax.net/exiscan-acl/exiscan-acl-%{exiscan_version}.patch.bz2
36 # Source8-md5:  b2c629ee8f7edf7c0641e3cff4a602f6
37 Source9:        %{name}.aliases
38 Source10:       newaliases
39 Source11:       %{name}.logrotate
40 Source12:       %{name}.sysconfig
41 Source13:       ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/FAQ.txt.bz2
42 # Source13-md5: 7c695675e5e60693916b787001252d56
43 Source14:       ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/config.samples.tar.bz2
44 # Source14-md5: 42c7d5c02d06fdd3d8b6ba124ad9fd05
45 Source15:       %{name}4-smtp.pamd
46 Source16:       %{name}on.png
47 Source17:       http://marc.merlins.org/linux/exim/files/sa-exim-%{saexim_version}.tar.gz
48 # Source17-md5: 34892f195384c127f7c40c461a9ef421
49 Patch0:         %{name}4-EDITME.patch
50 Patch1:         %{name}4-monitor-EDITME.patch
51 Patch2:         %{name}4-texinfo.patch
52 Patch3:         %{name}4-use_system_pcre.patch
53 Patch4:         %{name}4-Makefile-Default.patch
54 Patch5:         %{name}4-exiscan-pld.patch
55 Patch6:         %{name}-CAN-2005-0021.patch
56 URL:            http://www.exim.org/
57 %{?with_ldap:BuildRequires:     openldap-devel >= 2.0.0}
58 %{?with_spf:BuildRequires:      libspf2-devel}
59 %{?with_srs:BuildRequires:      libsrs_alt-devel >= 0.5}
60 %{?with_mysql:BuildRequires:    mysql-devel}
61 %{?with_pgsql:BuildRequires:    postgresql-devel}
62 %{?with_whoson:BuildRequires:   whoson-devel}
63 %{?with_sasl:BuildRequires:     cyrus-sasl-devel >= 2.1.0}
64 BuildRequires:  XFree86-devel
65 BuildRequires:  db-devel
66 BuildRequires:  openssl-devel >= 0.9.7d
67 BuildRequires:  pam-devel
68 BuildRequires:  pcre-devel
69 BuildRequires:  perl-devel >= 1:5.6.0
70 BuildRequires:  readline-devel
71 BuildRequires:  rpmbuild(macros) >= 1.159
72 BuildRequires:  texinfo
73 PreReq:         rc-scripts
74 Requires(pre):  /bin/id
75 Requires(pre):  /usr/bin/getgid
76 Requires(pre):  /usr/sbin/groupadd
77 Requires(pre):  /usr/sbin/useradd
78 Requires(postun):       /usr/sbin/groupdel
79 Requires(postun):       /usr/sbin/userdel
80 Requires(post): fileutils
81 Requires(post): /bin/hostname
82 Requires(post,preun):   /sbin/chkconfig
83 Requires:       pam >= 0.77.3
84 Requires:       perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION')
85 Provides:       group(exim)
86 Provides:       smtpdaemon
87 Provides:       user(exim)
88 Obsoletes:      courier
89 Obsoletes:      masqmail
90 Obsoletes:      nullmailer
91 Obsoletes:      omta
92 Obsoletes:      postfix
93 Obsoletes:      qmail
94 Obsoletes:      qmail-client
95 Obsoletes:      sendmail
96 Obsoletes:      sendmail-cf
97 Obsoletes:      sendmail-doc
98 Obsoletes:      smail
99 Obsoletes:      smtpdaemon
100 Obsoletes:      ssmtp
101 Obsoletes:      zmailer
102 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
103
104 %description
105 Smail like Mail Transfer Agent with single configuration file.
106 Features: flexible retry algorithms, header & envelope rewriting,
107 multiple deliveries down single connection or multiple deliveries in
108 parallel, regular expressions in configuration parameters, file
109 lookups, supports sender and/or reciever verification, selective
110 relaying, supports virtual domains, built-in mail filtering and can be
111 configured to drop root privilleges when possible.
112
113 %description -l pl
114 Agent transferu poczty (MTA) z pojedynczym plikiem konfiguracyjnym.
115 Jego zalety: ¶wietne algorytmy, mo¿liwo¶æ przepisywania nag³ówków &
116 koperty, wielokrotne dostarczanie poczty podczas jednego po³±czenia
117 lub równoleg³e dostarczanie poczty, wyra¿enia regularne w parametrach
118 konfiguracyjnych, weryfikacja nadawcy i/lub odbiorcy, selektywne
119 relayowanie, wsparcie dla wirtualnych domen, wbudowany system filtrów,
120 mo¿liwo¶æ odrzucania praw roota kiedy jest to mo¿liwe.
121
122 %description -l pt_BR
123 O exim é um agente de transporte de correio eletrônico (MTA),
124 desenvolvido na Universidade de Cambridge para uso em sistemas Unix
125 conectados a Internet. Similar em estilo ao smail 3, suas facilidades
126 são mais extensivas e em particular ele tem opções para verificação do
127 remetente e destinatário, para recusar mensagens de máquinas, redes ou
128 remetentes específicos.
129
130 %package X11
131 Summary:        X11 based Exim administration tool
132 Summary(pl):    Narzêdzia administracyjne exima dla X11
133 Summary(pt_BR): Monitor X11 para o exim
134 Group:          X11/Applications
135
136 %description X11
137 X11 based monitor & administration utility for the Exim Mail Transfer
138 Agent.
139
140 %description X11 -l pl
141 Bazuj±ce na X11 narzêdzia dla Exima - monitor i program
142 administracyjny.
143
144 %description X11 -l pt_BR
145 O monitor exim é um suplemento opcional ao pacote exim. Ele mostra
146 informações sobre o processamento do exim em uma janela X11. O
147 administrador pode executar uma série de ações de controle a partir
148 desta interface.
149
150 %prep
151 %setup -q -a1 -a7
152 %patch0 -p1
153 %patch1 -p1
154 %patch2 -p0
155 %patch3 -p1
156 %patch4 -p1
157 %patch5 -p0
158 %patch6 -p1
159 %{?with_exiscan:test -f %{SOURCE8} || exit 1; bzip2 -d -c %{SOURCE8} | patch -p1 || exit 1}
160 %{?with_saexim:test -f %{SOURCE17} || exit 1; gzip -d -c %{SOURCE17} | tar -x || exit 1}
161
162 install %{SOURCE13} doc/FAQ.txt.bz2
163 install %{SOURCE14} doc/config.samples.tar.bz2
164
165 install -d Local
166 cp -f src/EDITME Local/Makefile
167 cp -f exim_monitor/EDITME Local/eximon.conf
168
169 %build
170
171 %if %{with saexim}
172     cd sa-exim-%{saexim_version}
173     %{__make} -j1 sa-exim.h
174     echo '#define SPAMASSASSIN_CONF "%{_sysconfdir}/mail/spamassassin/local.cf"' >> sa-exim.h
175     cat sa-exim.c > ../src/local_scan.c
176     cat sa-exim.h > ../src/sa-exim.h
177     cd ..
178 %endif
179
180 %{__make} -j1 \
181         CC="%{__cc}" \
182         CFLAGS="%{rpmcflags} %{?with_spf:-DSPF} %{?with_srs:-DSRS}" \
183         LOOKUP_CDB=yes \
184 XLFLAGS=-L%{_prefix}/X11R6/%{_lib} \
185 X11_LD_LIB=%{_prefix}/X11R6/%{_lib} \
186         %{?with_mysql:LOOKUP_MYSQL=yes} \
187         %{?with_pgsql:LOOKUP_PGSQL=yes} \
188         %{?with_whoson:LOOKUP_WHOSON=yes} \
189         %{?with_sasl:AUTH_CYRUS_SASL=yes} \
190         %{?with_ldap:LOOKUP_LDAP=yes LDAP_LIB_TYPE=OPENLDAP2} \
191         LOOKUP_LIBS="%{?with_ldap:-lldap -llber} %{?with_mysql:-lmysqlclient} %{?with_pgsql:-lpq} %{?with_whoson:-lwhoson} %{?with_spf:-lspf2} %{?with_srs:-lsrs_alt} %{?with_sasl:-lsasl2}" \
192         LOOKUP_INCLUDE="%{?with_mysql:-I%{_includedir}/mysql} %{?with_pgsql:-I%{_includedir}/pgsql}"
193
194 makeinfo --force exim-texinfo-*/doc/*.texinfo
195
196 %install
197 rm -rf $RPM_BUILD_ROOT
198 install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail
199 install -d $RPM_BUILD_ROOT/etc/{cron.{daily,weekly},logrotate.d,rc.d/init.d,sysconfig,pam.d}
200 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man8,/usr/lib}
201 install -d $RPM_BUILD_ROOT%{_var}/{spool/exim/{db,input,msglog},log/{archiv,}/exim,mail}
202 install -d $RPM_BUILD_ROOT{%{_infodir},%{_prefix}/X11R6/bin,%{_desktopdir},%{_pixmapsdir}}
203
204 install build-Linux-*/exim{,_fixdb,_tidydb,_dbmbuild,on.bin,_dumpdb,_lock} \
205         build-Linux-*/exi{cyclog,next,what} %{SOURCE10} \
206         build-Linux-*/{exigrep,eximstats,exiqsumm,convert4r4} \
207         util/unknownuser.sh \
208         $RPM_BUILD_ROOT%{_bindir}
209 install build-Linux-*/eximon.bin $RPM_BUILD_ROOT%{_prefix}/X11R6/bin
210 install build-Linux-*/eximon $RPM_BUILD_ROOT%{_prefix}/X11R6/bin
211
212 install %{SOURCE5} .
213 install %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.weekly/
214 install %{SOURCE12} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
215 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
216 install %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
217 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mail/exim.conf
218 install {doc,man}/*.8 $RPM_BUILD_ROOT%{_mandir}/man8/
219 install %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
220 install *.info* $RPM_BUILD_ROOT%{_infodir}/
221 install %{SOURCE15} $RPM_BUILD_ROOT/etc/pam.d/smtp
222
223 %{?with_saexim:install sa-exim-%{saexim_version}/sa-exim.conf $RPM_BUILD_ROOT/%{_sysconfdir}/mail/sa-exim.conf}
224
225 ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/sendmail
226 ln -sf %{_bindir}/exim $RPM_BUILD_ROOT/usr/lib/sendmail
227 ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/mailq
228 ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/rsmtp
229 ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/rmail
230 ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/runq
231
232 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}
233 install %{SOURCE16} $RPM_BUILD_ROOT%{_pixmapsdir}
234
235 touch $RPM_BUILD_ROOT%{_var}/log/exim/{main,reject,panic,process}.log
236
237 %clean
238 rm -rf $RPM_BUILD_ROOT
239
240 %pre
241 if [ -n "`/usr/bin/getgid exim`" ]; then
242         if [ "`/usr/bin/getgid exim`" != 79 ]; then
243                 echo "Warning: group exim haven't gid=79. Correct this before installing exim" 1>&2
244                 exit 1
245         fi
246 else
247         /usr/sbin/groupadd -g 79 exim 1>&2
248 fi
249
250 if [ -n "`/bin/id -u exim 2>/dev/null`" ]; then
251         if [ "`/bin/id -u exim`" != 79 ]; then
252                 echo "Warning: user exim doesn't have uid=79. Correct this before installing exim" 1>&2
253                 exit 1
254         fi
255 else
256         /usr/sbin/useradd -u 79 -d /var/spool/exim -s /bin/false \
257                 -c "Exim pseudo user" -g exim exim 1>&2
258 fi
259
260 %post
261 umask 022
262 /sbin/chkconfig --add %{name}
263 if [ -f /var/lock/subsys/exim ]; then
264         /etc/rc.d/init.d/%{name} restart >&2
265 else
266         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start exim daemon."
267 fi
268
269 if [ ! -f /etc/mail/mailname ]; then
270         rm -f /etc/mail/mailname && hostname -f > /etc/mail/mailname
271         chmod 644 /etc/mail/mailname
272 fi
273 newaliases
274 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
275
276 %preun
277 if [ "$1" = "0" ]; then
278         if [ -f /var/lock/subsys/exim ]; then
279                 /etc/rc.d/init.d/exim stop >&2
280         fi
281         /sbin/chkconfig --del %{name}
282 fi
283
284 %postun
285 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
286 if [ "$1" = "0" ]; then
287         %userremove exim
288         %groupremove exim
289 fi
290
291 %triggerpostun -- exim  < 3.90
292 if [ -f /etc/mail/exim.conf ]; then
293         umask 022
294         mv /etc/mail/exim.conf /etc/mail/exim.conf.3
295         /usr/bin/convert4r4 < /etc/mail/exim.conf.3 > /etc/mail/exim.conf
296 fi
297
298 %files
299 %defattr(644,root,root,755)
300 %doc README* NOTICE LICENCE analyse-log-errors doc/{ChangeLog,NewStuff,dbm.discuss.txt,filter.txt,spec.txt,Exim*.upgrade,OptionLists.txt%{?with_exiscan:,exiscan-*.txt}} build-Linux-*/transport-filter.pl
301 %dir %{_sysconfdir}/mail
302 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/exim.conf
303 %{?with_saexim:%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/sa-exim.conf}
304 %attr(644,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/aliases
305 %attr(644,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/exim
306 %attr(644,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/exim
307 %attr(754,root,root) /etc/rc.d/init.d/exim
308 %attr(4755,root,root) %{_bindir}/exim
309 %attr(770,root,exim) %dir %{_var}/spool/exim
310 %attr(750,exim,exim) %dir %{_var}/spool/exim/db
311 %attr(700,exim,root) %dir %{_var}/spool/exim/input
312 %attr(750,exim,root) %dir %{_var}/spool/exim/msglog
313 %attr(755,root,root) %{_bindir}/exim_*
314 %attr(755,root,root) %{_bindir}/exinext
315 %attr(755,root,root) %{_bindir}/exiwhat
316 %attr(755,root,root) %{_bindir}/exicyclog
317 %attr(755,root,root) %{_bindir}/exigrep
318 %attr(755,root,root) %{_bindir}/eximstats
319 %attr(755,root,root) %{_bindir}/exiqsumm
320 %attr(755,root,root) %{_bindir}/unknownuser.sh
321 %attr(755,root,root) %{_bindir}/newaliases
322 %attr(755,root,root) %{_bindir}/convert4r4
323 %attr(755,root,root) %{_sbindir}/mailq
324 %attr(755,root,root) %{_sbindir}/rmail
325 %attr(755,root,root) %{_sbindir}/rsmtp
326 %attr(755,root,root) %{_sbindir}/runq
327 %attr(755,root,root) %{_sbindir}/sendmail
328 %attr(755,root,root) /usr/lib/sendmail
329 %attr(754,root,root) /etc/cron.weekly/exim.cron.db
330 %attr(750,exim,root) %dir %{_var}/log/exim
331 %attr(750,exim,root) %dir %{_var}/log/archiv/exim
332 %attr(640,exim,root) %ghost %{_var}/log/exim/*
333 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/smtp
334 %{_infodir}/*
335 %{_mandir}/man8/*
336
337 %files X11
338 %defattr(644,root,root,755)
339 %attr(755,root,root) %{_prefix}/X11R6/bin/*
340 %{_desktopdir}/%{name}on.desktop
341 %{_pixmapsdir}/%{name}on.png
This page took 0.062298 seconds and 4 git commands to generate.