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