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