]> git.pld-linux.org Git - packages/postfix.git/blob - postfix.spec
- added getifaddrs patch and -DHAVE_GETIFADDRS: use getifaddrs() from glibc 2.3.4,
[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:        6
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 Patch10:        %{name}-getifaddrs.patch
53 # from http://akson.sgh.waw.pl/~chopin/unix/postfix-2.1.5-header_if_reject.diff
54 Patch11:        %{name}-header_if_reject.patch
55 URL:            http://www.postfix.org/
56 BuildRequires:  awk
57 %{?with_sasl:BuildRequires:     cyrus-sasl-devel}
58 BuildRequires:  db-devel
59 # getifaddrs() with IPv6 support
60 BuildRequires:  glibc-devel >= 6:2.3.4
61 BuildRequires:  grep
62 %{?with_mysql:BuildRequires:    mysql-devel}
63 %{?with_ldap:BuildRequires:     openldap-devel >= 2.2.0}
64 %{?with_ssl:BuildRequires:      openssl-devel >= 0.9.7d}
65 BuildRequires:  pcre-devel
66 %{?with_pgsql:BuildRequires:    postgresql-devel}
67 BuildRequires:  rpmbuild(macros) >= 1.159
68 %{?with_cdb:BuildRequires:      tinycdb-devel}
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 %patch10 -p1
232 %{?with_hir:%patch11 -p0}
233 %{?with_cdb:sh dict_cdb.sh}
234
235 %build
236 %{__make} -f Makefile.init makefiles
237 %{__make} tidy
238 %{__make} \
239         DEBUG="" \
240         OPT="%{rpmcflags}" \
241         %{!?with_ldap:LDAPSO=""} \
242         %{!?with_mysql:MYSQLSO=""} \
243         %{!?with_pgsql:PGSQLSO=""} \
244         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} -DHAVE_GETIFADDRS" \
245         AUXLIBS="-ldb -lresolv %{?with_sasl:-lsasl} %{?with_ssl:-lssl -lcrypto} %{?with_cdb:-lcdb}"
246
247 %install
248 rm -rf $RPM_BUILD_ROOT
249 install -d $RPM_BUILD_ROOT/etc/{cron.daily,rc.d/init.d,sysconfig,pam.d} \
250         $RPM_BUILD_ROOT%{_sysconfdir}/{mail,sasl} \
251         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}/postfix,/usr/lib}\
252         $RPM_BUILD_ROOT{%{_includedir}/postfix,%{_mandir}/man{1,5,8}} \
253         $RPM_BUILD_ROOT%{_var}/spool/postfix/{active,corrupt,deferred,maildrop,private,saved,bounce,defer,incoming,pid,public} \
254         pfixtls
255
256 rm -f {html,man}/Makefile.in conf/{LICENSE,main.cf.default}
257
258 install -d sample-conf; mv -f conf/sample* sample-conf || :
259
260 install bin/* $RPM_BUILD_ROOT%{_sbindir}
261 install libexec/* $RPM_BUILD_ROOT%{_libdir}/postfix
262 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail
263 sed -e's,^daemon_directory = .*,daemon_directory = %{_libdir}/postfix,' \
264         conf/main.cf > $RPM_BUILD_ROOT%{_sysconfdir}/mail/main.cf
265
266 for f in dns global master util ; do
267         install lib/lib${f}.a $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so.1
268         ln -sf lib${f}.so.1 $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so
269 done
270 install lib/dict*.so $RPM_BUILD_ROOT%{_libdir}/postfix
271 install include/*.h $RPM_BUILD_ROOT%{_includedir}/postfix
272
273 (cd man; tar cf - .) | (cd $RPM_BUILD_ROOT%{_mandir}; tar xf -)
274
275 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
276 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/postfix
277 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/postfix
278 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/postfix
279 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/sasl/smtpd.conf
280 install %{SOURCE9} $RPM_BUILD_ROOT/etc/pam.d/smtp
281 install auxiliary/rmail/rmail $RPM_BUILD_ROOT%{_bindir}/rmail
282
283 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/mailq
284 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/newaliases
285 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail
286
287 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/\
288         {aliases,access,canonical,relocated,transport,virtual}{,.db}
289
290 > $RPM_BUILD_ROOT/var/spool/postfix/.nofinger
291
292 rm -rf $RPM_BUILD_ROOT/etc/mail/makedefs.out $RPM_BUILD_ROOT/usr/share/man/cat*
293
294 %clean
295 rm -rf $RPM_BUILD_ROOT
296
297 %pre
298 if [ -n "`/usr/bin/getgid postfix`" ]; then
299         if [ "`getgid postfix`" != "62" ]; then
300                 echo "Error: group postfix doesn't have gid=62. Correct this before installing postfix." 1>&2
301                 exit 1
302         fi
303 else
304         /usr/sbin/groupadd -g 62 -r -f postfix
305 fi
306 if [ -n "`/usr/bin/getgid maildrop`" ]; then
307         if [ "`/usr/bin/getgid maildrop`" != "63" ]; then
308                 echo "Error: group maildrop doesn't have gid=63. Correct this before installing postfix." 1>&2
309                 exit 1
310         fi
311 else
312         /usr/sbin/groupadd -g 63 maildrop
313 fi
314 if [ -n "`/bin/id -u postfix 2>/dev/null`" ]; then
315         if [ "`/bin/id -u postfix`" != "62" ]; then
316                 echo "Error: user postfix doesn't have uid=62. Correct this before installing postfix." 1>&2
317                 exit 1
318         fi
319 else
320         /usr/sbin/useradd -u 62 -d /var/spool/postfix -s /bin/false -c "Postfix User" -g postfix postfix 1>&2
321 fi
322
323 %post
324 /sbin/ldconfig
325 if ! grep -q "^postmaster:" /etc/mail/aliases; then
326         echo "Adding Entry for postmaster in /etc/mail/aliases" >&2
327         echo "postmaster:       root" >>/etc/mail/aliases
328 fi
329 if [ "$1" = "1" ]; then
330 # only on installation, not upgrade
331         if ! grep -q "^myhostname" /etc/mail/main.cf; then
332                 postconf -e myhostname=`/bin/hostname -f`
333         fi
334 else
335         postfix upgrade-configuration
336 fi
337
338 newaliases
339 /sbin/chkconfig --add postfix
340 if [ -f /var/lock/subsys/postfix ]; then
341         /etc/rc.d/init.d/postfix restart >&2
342 else
343         echo "Run \"/etc/rc.d/init.d/postfix start\" to start postfix daemon." >&2
344 fi
345
346 %preun
347 if [ "$1" = "0" ]; then
348         if [ -f /var/lock/subsys/postfix ]; then
349                 /etc/rc.d/init.d/postfix stop >&2
350         fi
351         /sbin/chkconfig --del postfix
352 fi
353
354 %postun
355 /sbin/ldconfig
356 if [ "$1" = "0" ]; then
357         %groupremove maildrop
358         %userremove postfix
359         %groupremove postfix
360 fi
361
362 %triggerpostun -- postfix < 1:1.1.2
363 umask 022
364 sed -e 's/^\(pickup[    ]\+fifo[        ]\+[^   ]\+[    ]\+\)[^         ]\+\([  ]\)/\1-\2/;
365 s/^\(cleanup[   ]\+unix[        ]\+\)[^         ]\+\([  ]\)/\1n\2/' /etc/mail/master.cf \
366         > /etc/mail/master.cf.rpmtmp
367 mv -f /etc/mail/master.cf.rpmtmp /etc/mail/master.cf
368
369 %files
370 %defattr(644,root,root,755)
371 %doc html *README COMPATIBILITY HISTORY LICENSE RELEASE_NOTES
372 %doc README_FILES/*README
373 %doc sample-conf
374 %doc examples/smtpd-policy
375 %doc pfixtls
376 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/access
377 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/aliases
378 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/canonical
379 #%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/pcre_table
380 #%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/regexp_table
381 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/relocated
382 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/transport
383 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/virtual
384 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/header_checks
385 #%ghost %{_sysconfdir}/mail/*.db
386 %dir %{_sysconfdir}/mail
387 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/dynamicmaps.cf
388 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/main.cf
389 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/master.cf
390 %attr(755,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/postfix-script
391 %attr(755,root,root) %{_sysconfdir}/mail/post-install
392 %{_sysconfdir}/mail/postfix-files
393 %attr(740,root,root) /etc/cron.daily/postfix
394 %attr(754,root,root) /etc/rc.d/init.d/postfix
395 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/postfix
396 %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/smtp
397 %{?with_sasl:%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sasl/smtpd.conf}
398 %attr(755,root,root) %{_libdir}/libpostfix-*.so.*
399 %attr(755,root,root) %{_bindir}/*
400 %attr(755,root,root) %{_sbindir}/s*
401 %attr(755,root,root) %{_sbindir}/postfix
402 %attr(755,root,root) %{_sbindir}/postalias
403 %attr(755,root,root) %{_sbindir}/postkick
404 %attr(755,root,root) %{_sbindir}/postl*
405 %attr(755,root,root) %{_sbindir}/postc*
406 %attr(755,root,root) %{_sbindir}/postmap
407 %attr(2755,root,maildrop) %{_sbindir}/postqueue
408 %attr(755,root,root) %{_sbindir}/postsuper
409 %attr(2755,root,maildrop) %{_sbindir}/postdrop
410 %attr(755,root,root) %{_sbindir}/qmqp-source
411 %attr(755,root,root) /usr/lib/sendmail
412 %dir %{_libdir}/postfix
413 %attr(755,root,root) %{_libdir}/postfix/[!d]*
414 %attr(755,root,root) %dir %{_var}/spool/postfix
415 %attr(700,postfix,root) %dir %{_var}/spool/postfix/active
416 %attr(700,postfix,root) %dir %{_var}/spool/postfix/bounce
417 %attr(700,postfix,root) %dir %{_var}/spool/postfix/corrupt
418 %attr(700,postfix,root) %dir %{_var}/spool/postfix/defer
419 %attr(700,postfix,root) %dir %{_var}/spool/postfix/deferred
420 %attr(700,postfix,root) %dir %{_var}/spool/postfix/incoming
421 %attr(1730,postfix,maildrop) %dir %{_var}/spool/postfix/maildrop
422 %attr(755,postfix,root) %dir %{_var}/spool/postfix/pid
423 %attr(700,postfix,root) %dir %{_var}/spool/postfix/private
424 %attr(710,postfix,maildrop) %dir %{_var}/spool/postfix/public
425 %attr(700,postfix,root) %dir %{_var}/spool/postfix/saved
426 %attr(644,postfix,root) %{_var}/spool/postfix/.nofinger
427 %{_mandir}/man*/*
428
429 %files devel
430 %defattr(644,root,root,755)
431 %attr(755,root,root) %{_libdir}/libpostfix-*.so
432 %{_includedir}/postfix
433
434 %if %{with ldap}
435 %files dict-ldap
436 %defattr(644,root,root,755)
437 %attr(755,root,root) %{_libdir}/postfix/dict_ldap.so
438 %endif
439
440 %if %{with mysql}
441 %files dict-mysql
442 %defattr(644,root,root,755)
443 %attr(755,root,root) %{_libdir}/postfix/dict_mysql.so
444 %endif
445
446 %files dict-pcre
447 %defattr(644,root,root,755)
448 %attr(755,root,root) %{_libdir}/postfix/dict_pcre.so
449
450 %if %{with pgsql}
451 %files dict-pgsql
452 %defattr(644,root,root,755)
453 %attr(755,root,root) %{_libdir}/postfix/dict_pgsql.so
454 %endif
This page took 0.071142 seconds and 4 git commands to generate.