]> git.pld-linux.org Git - packages/sendmail.git/blob - sendmail.spec
fd38f2e2b3e14deaaef460e20b43122da7b39450
[packages/sendmail.git] / sendmail.spec
1 Summary:        A widely used Mail Transport Agent (MTA)
2 Summary(pl):    Sendmail -- aplikacja do obs³ugi poczty elektronicznej
3 Name:           sendmail
4 Version:        8.10.1
5 Release:        5
6 License:        BSD
7 Group:          Networking/Daemons
8 Group(pl):      Sieciowe/Serwery
9 Provides:       smtpdaemon
10 Source0:        ftp://ftp.cs.berkeley.edu/ucb/sendmail/%{name}.%{version}.tar.gz
11 Source1:        sendmail.init
12 Source2:        http://www.informatik.uni-kiel.de/%7Eca/email/rules/check.tar
13 Source3:        aliases
14 Source4:        sendmail.sysconfig
15 Source5:        sendmail-8.9.3-etc-mail-Makefile
16 Source6:        sendmail.mc
17 Source7:        sendmail-config.m4
18 Patch0:         sendmail-8.10.0-redhat.patch
19 Patch1:         sendmail-8.10.0-makemapman.patch
20 Patch2:         sendmail-8.10.0-smrsh-paths.patch
21 Patch3:         sendmail-8.8.7-rmail.patch
22 Buildrequires:  cyrus-sasl-devel
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 Prereq:         /sbin/chkconfig
25 Provides:       smtpdaemon
26 Obsoletes:      smtpdaemon
27 Obsoletes:      zmail
28 Obsoletes:      qmail
29 Obsoletes:      smail
30 Obsoletes:      exim
31 Obsoletes:      sendmail-cf
32
33 %description
34 The Sendmail program is a very widely used Mail Transport Agent (MTA).
35 MTAs send mail from one machine to another. Sendmail is not a client
36 program, which you use to read your e-mail. Sendmail is a
37 behind-the-scenes program which actually moves your e-mail over
38 networks or the Internet to where you want it to go.
39
40 If you need documentation on Sendmail, you can install the sendmail-doc
41 package.
42
43 %description -l pl
44 Sendmail jest programem umo¿liwiaj±cym wymianê poczty elektronicznej
45 miêdzy komputerami w sieci internet. Zajmuje siê przekazywaniem poczty
46 elektronicznej miêdzy bramkami pocztowymi i dostarczaniem przesy³ek na
47 konta docelowe. Bardzo dobrze obs³uguje aliasy pocztowe a jego
48 dodatkowym atutem jest prosta konfiguracja. Dziêki rozbudowanym
49 mo¿liwo¶ciom konfiguracyjnym jest w stanie dostarczaæ przesy³ki za
50 po¶rednictwem protoko³ów: SMTP, ESMTP, UUCP, X.400 i innych.
51
52 dokumentacja do programu sendmail znajduje siê w pakiecie sendmail-doc.
53
54 %package doc
55 Summary:        Documentation about the Sendmail Mail Transport Agent program
56 Summary(pl):    Dokumentacja do Sendmaila
57 Group:          Documentation
58 Group(pl):      Dokumentacja
59 Requires:       %{name} = %{version}
60
61 %description doc
62 The sendmail-doc package contains documentation about the Sendmail
63 Mail Transport Agent (MTA) program, including release notes, the
64 Sendmail FAQ and a few papers written about Sendmail. The papers are
65 provided in PostScript(TM) and troff formats.
66
67 Install the sendmail-doc package if you need documentation about
68 Sendmail.
69
70 %description -l pl
71 Ten pakiet zawiera dokumentacjê do programu Sendmail Mail Transport
72 Agent (MTA). Dokumentacja zwawiera informacje o zmianach w bie¿±cej
73 wersji i FAQ - najczêsciej zadawane pytania. Dokumentacja dostêpna jest
74 w formacie PostScript(TM) oraz troff. Je¿eli potrzebujesz dokumentacji
75 - zainstaluj ten pakiet.
76
77 %prep
78 %setup -q
79 %patch0 -p1
80 %patch1 -p1
81 %patch2 -p1
82 %patch3 -p1
83
84 # XXX REVERTING
85 #tar xf $RPM_SOURCE_DIR/check.tar -C cf
86 #chown root.root cf/hack/* cf/README.check
87
88 sed -e 's|@@PATH@@|\.\.|' < %{SOURCE6} > cf/cf/redhat.mc
89
90 install %{SOURCE7} config.m4
91
92 %build
93 export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -DUSE_VENDOR_CF_PATH=1"
94
95 cd sendmail
96 sh Build -f ../config.m4
97 cd ..
98
99 cd mailstats
100 sh Build -f ../config.m4
101 cd ..
102
103 cd rmail
104 sh Build -f ../config.m4
105 cd ..
106
107 cd makemap
108 sh Build -f ../config.m4
109 cd ..
110
111 cd praliases
112 sh Build -f ../config.m4
113 cd ..
114
115 cd smrsh
116 sh Build -f ../config.m4
117 cd ..
118
119 cd cf/cf
120 m4 redhat.mc > redhat.cf
121
122 %install
123 rm -rf $RPM_BUILD_ROOT
124 install -d $RPM_BUILD_ROOT
125
126 cd $RPM_BUILD_ROOT
127 install -d etc/rc.d/init.d etc/rc.d/rc{0,1,2,3,4,5,6}.d etc/sysconfig
128 install -d usr/bin usr/lib usr/man/man{1,5,8} usr/sbin var/log var/spool usr/lib/sendmail-cf
129 cd -
130
131 OBJDIR=obj.$(uname -s).$(uname -r).$(arch)
132
133 %{__make} DESTDIR=$RPM_BUILD_ROOT SBINOWN=`id -nu` UBINOWN=`id -nu` SBINGRP=`id -ng` UBINGRP=`id -ng` MANOWN=`id -nu` MANGRP=`id -ng` \
134  install -C $OBJDIR/sendmail
135 %{__make} DESTDIR=$RPM_BUILD_ROOT SBINOWN=`id -nu` UBINOWN=`id -nu` SBINGRP=`id -ng` UBINGRP=`id -ng` MANOWN=`id -nu` MANGRP=`id -ng` \
136  install -C $OBJDIR/mailstats
137 %{__make} DESTDIR=$RPM_BUILD_ROOT SBINOWN=`id -nu` UBINOWN=`id -nu` SBINGRP=`id -ng` UBINGRP=`id -ng` MANOWN=`id -nu` MANGRP=`id -ng` \
138  install -C $OBJDIR/praliases
139 %{__make} DESTDIR=$RPM_BUILD_ROOT SBINOWN=`id -nu` UBINOWN=`id -nu` SBINGRP=`id -ng` UBINGRP=`id -ng` MANOWN=`id -nu` MANGRP=`id -ng` \
140  force-install -C $OBJDIR/rmail
141 %{__make} DESTDIR=$RPM_BUILD_ROOT SBINOWN=`id -nu` UBINOWN=`id -nu` SBINGRP=`id -ng` UBINGRP=`id -ng` MANOWN=`id -nu` MANGRP=`id -ng` \
142  install -C $OBJDIR/makemap
143 ln -sf ../sbin/makemap $RPM_BUILD_ROOT%{_bindir}/makemap
144 %{__make} DESTDIR=$RPM_BUILD_ROOT SBINOWN=`id -nu` UBINOWN=`id -nu` SBINGRP=`id -ng` UBINGRP=`id -ng` MANOWN=`id -nu` MANGRP=`id -ng` \
145  install -C $OBJDIR/smrsh
146
147 # install docs by hand
148 install -d $RPM_BUILD_ROOT%{_prefix}/doc/sendmail
149 cp -ar FAQ LICENSE KNOWNBUGS README RELEASE_NOTES doc $RPM_BUILD_ROOT%{_prefix}/doc/sendmail
150 cp smrsh/README $RPM_BUILD_ROOT%{_prefix}/doc/sendmail/README.smrsh
151 cp cf/README $RPM_BUILD_ROOT%{_prefix}/doc/sendmail/README.cf
152
153 # install the cf files
154 cd cf
155 cp -ar * $RPM_BUILD_ROOT%{_libdir}/sendmail-cf
156 cd -
157
158 install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail
159
160
161 install cf/cf/redhat.cf $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.cf
162 sed -e 's|@@PATH@@|%{_libdir}/sendmail-cf|' < %{SOURCE6} > $RPM_BUILD_ROOT%{_sysconfdir}/mail/sendmail.mc
163 echo "# local-host-names - include all aliases for your machine here." > $RPM_BUILD_ROOT%{_sysconfdir}/mail/local-host-names
164
165 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_libdir}/sendmail
166 install -d -m755 $RPM_BUILD_ROOT/var/spool/mqueue
167
168 # dangling symlinks
169 for f in hoststat mailq newaliases purgestat
170   do
171     ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/${f}
172   done
173 install -d $RPM_BUILD_ROOT%{_sysconfdir}/smrsh
174
175 cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/mail/access
176 # Check the %{_prefix}/doc/sendmail-%{version}/README.cf file for a description
177 # of the format of this file. (search for access_db in that file)
178 # The %{_prefix}/doc/sendmail-%{version}/README.cf is part of the sendmail-doc
179 # package.
180 #
181 # by default we allow relaying from localhost...
182 localhost.localdomain           RELAY
183 localhost                       RELAY
184 127.0.0.1                       RELAY
185
186 EOF
187 for map in virtusertable access domaintable mailertable
188   do
189 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/${map}
190 makemap hash $RPM_BUILD_ROOT%{_sysconfdir}/mail/${map}.db < $RPM_BUILD_ROOT%{_sysconfdir}/mail/${map}
191   done
192 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/aliases
193 makemap hash $RPM_BUILD_ROOT%{_sysconfdir}/aliases.db < %{SOURCE3}
194
195 install %SOURCE4 $RPM_BUILD_ROOT/etc/sysconfig/sendmail
196 install %SOURCE1 $RPM_BUILD_ROOT/etc/rc.d/init.d/sendmail
197
198 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/mail/Makefile
199
200 chmod u+w $RPM_BUILD_ROOT%{_sbindir}/{mailstats,praliases}
201 chmod u+w $RPM_BUILD_ROOT%{_bindir}/rmail
202
203 strip $RPM_BUILD_ROOT%{_sbindir}/{mailstats,praliases,sendmail}
204 strip $RPM_BUILD_ROOT%{_bindir}/rmail
205
206 %clean
207 rm -rf $RPM_BUILD_ROOT
208
209 %post
210 #
211 # Convert old format to new
212 #
213 if [ -f /etc/mail/deny ] ; then
214     cat /etc/mail/deny | \
215         awk 'BEGIN{ print "# Entries from obsoleted /etc/mail/deny"} \
216                   {print $1" REJECT"}' >> /etc/mail/access
217     cp /etc/mail/deny /etc/mail/deny.rpmorig
218 fi
219 for oldfile in relay_allow ip_allow name_allow ; do
220     if [ -f /etc/mail/$oldfile ] ; then
221         cat /etc/mail/$oldfile | \
222                 awk "BEGIN { print \"# Entries from obsoleted /etc/mail/$oldfile\" ;} \
223              { print $1\" RELAY\" }" >> /etc/mail/access
224         cp /etc/mail/$oldfile /etc/mail/$oldfile.rpmorig
225      fi
226 done
227
228 #
229 # Oops, these files moved
230 #
231 if [ -f /etc/sendmail.cw ] ; then
232     cat /etc/sendmail.cw  | \
233       awk 'BEGIN { print "# Entries from obsoleted /etc/sendmail.cw" ;} \
234            { print $1 }' >> /etc/mail/local-host-names
235     cp /etc/sendmail.cw /etc/sendmail.cw.rpmorig
236 fi
237 #
238 # Rebuild maps (next reboot will rebuild also)
239 #
240 { /usr/bin/newaliases
241   for map in virtusertable access domaintable mailertable
242   do
243     if [ -f /etc/mail/${map} ] ; then
244       /usr/bin/makemap hash /etc/mail/${map} < /etc/mail/${map}
245       sleep 1
246     fi
247   done
248 } > /dev/null 2>&1
249
250 /sbin/chkconfig --add sendmail
251
252 %preun
253 if [ $1 = 0 ]; then
254         /sbin/chkconfig --del sendmail
255 fi
256
257 # removal of compatibility links
258 %triggerpostun -- sendmail < 8.10.1
259 /sbin/chkconfig --add sendmail
260
261 %files
262 %defattr(644,root,root,755)
263 %attr(755,root,root) %{_sbindir}/mailstats
264 %attr(755,root,root) %{_sbindir}/praliases
265 %attr(755,root,root) %{_bindir}/hoststat
266 %attr(755,root,root) %{_bindir}/purgestat
267 %attr(755,root,root) %{_bindir}/rmail
268 %attr(755,root,root) %{_bindir}/makemap
269 %attr(755,root,root) %{_sbindir}/makemap
270 %attr(755,root,root) %{_sbindir}/sendmail
271 %attr(755,root,root) %{_bindir}/newaliases
272 %attr(755,root,root) %{_bindir}/mailq
273 %attr(755,root,root) %{_sbindir}/smrsh
274 %{_libdir}/sendmail
275 %{_libdir}/sendmail-cf
276
277 %{_mandir}/man8/rmail.8*
278 %{_mandir}/man8/praliases.8*
279 %{_mandir}/man8/mailstats.8*
280 %{_mandir}/man8/makemap.8*
281 %{_mandir}/man8/sendmail.8*
282 %{_mandir}/man5/aliases.5*
283 %{_mandir}/man1/newaliases.1*
284 %{_mandir}/man1/mailq.1*
285
286 /var/log/statistics
287 # XXX can't do noreplace here or new sendmail will not deliver.
288 %config %{_sysconfdir}/sendmail.cf
289 %attr(0644,root,root) %config %{_sysconfdir}/mail/sendmail.mc
290 %config(noreplace) %{_sysconfdir}/mail/local-host-names
291 %config(noreplace) %{_sysconfdir}/aliases
292 %attr(0644,root,mail) %ghost %{_sysconfdir}/aliases.db
293 %attr(0755,root,mail) %dir      /var/spool/mqueue
294 %dir %{_sysconfdir}/smrsh
295 %dir %{_sysconfdir}/mail
296
297 %config %{_sysconfdir}/mail/Makefile
298 %ghost %{_sysconfdir}/mail/virtusertable.db
299 %config(noreplace) %{_sysconfdir}/mail/virtusertable
300
301 %ghost %{_sysconfdir}/mail/access.db
302 %config(noreplace) %{_sysconfdir}/mail/access
303
304 %ghost %{_sysconfdir}/mail/domaintable.db
305 %config(noreplace) %{_sysconfdir}/mail/domaintable
306
307 %ghost %{_sysconfdir}/mail/mailertable.db
308 %config(noreplace) %{_sysconfdir}/mail/mailertable
309 %config(noreplace) %{_sysconfdir}/mail/helpfile
310
311 %attr(754,root,root) /etc/rc.d/init.d/sendmail
312 %config(noreplace) /etc/sysconfig/sendmail
313
314 %files doc
315 %defattr(644,root,root,755)
316 %{_prefix}/doc/sendmail
This page took 0.062108 seconds and 3 git commands to generate.