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