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