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