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