]> git.pld-linux.org Git - packages/postfix.git/blob - postfix.spec
- prefer getifaddrs() over /proc/net/if_inet6
[packages/postfix.git] / postfix.spec
1 #
2 # Conditional build:
3 %bcond_without  ldap    # without LDAP map module
4 %bcond_without  mysql   # without MySQL map module
5 %bcond_without  pgsql   # without PostgreSQL map module
6 %bcond_without  sasl    # without SMTP AUTH support
7 %bcond_without  ssl     # without SSL/TLS support
8 %bcond_without  cdb     # without cdb map support
9 %bcond_with     vda     # with VDA patch
10 %bcond_with     hir     # with Beeth's header_if_reject patch
11 #%bcond_with    polish  # with double English+Polish messages
12 #
13 # TODO:
14 #       - check/fix 'polish' bcond
15 #
16 %define         _tls_ipv6_ver   1.26-pf-2.1.5
17 Summary:        Postfix Mail Transport Agent
18 Summary(cs):    Postfix - program pro pøepravu po¹ty (MTA)
19 Summary(es):    Postfix - Un MTA (Mail Transport Agent) de alto desempeño
20 Summary(fr):    Agent de transport de courrier Postfix
21 Summary(pl):    Serwer SMTP Postfix
22 Summary(pt_BR): Postfix - Um MTA (Mail Transport Agent) de alto desempenho
23 Summary(sk):    Agent prenosu po¹ty Postfix
24 Name:           postfix
25 Version:        2.1.5
26 Release:        5
27 Epoch:          2
28 Group:          Networking/Daemons
29 License:        distributable
30 Source0:        ftp://ftp.porcupine.org/mirrors/postfix-release/official/%{name}-%{version}.tar.gz
31 # Source0-md5:  bcaa4aac80595d04c60c72844203a04d
32 Source1:        %{name}.aliases
33 Source2:        %{name}.cron
34 Source3:        %{name}.init
35 Source5:        %{name}.sysconfig
36 Source6:        %{name}.sasl
37 Source7:        ftp://ftp.corpit.ru/pub/postfix/%{name}-dict_cdb-1.1.11-20021104.tar.gz
38 # Source7-md5:  5731b5081725f4688dc6fae119d617e4
39 Source8:        ftp://ftp.stack.nl/pub/postfix/tls+ipv6/1.26/tls+ipv6-%{_tls_ipv6_ver}.patch.gz
40 # Source8-md5:  3d3bbabe5c17d5d0809c698ad1df1e64
41 Source9:        %{name}.pamd
42 Source10:       http://web.onda.com.br/nadal/postfix/VDA/%{name}-%{version}-trash.patch.gz
43 # Source10-md5: 868209c12cf214566130b9c8b968cfed
44 Patch0:         %{name}-config.patch
45 Patch1:         %{name}-conf_msg.patch
46 Patch2:         %{name}-dynamicmaps.patch
47 Patch4:         %{name}-master.cf_cyrus.patch
48 #Patch5:        %{name}-pl.patch
49 Patch6:         %{name}-cdb_man.patch
50 Patch8:         %{name}-kill_warnings.patch
51 Patch9:         %{name}-ipv6-kill_warnings.patch
52 # from http://akson.sgh.waw.pl/~chopin/unix/postfix-2.1.5-header_if_reject.diff
53 Patch10:        %{name}-header_if_reject.patch
54 URL:            http://www.postfix.org/
55 BuildRequires:  awk
56 %{?with_sasl:BuildRequires:     cyrus-sasl-devel}
57 BuildRequires:  db-devel
58 BuildRequires:  grep
59 # kill for now, is it really necessary ?
60 #BuildRequires: libinet6 >= 0.20030228-1
61 %{?with_mysql:BuildRequires:    mysql-devel}
62 %{?with_ldap:BuildRequires:     openldap-devel >= 2.2.0}
63 %{?with_ssl:BuildRequires:      openssl-devel >= 0.9.7d}
64 BuildRequires:  pcre-devel
65 %{?with_pgsql:BuildRequires:    postgresql-devel}
66 BuildRequires:  rpmbuild(macros) >= 1.159
67 %{?with_cdb:BuildRequires:      tinycdb-devel}
68 BuildConflicts: libinet6
69 PreReq:         rc-scripts
70 PreReq:         sed
71 Requires(post): /bin/hostname
72 Requires(pre):  /bin/id
73 Requires(pre):  /usr/bin/getgid
74 Requires(pre):  /usr/sbin/groupadd
75 Requires(pre):  /usr/sbin/useradd
76 Requires(post,preun):   /sbin/chkconfig
77 Requires(post,postun):  /sbin/ldconfig
78 Requires(postun):       /usr/sbin/groupdel
79 Requires(postun):       /usr/sbin/userdel
80 Requires:       diffutils
81 Requires:       findutils
82 %{?with_cdb:Requires:tinycdb}
83 Provides:       group(postfix)
84 Provides:       smtpdaemon
85 Provides:       user(postfix)
86 Obsoletes:      courier
87 Obsoletes:      exim
88 Obsoletes:      masqmail
89 Obsoletes:      nullmailer
90 Obsoletes:      omta
91 Obsoletes:      qmail
92 Obsoletes:      sendmail
93 Obsoletes:      sendmail-cf
94 Obsoletes:      sendmail-doc
95 Obsoletes:      smail
96 Obsoletes:      smtpdaemon
97 Obsoletes:      ssmtp
98 Obsoletes:      zmailer
99 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
100
101 %description
102 Postfix is attempt to provide an alternative to the widely-used
103 Sendmail program. Postfix attempts to be fast, easy to administer, and
104 hopefully secure, while at the same time being sendmail compatible
105 enough to not upset your users. This version has IPv6 support.
106
107 %description -l pt_BR
108 O Postfix é uma alternativa para o mundialmente utilizado sendmail. Se
109 você deseja um servidor SMTP *rápido*, instale este pacote.
110
111 %description -l es
112 Postfix es una alternativa para el mundialmente utilizado sendmail. Si
113 desea tener un servidor SMTP *rápido*, debe instalar este paquete.
114
115 %description -l fr
116 Postfix (voir http://www.postfix.org/) se veut une alternative à
117 sendmail, responsable de l'acheminement de 70% des courriers
118 électroniques sur Internet. IBM en a suppotré le développement, mais
119 ne contrôle pas son évolution. Le but est d'installer Postfix sur le
120 plus grand nombre de systèmes possible. Dans cette optique, il a été
121 écrit pour être totalement sous le contrôle de l'utilisateur.
122
123 %description -l it
124 Postfix (http://www.postfix.org/) e' un'alternativa al programma
125 sendmail utilizzato per la gestione del 70 per cento della posta
126 Internet.
127
128 Seppur IBM supporti lo sviluppo di Postfix, non controlla la sua
129 evoluzione.
130
131 Consultate la pagine web http://www.moongroup.com/how-to.phtml nella
132 quale troverete le indicazioni per una corretta installazione e
133 configurazione di questo programma.
134
135 %description -l pl
136 Postfix jest prób± dostarczenia alternatywnego MTA w stosunku do
137 szeroko u¿ywanego sendmaila. Postfix w zamierzeniu ma byæ szybki,
138 ³atwy w administrowaniu, bezpieczny oraz ma byæ na tyle kompatybilny z
139 sendmailem by nie denerwowaæ Twoich u¿ytkowników. Ta wersja wspiera IPv6.
140
141 %description -l pt_BR
142 O Postfix é uma alternativa para o mundialmente utilizado sendmail. Se
143 você deseja um servidor SMTP *rápido*, instale este pacote.
144
145 %description -l sk
146 Postfix (pozri http://www.postfix.org/) má za cieµ by» alternatívou k
147 ¹iroko roz¹írenému programu sendmail, zodpovednému za 70% v¹etkej
148 elektronickej po¹ty doruèenej na Internete.
149
150 Aj keï IBM podporovala vývoj Postfixu, zdr¾iava sa vplyvu na jeho
151 vývoj. Cieµom je in¹talácia Postfixu na èo najväè¹om poète systémov.
152 Do tohoto momentu je softvér poskytovaný bez ovplyvòovania, tak¾e sa
153 mô¾e vyvíja» podµa jeho pou¾ívateµov.
154
155 Urèite si preèítajte http://www.moongroup.com/how-to.phtml, kde sú
156 popísané kroky potrebné pred a po in¹talácii Postfixu.
157
158 %package devel
159 Summary:        Postfix loadable modules development package
160 Summary(pl):    Pakiet dla programistów ³adowanych modu³ów do postfiksa
161 Group:          Development/Libraries
162 Requires:       %{name} = %{epoch}:%{version}-%{release}
163
164 %description devel
165 Header files to build additional map types for Postfix.
166
167 %description devel -l pl
168 Pliki nag³ówkowe do tworzenia dodatkowych typów map dla Postfiksa.
169
170 %package dict-ldap
171 Summary:        LDAP map support for Postfix
172 Summary(pl):    Obs³uga map LDAP dla Postfiksa
173 Group:          Networking/Daemons
174 Requires:       %{name} = %{epoch}:%{version}-%{release}
175 Requires:       openldap >= 2.2.0
176
177 %description dict-ldap
178 This package provides support for LDAP maps in Postfix.
179
180 %description dict-ldap -l pl
181 Ten pakiet dodaje obs³ugê map LDAP do Postfiksa.
182
183 %package dict-mysql
184 Summary:        MySQL map support for Postfix
185 Summary(pl):    Obs³uga map MySQL dla Postfiksa
186 Group:          Networking/Daemons
187 Requires:       %{name} = %{epoch}:%{version}-%{release}
188
189 %description dict-mysql
190 This package provides support for MySQL maps in Postfix.
191
192 %description dict-mysql -l pl
193 Ten pakiet dodaje obs³ugê map MySQL do Postfiksa.
194
195 %package dict-pcre
196 Summary:        PCRE map support for Postfix
197 Summary(pl):    Obs³uga map PCRE dla Postfiksa
198 Group:          Networking/Daemons
199 Requires:       %{name} = %{epoch}:%{version}-%{release}
200
201 %description dict-pcre
202 This package provides support for PCRE maps in Postfix.
203
204 %description dict-pcre -l pl
205 Ten pakiet dodaje obs³ugê map PCRE do Postfiksa.
206
207 %package dict-pgsql
208 Summary:        PostgreSQL map support for Postfix
209 Summary(pl):    Obs³uga map PostgreSQL dla Postfiksa
210 Group:          Networking/Daemons
211 Requires:       %{name} = %{epoch}:%{version}-%{release}
212
213 %description dict-pgsql
214 This package provides support for PostgreSQL maps in Postfix.
215
216 %description dict-pgsql -l pl
217 Ten pakiet dodaje obs³ugê map PostgreSQL do Postfiksa.
218
219 %prep
220 %setup -q %{?with_cdb:-a7}
221 zcat %{SOURCE8} | patch -p1 -s
222 %{?with_vda:zcat %{SOURCE10} | patch -p1 -s}
223 %patch0 -p1
224 %patch1 -p1
225 %patch2 -p1
226 %patch4 -p1
227 #%{?with_polish:%patch5 -p1}
228 %{?with_cdb:%patch6 -p1}
229 %patch8 -p1
230 %patch9 -p1
231 %{?with_hir:%patch10 -p0}
232 %{?with_cdb:sh dict_cdb.sh}
233
234 %build
235 %{__make} -f Makefile.init makefiles
236 %{__make} tidy
237 %{__make} DEBUG="" OPT="%{rpmcflags}" \
238         %{!?with_ldap:LDAPSO=""} \
239         %{!?with_mysql:MYSQLSO=""} \
240         %{!?with_pgsql:PGSQLSO=""} \
241         CCARGS="%{?with_ldap:-DHAS_LDAP} -DHAS_PCRE %{?with_sasl:-DUSE_SASL_AUTH -I/usr/include/sasl} %{?with_mysql:-DHAS_MYSQL -I/usr/include/mysql} %{?with_pgsql:-DHAS_PGSQL -I/usr/include/postgresql} %{?with_ssl:-DHAS_SSL -I/usr/include/openssl} -DMAX_DYNAMIC_MAPS %{?with_cdb:-DHAS_CDB}" \
242         AUXLIBS="-ldb -lresolv %{?with_sasl:-lsasl} %{?with_ssl:-lssl -lcrypto} %{?with_cdb:-lcdb}"
243
244 %install
245 rm -rf $RPM_BUILD_ROOT
246 install -d $RPM_BUILD_ROOT/etc/{cron.daily,rc.d/init.d,sysconfig,pam.d} \
247         $RPM_BUILD_ROOT%{_sysconfdir}/{mail,sasl} \
248         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}/postfix,/usr/lib}\
249         $RPM_BUILD_ROOT{%{_includedir}/postfix,%{_mandir}/man{1,5,8}} \
250         $RPM_BUILD_ROOT%{_var}/spool/postfix/{active,corrupt,deferred,maildrop,private,saved,bounce,defer,incoming,pid,public} \
251         pfixtls
252
253 rm -f {html,man}/Makefile.in conf/{LICENSE,main.cf.default}
254
255 install -d sample-conf; mv -f conf/sample* sample-conf || :
256
257 install bin/* $RPM_BUILD_ROOT%{_sbindir}
258 install libexec/* $RPM_BUILD_ROOT%{_libdir}/postfix
259 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail
260 sed -e's,^daemon_directory = .*,daemon_directory = %{_libdir}/postfix,' \
261         conf/main.cf > $RPM_BUILD_ROOT%{_sysconfdir}/mail/main.cf
262
263 for f in dns global master util ; do
264         install lib/lib${f}.a $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so.1
265         ln -sf lib${f}.so.1 $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so
266 done
267 install lib/dict*.so $RPM_BUILD_ROOT%{_libdir}/postfix
268 install include/*.h $RPM_BUILD_ROOT%{_includedir}/postfix
269
270 (cd man; tar cf - .) | (cd $RPM_BUILD_ROOT%{_mandir}; tar xf -)
271
272 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
273 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/postfix
274 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/postfix
275 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/postfix
276 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/sasl/smtpd.conf
277 install %{SOURCE9} $RPM_BUILD_ROOT/etc/pam.d/smtp
278 install auxiliary/rmail/rmail $RPM_BUILD_ROOT%{_bindir}/rmail
279
280 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/mailq
281 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/newaliases
282 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail
283
284 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/\
285         {aliases,access,canonical,relocated,transport,virtual}{,.db}
286
287 > $RPM_BUILD_ROOT/var/spool/postfix/.nofinger
288
289 rm -rf $RPM_BUILD_ROOT/etc/mail/makedefs.out $RPM_BUILD_ROOT/usr/share/man/cat*
290
291 %clean
292 rm -rf $RPM_BUILD_ROOT
293
294 %pre
295 if [ -n "`/usr/bin/getgid postfix`" ]; then
296         if [ "`getgid postfix`" != "62" ]; then
297                 echo "Error: group postfix doesn't have gid=62. Correct this before installing postfix." 1>&2
298                 exit 1
299         fi
300 else
301         /usr/sbin/groupadd -g 62 -r -f postfix
302 fi
303 if [ -n "`/usr/bin/getgid maildrop`" ]; then
304         if [ "`/usr/bin/getgid maildrop`" != "63" ]; then
305                 echo "Error: group maildrop doesn't have gid=63. Correct this before installing postfix." 1>&2
306                 exit 1
307         fi
308 else
309         /usr/sbin/groupadd -g 63 maildrop
310 fi
311 if [ -n "`/bin/id -u postfix 2>/dev/null`" ]; then
312         if [ "`/bin/id -u postfix`" != "62" ]; then
313                 echo "Error: user postfix doesn't have uid=62. Correct this before installing postfix." 1>&2
314                 exit 1
315         fi
316 else
317         /usr/sbin/useradd -u 62 -d /var/spool/postfix -s /bin/false -c "Postfix User" -g postfix postfix 1>&2
318 fi
319
320 %post
321 /sbin/ldconfig
322 if ! grep -q "^postmaster:" /etc/mail/aliases; then
323         echo "Adding Entry for postmaster in /etc/mail/aliases" >&2
324         echo "postmaster:       root" >>/etc/mail/aliases
325 fi
326 if [ "$1" = "1" ]; then
327 # only on installation, not upgrade
328         if ! grep -q "^myhostname" /etc/mail/main.cf; then
329                 postconf -e myhostname=`/bin/hostname -f`
330         fi
331 else
332         postfix upgrade-configuration
333 fi
334
335 newaliases
336 /sbin/chkconfig --add postfix
337 if [ -f /var/lock/subsys/postfix ]; then
338         /etc/rc.d/init.d/postfix restart >&2
339 else
340         echo "Run \"/etc/rc.d/init.d/postfix start\" to start postfix daemon." >&2
341 fi
342
343 %preun
344 if [ "$1" = "0" ]; then
345         if [ -f /var/lock/subsys/postfix ]; then
346                 /etc/rc.d/init.d/postfix stop >&2
347         fi
348         /sbin/chkconfig --del postfix
349 fi
350
351 %postun
352 /sbin/ldconfig
353 if [ "$1" = "0" ]; then
354         %groupremove maildrop
355         %userremove postfix
356         %groupremove postfix
357 fi
358
359 %triggerpostun -- postfix < 1:1.1.2
360 umask 022
361 sed -e 's/^\(pickup[    ]\+fifo[        ]\+[^   ]\+[    ]\+\)[^         ]\+\([  ]\)/\1-\2/;
362 s/^\(cleanup[   ]\+unix[        ]\+\)[^         ]\+\([  ]\)/\1n\2/' /etc/mail/master.cf \
363         > /etc/mail/master.cf.rpmtmp
364 mv -f /etc/mail/master.cf.rpmtmp /etc/mail/master.cf
365
366 %files
367 %defattr(644,root,root,755)
368 %doc html *README COMPATIBILITY HISTORY LICENSE RELEASE_NOTES
369 %doc README_FILES/*README
370 %doc sample-conf
371 %doc examples/smtpd-policy
372 %doc pfixtls
373 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/access
374 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/aliases
375 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/canonical
376 #%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/pcre_table
377 #%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/regexp_table
378 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/relocated
379 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/transport
380 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/virtual
381 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/header_checks
382 #%ghost %{_sysconfdir}/mail/*.db
383 %dir %{_sysconfdir}/mail
384 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/dynamicmaps.cf
385 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/main.cf
386 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/master.cf
387 %attr(755,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/postfix-script
388 %attr(755,root,root) %{_sysconfdir}/mail/post-install
389 %{_sysconfdir}/mail/postfix-files
390 %attr(740,root,root) /etc/cron.daily/postfix
391 %attr(754,root,root) /etc/rc.d/init.d/postfix
392 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/postfix
393 %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/smtp
394 %{?with_sasl:%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sasl/smtpd.conf}
395 %attr(755,root,root) %{_libdir}/libpostfix-*.so.*
396 %attr(755,root,root) %{_bindir}/*
397 %attr(755,root,root) %{_sbindir}/s*
398 %attr(755,root,root) %{_sbindir}/postfix
399 %attr(755,root,root) %{_sbindir}/postalias
400 %attr(755,root,root) %{_sbindir}/postkick
401 %attr(755,root,root) %{_sbindir}/postl*
402 %attr(755,root,root) %{_sbindir}/postc*
403 %attr(755,root,root) %{_sbindir}/postmap
404 %attr(2755,root,maildrop) %{_sbindir}/postqueue
405 %attr(755,root,root) %{_sbindir}/postsuper
406 %attr(2755,root,maildrop) %{_sbindir}/postdrop
407 %attr(755,root,root) %{_sbindir}/qmqp-source
408 %attr(755,root,root) /usr/lib/sendmail
409 %dir %{_libdir}/postfix
410 %attr(755,root,root) %{_libdir}/postfix/[!d]*
411 %attr(755,root,root) %dir %{_var}/spool/postfix
412 %attr(700,postfix,root) %dir %{_var}/spool/postfix/active
413 %attr(700,postfix,root) %dir %{_var}/spool/postfix/bounce
414 %attr(700,postfix,root) %dir %{_var}/spool/postfix/corrupt
415 %attr(700,postfix,root) %dir %{_var}/spool/postfix/defer
416 %attr(700,postfix,root) %dir %{_var}/spool/postfix/deferred
417 %attr(700,postfix,root) %dir %{_var}/spool/postfix/incoming
418 %attr(1730,postfix,maildrop) %dir %{_var}/spool/postfix/maildrop
419 %attr(755,postfix,root) %dir %{_var}/spool/postfix/pid
420 %attr(700,postfix,root) %dir %{_var}/spool/postfix/private
421 %attr(710,postfix,maildrop) %dir %{_var}/spool/postfix/public
422 %attr(700,postfix,root) %dir %{_var}/spool/postfix/saved
423 %attr(644,postfix,root) %{_var}/spool/postfix/.nofinger
424 %{_mandir}/man*/*
425
426 %files devel
427 %defattr(644,root,root,755)
428 %attr(755,root,root) %{_libdir}/libpostfix-*.so
429 %{_includedir}/postfix
430
431 %if %{with ldap}
432 %files dict-ldap
433 %defattr(644,root,root,755)
434 %attr(755,root,root) %{_libdir}/postfix/dict_ldap.so
435 %endif
436
437 %if %{with mysql}
438 %files dict-mysql
439 %defattr(644,root,root,755)
440 %attr(755,root,root) %{_libdir}/postfix/dict_mysql.so
441 %endif
442
443 %files dict-pcre
444 %defattr(644,root,root,755)
445 %attr(755,root,root) %{_libdir}/postfix/dict_pcre.so
446
447 %if %{with pgsql}
448 %files dict-pgsql
449 %defattr(644,root,root,755)
450 %attr(755,root,root) %{_libdir}/postfix/dict_pgsql.so
451 %endif
This page took 0.330162 seconds and 3 git commands to generate.