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