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