]> git.pld-linux.org Git - packages/zmailer.git/blob - zmailer.spec
replace R /etc/cron.d with crondaemon
[packages/zmailer.git] / zmailer.spec
1 # TODO
2 # - missing service restart
3 # - check locale settings in %post
4 # Conditional build:
5 %bcond_without  whoson  # build without WHOSON support
6 %bcond_without  ldap    # build without LDAP support
7 %bcond_without  gdbm    # build without GDBM support
8
9 Summary:        Secure Mailer for Extreme Performance Demands
10 Summary(pl.UTF-8):      Bezpieczny MTA dla Wymagających Ekstremalnej Wydajności
11 Name:           zmailer
12 Version:        2.99.57
13 Release:        2
14 License:        GPL
15 Group:          Networking/Daemons
16 Source0:        ftp://ftp.funet.fi/pub/unix/mail/zmailer/src/%{name}-%{version}.tar.gz
17 # Source0-md5:  abe451575234ac5ce79d9b950b150986
18 Source1:        %{name}-pl.txt
19 Source2:        forms-pl-0.4.tar.gz
20 # Source2-md5:  c4ca963cd941e3ac533860d7d3d9f4b1
21 Source3:        %{name}.logrotate
22 Patch0:         %{name}-config.diff
23 Patch1:         %{name}-glibc.patch
24 URL:            http://www.zmailer.org/
25 BuildRequires:  autoconf
26 BuildRequires:  automake
27 BuildRequires:  db-devel
28 BuildRequires:  ed
29 %{?with_gdbm:BuildRequires:     gdbm-devel}
30 BuildRequires:  libwrap-devel
31 %{?with_ldap:BuildRequires:     openldap-devel >= 2.4.6}
32 BuildRequires:  openssl-devel >= 0.9.7d
33 BuildRequires:  pam-devel
34 BuildRequires:  perl-devel
35 BuildRequires:  rpmbuild(macros) >= 1.268
36 %{?with_whoson:BuildRequires:   whoson-devel}
37 Requires(post): fileutils
38 Requires(post): grep
39 Requires(post): net-tools
40 Requires(post): textutils
41 Requires(post,preun):   /sbin/chkconfig
42 Requires(postun):       /usr/sbin/groupdel
43 Requires(pre):  grep
44 Requires:       crondaemon
45 Requires:       logrotate >= 2.4
46 Requires:       rc-scripts
47 %{?with_whoson:Requires:        whoson >= 1.08}
48 Provides:       group(zmailer)
49 Provides:       smtpdaemon
50 Obsoletes:      smtpdaemon
51 Conflicts:      logrotate < 3.7-4
52 Conflicts:      vacation
53 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
55 %description
56 This is a package that implements an internet message transfer agent
57 called ZMailer. It is intended for gateways or mail servers or other
58 large site environments that have extreme demands on the abilities of
59 the mailer. It was motivated by the problems of the Sendmail design in
60 such situations. Zmailer is one of the mailers able to deal with huge
61 quantities of mail and is more efficient any other mailer, qmail
62 included. It supports IPv6, WHOSON, SSL and TLS protocol.
63
64 %description -l pl.UTF-8
65 Ten pakiet zawiera implementację agenta transportu wiadomości
66 internetowych o nazwie ZMailer. ZMailer przeznaczony jest dla bramek,
67 serwerów poczty lub innych środowisk wymagających niezwykłych
68 możliwości od mailera. Motywacją dla ZMailera były problemy z
69 Sendmailem w trudnych sytuacjach. ZMailer jest jednym z tych mailerów,
70 które potrafią dać sobie radę z ogromną ilością poczty. Ponadto
71 ZMailer jest bardziej wydajny od innych mailerów włączając w to
72 qmaila. Kolejną zaletą jest wsparcie dla protokołu IPv6, WHOSON, SSL
73 oraz TLS.
74
75 %package devel
76 Summary:        Static library and header file for zmailer
77 Summary(pl.UTF-8):      Plik nagłówkowy i biblioteka statyczna dla zmailera
78 Group:          Development/Libraries
79 Requires:       %{name} = %{version}-%{release}
80
81 %description devel
82 This is ZMailer's development package. It includes static library and
83 header file.
84
85 %description devel -l pl.UTF-8
86 To jest pakiet dla developerów. Zawiera plik nagłówkowy i bibliotekę
87 statyczną ZMailera.
88
89 %prep
90 %setup -q -a2
91 %patch0 -p1
92 %patch1 -p1
93
94 %build
95 cp -f /usr/share/automake/config.* .
96 %{__autoconf}
97 %configure \
98         --with-zconfig=%{_sysconfdir}/mail/zmailer.conf \
99         --with-postoffice=/var/spool/postoffice \
100         --with-rmailpath=%{_bindir}/rmail \
101         --with-nntpserver=news \
102         --with-system-malloc \
103         --with-mailshare=%{_sysconfdir}/mail \
104         --with-mailbin=%{_libdir}/zmailer \
105         --with-mailvar=%{_sysconfdir}/mail \
106         --with-ta-mmap \
107         %{?with_whoson:--with-whoson} \
108         %{?with_ldap:--with-ldap-prefix} \
109         --with-openssl-prexix=%{_prefix} \
110         --with-tcp-wrappers \
111         --with-ipv6 \
112         --with-mailbox=/var/mail
113 #       --with-yp \
114 #       --with-yp-lib='-lyp'
115 #       --prefix=%{_libdir}/zmailer \
116 #       --with-zconfig=no
117
118 %{__make} -j1 all \
119         COPTS="%{rpmcflags} -w"
120
121 %install
122 rm -rf $RPM_BUILD_ROOT
123 install -d $RPM_BUILD_ROOT%{_mandir}/man{1,3,5,8} \
124         $RPM_BUILD_ROOT%{_sysconfdir}/{cron.d,logrotate.d,rc.d/init.d} \
125         $RPM_BUILD_ROOT{/var/mail,%{_sbindir}} \
126         $RPM_BUILD_ROOT/var/log/archive/mail
127
128 # Install main files
129 %{__make} install \
130         DESTDIR=$RPM_BUILD_ROOT \
131         MAILVAR=$RPM_BUILD_ROOT%{_sysconfdir}/mail \
132         MAILSHARE=$RPM_BUILD_ROOT%{_sysconfdir}/mail \
133         libdir=$RPM_BUILD_ROOT%{_libdir} \
134         includedir=$RPM_BUILD_ROOT%{_includedir}
135
136 install -p contrib/zmailcheck   $RPM_BUILD_ROOT%{_libdir}/zmailer/zmailcheck
137 install -p utils/zmailer.init.sh        $RPM_BUILD_ROOT/etc/rc.d/init.d/zmailer
138
139 > $RPM_BUILD_ROOT%{_sysconfdir}/mail/mailname
140
141 # Few symlinks
142 ln -fs zmailer/sendmail                 $RPM_BUILD_ROOT%{_libdir}/sendmail
143 ln -fs ../lib/zmailer/vacation.sh       $RPM_BUILD_ROOT%{_bindir}/vacation
144 ln -fs ../lib/zmailer/mailq             $RPM_BUILD_ROOT%{_bindir}/mailq
145 ln -fs ../lib/zmailer/rmail             $RPM_BUILD_ROOT%{_bindir}/rmail
146 ln -fs ../lib/zmailer/newaliases        $RPM_BUILD_ROOT%{_bindir}/newaliases
147 ln -fs ../lib/zmailer/zmailer           $RPM_BUILD_ROOT%{_sbindir}/zmailer
148 ln -fs ../lib/zmailer/sendmail          $RPM_BUILD_ROOT%{_sbindir}/sendmail
149
150 # Install manual pages
151 %{__make} -C man install \
152         S=../man \
153         MANDIR=$RPM_BUILD_ROOT%{_mandir}
154
155 # To avoid conflict with INN
156 mv -f $RPM_BUILD_ROOT%{_mandir}/man8/sm.8zm $RPM_BUILD_ROOT%{_mandir}/man8/sm-zmailer.8zm
157
158 (
159 # Install Polish/English forms
160 cd forms*
161 cp -f forms/* $RPM_BUILD_ROOT%{_sysconfdir}/mail/forms/proto
162 cp -p vacation.msg $RPM_BUILD_ROOT%{_sysconfdir}/mail
163
164 # Install proto files
165 cd $RPM_BUILD_ROOT%{_sysconfdir}/mail/proto
166 for x in *; do cp -f $x ..; done
167 cd $RPM_BUILD_ROOT%{_sysconfdir}/mail/forms/proto
168 for x in *; do cp -f $x ..; done
169 cd $RPM_BUILD_ROOT%{_sysconfdir}/mail/db/proto
170 for x in *; do cp -f $x ..; done
171 cd $RPM_BUILD_ROOT%{_sysconfdir}/mail/cf/proto
172 for x in *; do cp -f $x ..; done
173 cd $RPM_BUILD_ROOT%{_sysconfdir}/mail
174 cp -f ./cf/SMTP+UUCP.cf router.cf
175 )
176
177 # Aliases
178 > $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
179
180 # Remove unnecesary proto and bak files
181 rm -rf `find $RPM_BUILD_ROOT -name proto`
182 rm -rf `find $RPM_BUILD_ROOT -name bak`
183
184 # Remove other trashes
185 rm -r $RPM_BUILD_ROOT%{_sysconfdir}/mail/guides/
186 rm $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
187 rm $RPM_BUILD_ROOT%{perl_sitearch}/auto/ZMailer/mailq/.packlist
188 rm $RPM_BUILD_ROOT%{_sysconfdir}/mail/ChangeLog
189 rm $RPM_BUILD_ROOT%{_prefix}/local/man/man3/ZMailer::mailq.3pm
190 rm $RPM_BUILD_ROOT%{perl_sitelib}/ZMailer/mailq.pm
191
192 # Install another files
193 cat << EOF > $RPM_BUILD_ROOT/etc/cron.d/zmailer
194 # Resubmit deferred messages
195 28 */1 * * *            root    ! %{_libdir}/zmailer/zmailer resubmit >/dev/null
196 # Cleanout public and postman directories
197 7 4 * * *               root    ! %{_libdir}/zmailer/zmailer cleanup >/dev/null
198 # Check if services still work
199 11 6,12,18,0 * * *      root    ! %{_libdir}/zmailer/zmailcheck
200 EOF
201
202 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/zmailer
203
204 # postoffice tree (as created by proto/post-install.sh):
205 install -d $RPM_BUILD_ROOT/var/spool/postoffice/{deferred,freezer,postman,public}
206 for f1 in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ; do
207         install -d $RPM_BUILD_ROOT/var/spool/postoffice/{TLSsrvrcache,TLSclntcache,router}/$f1
208         for f2 in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ; do
209                 install -d $RPM_BUILD_ROOT/var/spool/postoffice/{queue,transport}/$f1/$f2
210         done
211 done
212
213 cp -f %{SOURCE1} .
214
215 %clean
216 rm -rf $RPM_BUILD_ROOT
217
218 %post
219 umask 022
220 /sbin/chkconfig --add zmailer
221
222 if [ "$1" = 1 -a -x /bin/hostname ]; then
223         hostname --fqdn > /etc/mail/mailname
224 fi
225
226 if [ -f /etc/mail/router.fc ]; then
227         rm -f /etc/mail/router.fc
228 fi
229
230 # Gymnastics to convice zmailer to use /etc/mail/aliases
231 # or provide /etc/mail/aliases it if not found.
232 if [ ! -L /etc/mail/db/aliases ]; then
233         if [ -f /etc/mail/aliases ]; then
234                 echo "Generating Symlink to use /etc/mail/aliases for aliasing"
235                 rm -f /etc/mail/db/aliases || echo "Strange nothing at /etc/mail/db/aliases. Don't worry."
236 # FIXME! check locale here
237 #               echo "Dziwnie puste /etc/mail/db/aliases. Nie martw sie."
238         else
239                 echo "Installing new /etc/mail/aliases from zmailer sample"
240                 mv -f /etc/mail/db/aliases /etc/aliases
241         fi
242         ln -sf ../aliases /etc/mail/db/aliases
243 fi
244
245 # Scan for Mandatory entries in /etc/aliases
246 # postoffice MAILER-DAEMON postmast nobody and other users
247 # otherwise bad things (tm) result.
248
249 if ! grep -q "^hostmaster:" /etc/mail/aliases; then
250         echo "Adding Entry for hostmaster in /etc/mail/aliases"
251         echo "hostmaster:       root" >>/etc/mail/aliases
252 fi
253
254 for i in postmaster postoffice MAILER-DAEMON postmast nobody webmaster administrator \
255 ftpmaster newsmaster w3cache squid news proxy abuse ircd; do
256         if ! grep -q "^$i:" /etc/mail/aliases; then
257                 echo "Adding Entry for $i in /etc/mail/aliases"
258                 echo "$i:       hostmaster" >>/etc/mail/aliases
259         fi
260 done
261
262 # localnames
263 for x in `hostname --fqdn` `hostname --domain` `hostname --yp`; do
264         if [ -n $x ] && ! grep -q ^$x /etc/mail/db/localnames; then
265                 echo "$x                `hostname --fqdn`|"
266         fi
267 done | tr -d '\n' | tr -s '|' '\n' | sort >> /etc/mail/db/localnames
268
269 # Rebuild databases
270 %{_libdir}/zmailer/zmailer newdb
271 %{_libdir}/zmailer/policy-builder.sh -n
272
273 %preun
274 if [ "$1" = "0" ]; then
275         %service zmailer stop
276         /sbin/chkconfig --del zmailer
277         rm -f /var/spool/postoffice/.pid.*
278 fi
279
280 %pre
281 %groupadd -g 47 zmailer
282 for u in root petidomo uucp daemon news; do
283         if [ -z "`/bin/id -u $u 2>/dev/null`" ]; then
284                 continue
285         fi
286         GROUPS=`/bin/id -n -G $u | sed 's/ /,/g'`
287         if [ -z "`echo $GROUPS | grep '\(^\|,\)zmailer\($\|,\)'`" ]; then
288                 /usr/sbin/usermod -G "${GROUPS},zmailer" $u 1>&2 || :
289         fi
290 done
291
292 %postun
293 if [ "$1" = "0" ]; then
294         %groupremove zmailer
295 fi
296
297 %files
298 %defattr(644,root,root,755)
299 %doc ChangeLog Overview README* TODO doc/toplevel-domains
300 %doc doc/manual/FAQ doc/design/zmog.ps zmailer-pl.txt doc/guides
301 %doc utils/usenet/usenet.sh utils/mail2news utils/mailgateway
302 %dir %{_sysconfdir}/mail
303 %config(noreplace) %{_sysconfdir}/mail/cf
304 %config(noreplace) %{_sysconfdir}/mail/forms
305 %config(noreplace) %{_sysconfdir}/mail/fqlists
306
307 %defattr(644,root,root,3755)
308 %config(noreplace) %{_sysconfdir}/mail/db
309
310 %defattr(644,root,root,2755)
311 %config(noreplace) %{_sysconfdir}/mail/lists
312
313 %defattr(644,root,root,755)
314 %config %{_sysconfdir}/mail/*.*
315 %{_sysconfdir}/mail/mailname
316 %config(noreplace) %{_sysconfdir}/mail/aliases
317
318 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/zmailer
319 %attr(640,root,root) /etc/cron.d/zmailer
320
321 %attr(754,root,root) /etc/rc.d/init.d/zmailer
322
323 %attr(755,root,root) %{_bindir}/*
324 %attr(755,root,root) %{_sbindir}/*
325 %attr(755,root,root) %{_libdir}/sendmail
326 %attr(755,root,root) %{_libdir}/zmailer
327
328 %{_mandir}/man[158]/*
329 %attr(755,root,root) %dir /var/spool/postoffice
330 %attr(750,root,root) %dir /var/spool/postoffice/deferred
331 %attr(750,root,root) %dir /var/spool/postoffice/freezer
332 %attr(750,root,root) %dir /var/spool/postoffice/postman
333 %attr(750,root,root) %dir /var/spool/postoffice/queue
334 %attr(1777,root,root) %dir /var/spool/postoffice/public
335 %attr(1777,root,root) %dir /var/spool/postoffice/router
336 %attr(755,root,root) %dir /var/spool/postoffice/transport
337 %attr(755,root,root) %dir /var/spool/postoffice/transport/*
338 %attr(755,root,root) %dir /var/spool/postoffice/transport/*/*
339 %attr(755,root,root) %dir /var/spool/postoffice/queue/*
340 %attr(755,root,root) %dir /var/spool/postoffice/queue/*/*
341 %attr(700,root,root) %dir /var/spool/postoffice/TLSsrvrcache
342 %attr(700,root,root) %dir /var/spool/postoffice/TLSsrvrcache/*
343 %attr(700,root,root) %dir /var/spool/postoffice/TLSclntcache
344 %attr(700,root,root) %dir /var/spool/postoffice/TLSclntcache/*
345 %attr(750,root,root) %dir /var/log/mail
346 %attr(750,root,root) %dir /var/log/archive/mail
347
348 %files devel
349 %defattr(644,root,root,755)
350
351 %{_libdir}/libzmailer.a
352 %{_includedir}/zmailer.h
353
354 %{_mandir}/man3/*
This page took 0.413766 seconds and 3 git commands to generate.