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