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