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