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