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