]> git.pld-linux.org Git - packages/sendmail.git/blob - sendmail.spec
- added procmail to requires
[packages/sendmail.git] / sendmail.spec
1 #
2 # Conditional build:
3 # _without_ldap         without LDAP support
4 # _without_tls          without TLS (SSL) support
5
6 Summary:        A widely used Mail Transport Agent (MTA)
7 Summary(de):    sendmail-Mail-Übertragungsagent
8 Summary(fr):    Agent de transport de courrier sendmail
9 Summary(pl):    Sendmail - serwer poczty elektronicznej
10 Summary(tr):    Elektronik posta hizmetleri sunucusu
11 Name:           sendmail
12 Version:        8.12.1
13 Release:        4
14 License:        BSD
15 Group:          Networking/Daemons
16 Group(de):      Netzwerkwesen/Server
17 Group(pl):      Sieciowe/Serwery
18 Source0:        ftp://ftp.sendmail.org/pub/sendmail/%{name}.%{version}.tar.gz
19 Source1:        %{name}.init
20 Source2:        http://www.informatik.uni-kiel.de/~ca/email/rules/check.tar
21 Source3:        aliases
22 Source4:        %{name}.sysconfig
23 Source5:        %{name}-etc-mail-Makefile
24 Source6:        %{name}.mc
25 Source7:        %{name}-config.m4
26 Source8:        %{name}.sasl
27 Patch0:         %{name}-makefile.patch
28 Patch1:         %{name}-makemapman.patch
29 Patch2:         %{name}-smrsh-paths.patch
30 Patch3:         %{name}-rmail.patch
31 Patch4:         %{name}-os-paths.patch
32 Patch5:         %{name}-m4path.patch
33 Patch6:         %{name}-dtelnet.patch
34 Patch7:         %{name}-pld.mc.patch
35 Patch8:         %{name}-redirect.patch
36 Patch9:         %{name}-hprescan-dos.patch
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 BuildRequires:  cyrus-sasl-devel
39 BuildRequires:  db3-devel
40 %{!?_without_ldap:BuildRequires:        openldap-devel}
41 %{!?_without_tls:BuildRequires: openssl-devel}
42 Requires:       m4
43 Requires:       procmail
44 PreReq:         /sbin/chkconfig
45 PreReq:         /usr/sbin/groupadd
46 PreReq:         /usr/sbin/useradd
47 PreReq:         /usr/sbin/groupdel
48 PreReq:         /usr/sbin/userdel
49 Requires(pre):  /usr/bin/getgid
50 Requires(pre):  /bin/id
51 Requires(post): awk
52 Requires(post): textutils
53 Provides:       smtpdaemon
54 Obsoletes:      smtpdaemon
55 Obsoletes:      exim
56 Obsoletes:      masqmail
57 Obsoletes:      omta
58 Obsoletes:      postfix
59 Obsoletes:      qmail
60 Obsoletes:      sendmail-cf
61 Obsoletes:      sendmail-doc
62 Obsoletes:      smail
63 Obsoletes:      zmailer
64
65 %define         _sysconfdir     /etc/mail
66
67 %description
68 The Sendmail program is a very widely used Mail Transport Agent (MTA).
69 MTAs send mail from one machine to another. Sendmail is not a client
70 program, which you use to read your e-mail. Sendmail is a
71 behind-the-scenes program which actually moves your e-mail over
72 networks or the Internet to where you want it to go.
73
74 %description -l de
75 Sendmail überträgt Mails zwischen Rechnern. Es implementiert eine
76 allgemeine Mail-Routing-Funktion über das Netzwerk mit Aliasing und
77 Weiterleiten von Nachrichten, automatischem Routing an
78 Netzwerk-Gateways und flexible Konfiguration. Wenn Sie E-Mails über
79 das Internet senden und empfangen möchten, brauchen Sie sendmail.
80
81 %description -l fr
82 Sendmail est un agent de transport de courrier, qui est le programme
83 transférent le courrier d'une machine à l'autre. Sendmail implémente
84 une facilité générale de routage de courrier entre les réseaux, permet
85 l'\"aliasing\" et le \"forwarding\", un routage automatique sur les
86 passerelles du réseau, et une configuration flexible.
87
88 %description -l pl
89 Sendmail jest programem umo¿liwiaj±cym wymianê poczty elektronicznej
90 miêdzy komputerami w sieci (MTA). Zajmuje siê przekazywaniem poczty
91 elektronicznej miêdzy bramkami pocztowymi i dostarczaniem przesy³ek na
92 konta docelowe. Bardzo dobrze obs³uguje aliasy pocztowe a jego
93 dodatkowym atutem jest prosta konfiguracja. Dziêki rozbudowanym
94 mo¿liwo¶ciom konfiguracyjnym jest w stanie dostarczaæ przesy³ki za
95 po¶rednictwem protoko³ów: SMTP, ESMTP, UUCP, X.400 i innych.
96
97 %description -l tr
98 Sendmail, bir mektubu bir makineden diðerine taþýr. Pek çok davranýþý
99 ayarlanabilir. Internet üzerinden mektup almak veya göndermek
100 istiyorsanýz bu pakete gereksiniminiz olacaktýr.
101
102 %prep
103 %setup -q
104 %patch0 -p1
105 %patch1 -p1
106 %patch2 -p1
107 %patch3 -p1
108 %patch4 -p1
109 %patch5 -p1
110 %patch6 -p1
111 %patch7 -p1
112 %patch8 -p1
113 %patch9 -p1
114
115 # seems to be obsoleted...
116 #tar xf %{SOURCE2} -C cf
117
118 sed -e 's|@@PATH@@|\.\.|' < %{SOURCE6} > cf/cf/redhat.mc
119
120 install %{SOURCE7} config.m4
121
122 %build
123 %if %{?debug:0}%{!?debug:1}
124 echo "define(\`confLDOPTS', \`-s')" >> config.m4
125 %endif
126 %if %{?_without_ldap:0}%{!?_without_ldap:1}
127 echo "APPENDDEF(\`confMAPDEF', \`-DLDAPMAP')" >> config.m4
128 echo "APPENDDEF(\`confLIBS', \`-lldap -llber')" >> config.m4
129 %endif
130 %if %{?_without_tls:0}%{!?_without_tls:1}
131 echo "APPENDDEF(\`confENVDEF', \`-DSTARTTLS')" >> config.m4
132 echo "APPENDDEF(\`confLIBS', \`-lssl -lcrypto')" >> config.m4
133 %endif
134
135 RPM_OPT_FLAGS="%{rpmcflags} -DUSE_VENDOR_CF_PATH=1 -DNETINET6"
136 export RPM_OPT_FLAGS
137
138 cd sendmail     && sh Build -f ../config.m4
139 cd ../mailstats && sh Build -f ../config.m4
140 cd ../rmail     && sh Build -f ../config.m4
141 cd ../makemap   && sh Build -f ../config.m4
142 cd ../praliases && sh Build -f ../config.m4
143 cd ../smrsh     && sh Build -f ../config.m4
144 cd ../cf/cf
145 m4 redhat.mc > redhat.cf
146
147 %install
148 rm -rf $RPM_BUILD_ROOT
149 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,sasl,smrsh}} \
150         $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_sbindir} $RPM_BUILD_ROOT%{_libdir} \
151         $RPM_BUILD_ROOT%{_mandir}/man{1,5,8} \
152         $RPM_BUILD_ROOT/var/log $RPM_BUILD_ROOT/var/spool/mqueue \
153         $RPM_BUILD_ROOT%{_libdir}/sendmail-cf \
154
155 OBJDIR=obj.$(uname -s).$(uname -r).$(arch)
156
157 IDNU=`id -nu`
158 IDNG=`id -ng`
159 SMINSTOPT="DESTDIR=$RPM_BUILD_ROOT SBINOWN=$IDNU SBINGRP=$IDNG \
160         UBINOWN=$IDNU UBINGRP=$IDNG MANOWN=$IDNU MANGRP=$IDNG \
161         CFOWN=$IDNU CFGRP=$IDNG MSPQOWN=$IDNU GBINGRP=$IDNG GBINOWN=$IDNU \
162         BINOWN=$IDNU BINGRP=$IDNG"
163 %{__make} $SMINSTOPT install -C $OBJDIR/sendmail
164 %{__make} $SMINSTOPT install -C $OBJDIR/mailstats
165 %{__make} $SMINSTOPT install -C $OBJDIR/praliases
166 %{__make} $SMINSTOPT force-install -C $OBJDIR/rmail
167 %{__make} $SMINSTOPT install -C $OBJDIR/makemap
168 ln -sf ../sbin/makemap $RPM_BUILD_ROOT%{_bindir}/makemap
169 %{__make} $SMINSTOPT install -C $OBJDIR/smrsh
170
171 # install the cf files
172 cd cf
173 rm -f cf/{Build,Makefile} feature/*~
174 cp -ar * $RPM_BUILD_ROOT%{_libdir}/sendmail-cf
175 cd -
176
177 # sendmail.{cf,mc}
178 install cf/cf/redhat.cf $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.cf
179 sed -e 's|@@PATH@@|%{_libdir}/sendmail-cf|' < %{SOURCE6} \
180         > $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.mc
181
182 # submit.mc (submit.cf is installed automatically)
183 install cf/cf/submit.mc $RPM_BUILD_ROOT%{_sysconfdir}
184
185 echo "# local-host-names - include all aliases for your machine here." \
186         > $RPM_BUILD_ROOT%{_sysconfdir}/local-host-names
187
188 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_libdir}/sendmail
189
190 # dangling symlinks
191 for f in hoststat mailq newaliases purgestat ; do
192         ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/${f}
193 done
194
195 cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/access
196 # Check the %{_prefix}/doc/sendmail-%{version}/README.cf file for a description
197 # of the format of this file. (search for access_db in that file)
198 # The %{_prefix}/doc/sendmail-%{version}/README.cf is part of the sendmail-doc
199 # package.
200 #
201 # by default we allow relaying from localhost...
202 localhost.localdomain           RELAY
203 localhost                       RELAY
204 127.0.0.1                       RELAY
205 EOF
206
207 for map in virtusertable access domaintable mailertable ; do
208         touch $RPM_BUILD_ROOT%{_sysconfdir}/${map}
209         $RPM_BUILD_ROOT%{_bindir}/makemap -C $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.cf hash \
210                 $RPM_BUILD_ROOT%{_sysconfdir}/${map}.db < $RPM_BUILD_ROOT%{_sysconfdir}/${map}
211 done
212
213 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/aliases
214 $RPM_BUILD_ROOT%{_bindir}/makemap -C $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.cf hash \
215         $RPM_BUILD_ROOT%{_sysconfdir}/aliases.db < %{SOURCE3}
216
217 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/sendmail
218 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/sendmail
219 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/Makefile
220 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sasl/Sendmail.conf
221
222 mv -f smrsh/README README.smrsh
223 mv -f cf/README README.cf
224 mv -f doc/op/op.me .
225
226 gzip -9nf FAQ KNOWNBUGS README* op.me RELEASE_NOTES
227
228 %clean
229 rm -rf $RPM_BUILD_ROOT
230
231 %pre
232 if [ -n "`/usr/bin/getgid smmsp`" ]; then
233         if [ "`/usr/bin/getgid smmsp`" != "25" ]; then
234                 echo "Warning: group smmsp haven't gid=25. Correct this before installing sendmail." 1>&2
235                 exit 1
236         fi
237 else
238         /usr/sbin/groupadd -g 25 -r -f smmsp
239 fi
240 if [ -n "`/bin/id -u smmsp 2>/dev/null`" ]; then
241         if [ "`/bin/id -u smmsp`" != "25" ]; then
242                 echo "Warning: user smmsp haven't uid=25. Correct this before installing sendmail." 1>&2
243                 exit 1
244         fi
245 else
246         /usr/sbin/useradd -u 25 -r -d /var/spool/clientqueue -s /bin/false -c "Sendmail Message Submission Program" -g smmsp smmsp 1>&2
247 fi
248
249 %post
250 #
251 # Convert old format to new
252 #
253 if [ -f /etc/mail/deny ] ; then
254         cat /etc/mail/deny | \
255                 awk 'BEGIN{ print "# Entries from obsoleted /etc/mail/deny"} \
256                 {print $1" REJECT"}' >> /etc/mail/access
257         cp -f /etc/mail/deny /etc/mail/deny.rpmorig
258 fi
259 for oldfile in relay_allow ip_allow name_allow ; do
260         if [ -f /etc/mail/$oldfile ] ; then
261                 cat /etc/mail/$oldfile | \
262                         awk "BEGIN { print \"# Entries from obsoleted /etc/mail/$oldfile\" ;} \
263                         { print $1\" RELAY\" }" >> /etc/mail/access
264                 cp -f /etc/mail/$oldfile /etc/mail/$oldfile.rpmorig
265         fi
266 done
267
268 #
269 # Oops, these files moved
270 #
271 if [ -f /etc/sendmail.cw ] ; then
272         cat /etc/sendmail.cw | \
273                 awk 'BEGIN { print "# Entries from obsoleted /etc/sendmail.cw" ;} \
274                 { print $1 }' >> /etc/mail/local-host-names
275         cp -f /etc/sendmail.cw /etc/sendmail.cw.rpmorig
276 fi
277 #
278 # Rebuild maps (next reboot will rebuild also)
279 #
280 { /usr/bin/newaliases
281  for map in virtusertable access domaintable mailertable; do
282         if [ -f /etc/mail/${map} ] ; then
283                 /usr/bin/makemap hash /etc/mail/${map} < /etc/mail/${map}
284                 sleep 1
285         fi
286  done
287 } > /dev/null 2>&1
288
289 /sbin/chkconfig --add sendmail
290 if [ -f /var/lock/subsys/sendmail ]; then
291         /etc/rc.d/init.d/sendmail restart >&2
292 else
293         echo "Run \"/etc/rc.d/init.d/sendmail start\" to start sendmail daemon." >&2
294 fi
295
296 %preun
297 if [ "$1" = "0" ]; then
298         if [ -f /var/lock/subsys/sendmail ]; then
299                 /etc/rc.d/init.d/sendmail stop >&2
300         fi
301         /sbin/chkconfig --del sendmail
302 fi
303
304 %postun
305 if [ "$1" = "0" ]; then
306         /usr/sbin/userdel smmsp 2>/dev/null
307         /usr/sbin/groupdel smmsp 2>/dev/null
308 fi
309
310 # removal of compatibility links
311 %triggerpostun -- sendmail < 8.10.1
312 /sbin/chkconfig --add sendmail
313
314 %files
315 %defattr(644,root,root,755)
316 %doc *.gz
317 %attr(755,root,root) %{_sbindir}/mailstats
318 %attr(755,root,root) %{_sbindir}/praliases
319 %attr(755,root,root) %{_bindir}/hoststat
320 %attr(755,root,root) %{_bindir}/purgestat
321 %attr(755,root,root) %{_bindir}/rmail
322 %attr(755,root,root) %{_bindir}/makemap
323 %attr(755,root,root) %{_sbindir}/makemap
324 %attr(2755,root,smmsp) %{_sbindir}/sendmail
325 %attr(755,root,root) %{_bindir}/newaliases
326 %attr(755,root,root) %{_bindir}/mailq
327 %attr(755,root,root) %{_sbindir}/smrsh
328 %{_libdir}/sendmail
329
330 %{_mandir}/man8/rmail.8*
331 %{_mandir}/man8/praliases.8*
332 %{_mandir}/man8/mailstats.8*
333 %{_mandir}/man8/makemap.8*
334 %{_mandir}/man8/sendmail.8*
335 %{_mandir}/man5/aliases.5*
336 %{_mandir}/man1/newaliases.1*
337 %{_mandir}/man1/mailq.1*
338
339 %dir /etc/smrsh
340 %dir %{_sysconfdir}
341 /var/log/statistics
342 # XXX can't do noreplace here or new sendmail will not deliver.
343 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sendmail.cf
344 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sendmail.mc
345 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/submit.cf
346 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/submit.mc
347 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/local-host-names
348 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/aliases
349 %attr(0644,root,mail) %ghost %{_sysconfdir}/aliases.db
350 %attr(0770,root,smmsp) %dir /var/spool/clientmqueue
351 %attr(0750,root,mail) %dir /var/spool/mqueue
352
353 %config %{_sysconfdir}/Makefile
354 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/access
355 %ghost %{_sysconfdir}/access.db
356 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/domaintable
357 %ghost %{_sysconfdir}/domaintable.db
358 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/mailertable
359 %ghost %{_sysconfdir}/mailertable.db
360 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/virtusertable
361 %ghost %{_sysconfdir}/virtusertable.db
362 %config(noreplace) %{_sysconfdir}/helpfile
363
364 %attr(754,root,root) /etc/rc.d/init.d/sendmail
365 %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/sendmail
366 %config(noreplace) %verify(not md5 size mtime) /etc/sasl/Sendmail.conf
367
368 %dir %{_libdir}/sendmail-cf
369 %dir %{_libdir}/sendmail-cf/cf
370 %{_libdir}/sendmail-cf/cf/pld.mc
371 %{_libdir}/sendmail-cf/feature
372 %{_libdir}/sendmail-cf/m4
373 %{_libdir}/sendmail-cf/mailer
374 %dir %{_libdir}/sendmail-cf/ostype
375 %{_libdir}/sendmail-cf/ostype/linux.m4
376 %dir %{_libdir}/sendmail-cf/sh
377 %{_libdir}/sendmail-cf/sh/makeinfo.sh
378 %{_libdir}/sendmail-cf/siteconfig
This page took 3.975345 seconds and 4 git commands to generate.