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