]> git.pld-linux.org Git - packages/sendmail.git/blob - sendmail.spec
- forgotten: release 2
[packages/sendmail.git] / sendmail.spec
1 #
2 # Conditional build:
3 # _without_ldap         without LDAP support
4 # _without_tls          without TLS (SSL) support
5 # _with_auth            with AUTH support
6
7 Summary:        A widely used Mail Transport Agent (MTA)
8 Summary(de):    sendmail-Mail-Übertragungsagent
9 Summary(fr):    Agent de transport de courrier sendmail
10 Summary(pl):    Sendmail - serwer poczty elektronicznej
11 Summary(tr):    Elektronik posta hizmetleri sunucusu
12 Name:           sendmail
13 Version:        8.12.2
14 Release:        2
15 License:        BSD
16 Group:          Networking/Daemons
17 Source0:        ftp://ftp.sendmail.org/pub/sendmail/%{name}.%{version}.tar.gz
18 Source1:        %{name}.init
19 Source2:        http://www.informatik.uni-kiel.de/~ca/email/rules/check.tar
20 Source3:        aliases
21 Source4:        %{name}.sysconfig
22 Source5:        %{name}-etc-mail-Makefile
23 Source6:        %{name}.mc
24 Source7:        %{name}-config.m4
25 Source8:        %{name}.sasl
26 Patch0:         %{name}-makemapman.patch
27 Patch1:         %{name}-smrsh-paths.patch
28 Patch2:         %{name}-rmail.patch
29 Patch3:         %{name}-os-paths.patch
30 Patch4:         %{name}-m4path.patch
31 Patch5:         %{name}-dtelnet.patch
32 Patch6:         %{name}-pld.mc.patch
33 Patch7:         %{name}-redirect.patch
34 Patch8:         %{name}-hprescan-dos.patch
35 Patch9:         %{name}-auth.patch
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 BuildRequires:  cyrus-sasl-devel
38 BuildRequires:  db3-devel
39 %{!?_without_ldap:BuildRequires:        openldap-devel}
40 %{!?_without_tls:BuildRequires: openssl-devel}
41 Requires:       m4
42 Requires:       procmail
43 %{?_with_auth:Requires: cyrus-sasl-plain}
44 PreReq:         /sbin/chkconfig
45 Requires(pre):  /bin/id
46 Requires(pre):  /usr/bin/getgid
47 Requires(pre):  /usr/sbin/groupadd
48 Requires(pre):  /usr/sbin/useradd
49 Requires(post): awk
50 Requires(post): textutils
51 Requires(postun):       /usr/sbin/groupdel
52 Requires(postun):       /usr/sbin/userdel
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 %if %{?_with_auth:1}%{!?_with_auth:0}
114 patch -p0 %{SOURCE6} %{PATCH9}
115 %endif
116
117 # seems to be obsoleted...
118 #tar xf %{SOURCE2} -C cf
119
120 sed -e 's|@@PATH@@|\.\.|' < %{SOURCE6} > cf/cf/redhat.mc
121
122 install %{SOURCE7} config.m4
123
124 %build
125 %if %{?debug:0}%{!?debug:1}
126 echo "define(\`confLDOPTS', \`-s')" >> config.m4
127 %endif
128 %if %{?_without_ldap:0}%{!?_without_ldap:1}
129 echo "APPENDDEF(\`confMAPDEF', \`-DLDAPMAP')" >> config.m4
130 echo "APPENDDEF(\`confLIBS', \`-lldap -llber')" >> config.m4
131 %endif
132 %if %{?_without_tls:0}%{!?_without_tls:1}
133 echo "APPENDDEF(\`confENVDEF', \`-DSTARTTLS')" >> config.m4
134 echo "APPENDDEF(\`confLIBS', \`-lssl -lcrypto')" >> config.m4
135 %endif
136
137 RPM_OPT_FLAGS="%{rpmcflags} -DUSE_VENDOR_CF_PATH=1 -DNETINET6"
138 export RPM_OPT_FLAGS
139
140 cd sendmail     && sh Build -f ../config.m4
141 cd ../mailstats && sh Build -f ../config.m4
142 cd ../rmail     && sh Build -f ../config.m4
143 cd ../makemap   && sh Build -f ../config.m4
144 cd ../praliases && sh Build -f ../config.m4
145 cd ../smrsh     && sh Build -f ../config.m4
146 cd ../cf/cf
147 m4 redhat.mc > redhat.cf
148
149 %install
150 rm -rf $RPM_BUILD_ROOT
151 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,sasl,smrsh}} \
152         $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_sbindir} $RPM_BUILD_ROOT%{_libdir} \
153         $RPM_BUILD_ROOT%{_mandir}/man{1,5,8} \
154         $RPM_BUILD_ROOT/var/log $RPM_BUILD_ROOT/var/spool/mqueue \
155         $RPM_BUILD_ROOT%{_libdir}/sendmail-cf \
156
157 OBJDIR=obj.$(uname -s).$(uname -r).$(arch)
158
159 IDNU=`id -nu`
160 IDNG=`id -ng`
161 SMINSTOPT="DESTDIR=$RPM_BUILD_ROOT SBINOWN=$IDNU SBINGRP=$IDNG \
162         UBINOWN=$IDNU UBINGRP=$IDNG MANOWN=$IDNU MANGRP=$IDNG \
163         CFOWN=$IDNU CFGRP=$IDNG MSPQOWN=$IDNU GBINGRP=$IDNG GBINOWN=$IDNU \
164         BINOWN=$IDNU BINGRP=$IDNG"
165 %{__make} $SMINSTOPT install -C $OBJDIR/sendmail
166 %{__make} $SMINSTOPT install -C $OBJDIR/mailstats
167 %{__make} $SMINSTOPT install -C $OBJDIR/praliases
168 %{__make} $SMINSTOPT force-install -C $OBJDIR/rmail
169 %{__make} $SMINSTOPT install -C $OBJDIR/makemap
170 ln -sf ../sbin/makemap $RPM_BUILD_ROOT%{_bindir}/makemap
171 %{__make} $SMINSTOPT install -C $OBJDIR/smrsh
172
173 # install the cf files
174 cd cf
175 rm -f cf/{Build,Makefile} feature/*~
176 cp -ar * $RPM_BUILD_ROOT%{_libdir}/sendmail-cf
177 cd -
178
179 # sendmail.{cf,mc}
180 install cf/cf/redhat.cf $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.cf
181 sed -e 's|@@PATH@@|%{_libdir}/sendmail-cf|' < %{SOURCE6} \
182         > $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.mc
183
184 # submit.mc (submit.cf is installed automatically)
185 install cf/cf/submit.mc $RPM_BUILD_ROOT%{_sysconfdir}
186
187 echo "# local-host-names - include all aliases for your machine here." \
188         > $RPM_BUILD_ROOT%{_sysconfdir}/local-host-names
189
190 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_libdir}/sendmail
191
192 # dangling symlinks
193 for f in hoststat mailq newaliases purgestat ; do
194         ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/${f}
195 done
196
197 cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/access
198 # Check the %{_prefix}/doc/sendmail-%{version}/README.cf file for a description
199 # of the format of this file. (search for access_db in that file)
200 # The %{_prefix}/doc/sendmail-%{version}/README.cf is part of the sendmail-doc
201 # package.
202 #
203 # by default we allow relaying from localhost...
204 localhost.localdomain           RELAY
205 localhost                       RELAY
206 127.0.0.1                       RELAY
207 EOF
208
209 for map in virtusertable access domaintable mailertable ; do
210         touch $RPM_BUILD_ROOT%{_sysconfdir}/${map}
211         $RPM_BUILD_ROOT%{_bindir}/makemap -C $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.cf hash \
212                 $RPM_BUILD_ROOT%{_sysconfdir}/${map}.db < $RPM_BUILD_ROOT%{_sysconfdir}/${map}
213 done
214
215 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/aliases
216 $RPM_BUILD_ROOT%{_bindir}/makemap -C $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.cf hash \
217         $RPM_BUILD_ROOT%{_sysconfdir}/aliases.db < %{SOURCE3}
218
219 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/sendmail
220 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/sendmail
221 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/Makefile
222 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sasl/Sendmail.conf
223
224 mv -f smrsh/README README.smrsh
225 mv -f cf/README README.cf
226 mv -f doc/op/op.me .
227
228 gzip -9nf FAQ KNOWNBUGS README* op.me RELEASE_NOTES
229
230 %clean
231 rm -rf $RPM_BUILD_ROOT
232
233 %pre
234 if [ -n "`/usr/bin/getgid smmsp`" ]; then
235         if [ "`/usr/bin/getgid smmsp`" != "25" ]; then
236                 echo "Warning: group smmsp haven't gid=25. Correct this before installing sendmail." 1>&2
237                 exit 1
238         fi
239 else
240         /usr/sbin/groupadd -g 25 -r -f smmsp
241 fi
242 if [ -n "`/bin/id -u smmsp 2>/dev/null`" ]; then
243         if [ "`/bin/id -u smmsp`" != "25" ]; then
244                 echo "Warning: user smmsp haven't uid=25. Correct this before installing sendmail." 1>&2
245                 exit 1
246         fi
247 else
248         /usr/sbin/useradd -u 25 -r -d /var/spool/clientqueue -s /bin/false -c "Sendmail Message Submission Program" -g smmsp smmsp 1>&2
249 fi
250
251 %post
252 #
253 # Convert old format to new
254 #
255 if [ -f /etc/mail/deny ] ; then
256         cat /etc/mail/deny | \
257                 awk 'BEGIN{ print "# Entries from obsoleted /etc/mail/deny"} \
258                 {print $1" REJECT"}' >> /etc/mail/access
259         mv -f /etc/mail/deny /etc/mail/deny.rpmorig
260 fi
261 for oldfile in relay_allow ip_allow name_allow ; do
262         if [ -f /etc/mail/$oldfile ] ; then
263                 cat /etc/mail/$oldfile | \
264                         awk "BEGIN { print \"# Entries from obsoleted /etc/mail/$oldfile\" ;} \
265                         { print $1\" RELAY\" }" >> /etc/mail/access
266                 mv -f /etc/mail/$oldfile /etc/mail/$oldfile.rpmorig
267         fi
268 done
269
270 #
271 # Oops, these files moved
272 #
273 if [ -f /etc/sendmail.cw ] ; then
274         cat /etc/sendmail.cw | \
275                 awk 'BEGIN { print "# Entries from obsoleted /etc/sendmail.cw" ;} \
276                 { print $1 }' >> /etc/mail/local-host-names
277         mv -f /etc/sendmail.cw /etc/sendmail.cw.rpmorig
278 fi
279 #
280 # Rebuild maps (next reboot will rebuild also)
281 #
282 { /usr/bin/newaliases
283  for map in virtusertable access domaintable mailertable; do
284         if [ -f /etc/mail/${map} ] ; then
285                 /usr/bin/makemap hash /etc/mail/${map} < /etc/mail/${map}
286                 sleep 1
287         fi
288  done
289 } > /dev/null 2>&1
290
291 /sbin/chkconfig --add sendmail
292 if [ -f /var/lock/subsys/sendmail ]; then
293         /etc/rc.d/init.d/sendmail restart >&2
294 else
295         echo "Run \"/etc/rc.d/init.d/sendmail start\" to start sendmail daemon." >&2
296 fi
297
298 %preun
299 if [ "$1" = "0" ]; then
300         if [ -f /var/lock/subsys/sendmail ]; then
301                 /etc/rc.d/init.d/sendmail stop >&2
302         fi
303         /sbin/chkconfig --del sendmail
304 fi
305
306 %postun
307 if [ "$1" = "0" ]; then
308         /usr/sbin/userdel smmsp 2>/dev/null
309         /usr/sbin/groupdel smmsp 2>/dev/null
310 fi
311
312 # removal of compatibility links
313 %triggerpostun -- sendmail < 8.10.1
314 /sbin/chkconfig --add sendmail
315
316 %files
317 %defattr(644,root,root,755)
318 %doc *.gz
319 %attr(755,root,root) %{_sbindir}/mailstats
320 %attr(755,root,root) %{_sbindir}/praliases
321 %attr(755,root,root) %{_bindir}/hoststat
322 %attr(755,root,root) %{_bindir}/purgestat
323 %attr(755,root,root) %{_bindir}/rmail
324 %attr(755,root,root) %{_bindir}/makemap
325 %attr(755,root,root) %{_sbindir}/makemap
326 %attr(2755,root,smmsp) %{_sbindir}/sendmail
327 %attr(755,root,root) %{_bindir}/newaliases
328 %attr(755,root,root) %{_bindir}/mailq
329 %attr(755,root,root) %{_sbindir}/smrsh
330 %{_libdir}/sendmail
331
332 %{_mandir}/man8/rmail.8*
333 %{_mandir}/man8/praliases.8*
334 %{_mandir}/man8/mailstats.8*
335 %{_mandir}/man8/makemap.8*
336 %{_mandir}/man8/sendmail.8*
337 %{_mandir}/man5/aliases.5*
338 %{_mandir}/man1/newaliases.1*
339 %{_mandir}/man1/mailq.1*
340
341 %dir /etc/smrsh
342 %dir %{_sysconfdir}
343 /var/log/statistics
344 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sendmail.cf
345 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sendmail.mc
346 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/submit.cf
347 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/submit.mc
348 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/local-host-names
349 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/aliases
350 %attr(0644,root,mail) %ghost %{_sysconfdir}/aliases.db
351 %attr(0770,root,smmsp) %dir /var/spool/clientmqueue
352 %attr(0750,root,mail) %dir /var/spool/mqueue
353
354 %config %{_sysconfdir}/Makefile
355 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/access
356 %ghost %{_sysconfdir}/access.db
357 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/domaintable
358 %ghost %{_sysconfdir}/domaintable.db
359 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/mailertable
360 %ghost %{_sysconfdir}/mailertable.db
361 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/virtusertable
362 %ghost %{_sysconfdir}/virtusertable.db
363 %config(noreplace) %{_sysconfdir}/helpfile
364
365 %attr(754,root,root) /etc/rc.d/init.d/sendmail
366 %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/sendmail
367 %config(noreplace) %verify(not md5 size mtime) /etc/sasl/Sendmail.conf
368
369 %dir %{_libdir}/sendmail-cf
370 %dir %{_libdir}/sendmail-cf/cf
371 %{_libdir}/sendmail-cf/cf/pld.mc
372 %{_libdir}/sendmail-cf/feature
373 %{_libdir}/sendmail-cf/m4
374 %{_libdir}/sendmail-cf/mailer
375 %dir %{_libdir}/sendmail-cf/ostype
376 %{_libdir}/sendmail-cf/ostype/linux.m4
377 %dir %{_libdir}/sendmail-cf/sh
378 %{_libdir}/sendmail-cf/sh/makeinfo.sh
379 %{_libdir}/sendmail-cf/siteconfig
This page took 0.052012 seconds and 3 git commands to generate.