]> git.pld-linux.org Git - packages/postfix.git/blob - postfix.spec
- updated to 2.0.18
[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 #
7 # Conditional build:
8 %bcond_without  ipv6    # without IPv6 support
9 %bcond_without  ldap    # without LDAP map module
10 %bcond_without  mysql   # without MySQL map module
11 %bcond_without  pgsql   # without PostgreSQL map module
12 %bcond_without  sasl    # without SMTP AUTH support
13 %bcond_without  ssl     # without SSL/TLS support
14 %bcond_with     polish  # with double English+Polish messages
15 %bcond_with     cdb     # with cdb map support
16 #
17 %define tls_ver 0.8.16-2.0.16-0.9.7b
18 Summary:        Postfix Mail Transport Agent
19 Summary(cs):    Postfix - program pro pøepravu po¹ty (MTA)
20 Summary(es):    Postfix - Un MTA (Mail Transport Agent) de alto desempeño
21 Summary(fr):    Agent de transport de courrier Postfix
22 Summary(pl):    Serwer SMTP Postfix
23 Summary(pt_BR): Postfix - Um MTA (Mail Transport Agent) de alto desempenho
24 Summary(sk):    Agent prenosu po¹ty Postfix
25 Name:           postfix
26 Version:        2.0.18
27 Release:        1
28 Epoch:          2
29 Group:          Networking/Daemons
30 License:        distributable
31 Source0:        ftp://ftp.porcupine.org/mirrors/postfix-release/official/%{name}-%{version}.tar.gz
32 # Source0-md5:  3e5baf2cc497a5fb1aaa6ba11aa6491e
33 Source1:        %{name}.aliases
34 Source2:        %{name}.cron
35 Source3:        %{name}.init
36 Source5:        %{name}.sysconfig
37 Source6:        ftp://ftp.aet.tu-cottbus.de/pub/pfixtls/pfixtls-%{tls_ver}.tar.gz
38 # Source6-md5:  b39c08eabe807db4af5bcb1cafc9761e
39 Source7:        %{name}.sasl
40 Source8:        ftp://ftp.corpit.ru/pub/postfix/%{name}-dict_cdb-1.1.11-20021104.tar.gz
41 # Source8-md5:  5731b5081725f4688dc6fae119d617e4
42 Patch0:         %{name}-config.patch
43 Patch1:         %{name}-conf_msg.patch
44 Patch2:         %{name}-dynamicmaps.patch
45 Patch3:         %{name}-pgsql.patch
46 Patch4:         %{name}-master.cf_cyrus.patch
47 Patch5:         %{name}-ipv6.patch
48 Patch6:         %{name}-pl.patch
49 Patch7:         %{name}-cdb_man.patch
50 Patch8:         %{name}-ns-mx-acl.patch
51 Patch9:         %{name}-kill_warnings.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 Provides:       smtpdaemon
76 Obsoletes:      smtpdaemon
77 Obsoletes:      exim
78 Obsoletes:      masqmail
79 Obsoletes:      omta
80 Obsoletes:      qmail
81 Obsoletes:      sendmail
82 Obsoletes:      sendmail-cf
83 Obsoletes:      sendmail-doc
84 Obsoletes:      smail
85 Obsoletes:      zmailer
86 Requires:       diffutils
87 Requires:       findutils
88 %{?with_cdb:Requires:tinycdb}
89 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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 %patch9 -p1
223 %{?with_cdb:sh dict_cdb.sh}
224
225 %build
226 %{__make} -f Makefile.init makefiles
227 %{__make} tidy
228 %{__make} DEBUG="" OPT="%{rpmcflags}" \
229         %{!?with_ldap:LDAPSO=""} \
230         %{!?with_mysql:MYSQLSO=""} \
231         %{!?with_pgsql:PGSQLSO=""} \
232         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}" \
233         AUXLIBS="-ldb -lresolv %{?with_sasl:-lsasl} %{?with_ssl:-lssl -lcrypto} %{?with_cdb:-lcdb}"
234
235 %install
236 rm -rf $RPM_BUILD_ROOT
237 install -d $RPM_BUILD_ROOT/etc/{cron.daily,rc.d/init.d,sysconfig} \
238         $RPM_BUILD_ROOT%{_sysconfdir}/{mail,sasl} \
239         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}/postfix,/usr/lib}\
240         $RPM_BUILD_ROOT{%{_includedir}/postfix,%{_mandir}/man{1,5,8}} \
241         $RPM_BUILD_ROOT%{_var}/spool/postfix/{active,corrupt,deferred,maildrop,private,saved,bounce,defer,incoming,pid,public} \
242         pfixtls
243
244 rm -f {html,man}/Makefile.in conf/{LICENSE,main.cf.default}
245
246 install -d sample-conf; mv -f conf/sample* sample-conf || :
247
248 install bin/* $RPM_BUILD_ROOT%{_sbindir}
249 install libexec/* $RPM_BUILD_ROOT%{_libdir}/postfix
250 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail
251 sed -e's,^daemon_directory = .*,daemon_directory = %{_libdir}/postfix,' \
252         conf/main.cf > $RPM_BUILD_ROOT%{_sysconfdir}/mail/main.cf
253
254 for f in dns global master util ; do
255         install lib/lib${f}.a $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so.1
256         ln -sf lib${f}.so.1 $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so
257 done
258 install lib/dict*.so $RPM_BUILD_ROOT%{_libdir}/postfix
259 install include/*.h $RPM_BUILD_ROOT%{_includedir}/postfix
260
261 (cd man; tar cf - .) | (cd $RPM_BUILD_ROOT%{_mandir}; tar xf -)
262
263 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
264 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/postfix
265 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/postfix
266 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/postfix
267 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/sasl/smtpd.conf
268 install auxiliary/rmail/rmail $RPM_BUILD_ROOT%{_bindir}/rmail
269
270 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/mailq
271 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/newaliases
272 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail
273
274 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/\
275         {aliases,access,canonical,relocated,transport,virtual}{,.db}
276
277 > $RPM_BUILD_ROOT/var/spool/postfix/.nofinger
278
279 %clean
280 rm -rf $RPM_BUILD_ROOT
281
282 %pre
283 if [ -n "`/usr/bin/getgid postfix`" ]; then
284         if [ "`getgid postfix`" != "62" ]; then
285                 echo "Error: group postfix doesn't have gid=62. Correct this before installing postfix." 1>&2
286                 exit 1
287         fi
288 else
289         /usr/sbin/groupadd -g 62 -r -f postfix
290 fi
291 if [ -n "`/usr/bin/getgid maildrop`" ]; then
292         if [ "`/usr/bin/getgid maildrop`" != "63" ]; then
293                 echo "Error: group maildrop doesn't have gid=63. Correct this before installing postfix." 1>&2
294                 exit 1
295         fi
296 else
297         /usr/sbin/groupadd -g 63 -r -f maildrop
298 fi
299 if [ -n "`/bin/id -u postfix 2>/dev/null`" ]; then
300         if [ "`/bin/id -u postfix`" != "62" ]; then
301                 echo "Error: user postfix doesn't have uid=62. Correct this before installing postfix." 1>&2
302                 exit 1
303         fi
304 else
305         /usr/sbin/useradd -u 62 -r -d /var/spool/postfix -s /bin/false -c "Postfix User" -g postfix postfix 1>&2
306 fi
307
308 %post
309 /sbin/ldconfig
310 if ! grep -q "^postmaster:" /etc/mail/aliases; then
311         echo "Adding Entry for postmaster in /etc/mail/aliases" >&2
312         echo "postmaster:       root" >>/etc/mail/aliases
313 fi
314 if ! grep -q "^myhostname" /etc/mail/main.cf; then
315         postconf -e myhostname=`/bin/hostname -f`
316 fi
317
318 newaliases
319 /sbin/chkconfig --add postfix
320 if [ -f /var/lock/subsys/postfix ]; then
321         /etc/rc.d/init.d/postfix restart >&2
322 else
323         echo "Run \"/etc/rc.d/init.d/postfix start\" to start postfix daemon." >&2
324 fi
325
326 %preun
327 if [ "$1" = "0" ]; then
328         if [ -f /var/lock/subsys/postfix ]; then
329                 /etc/rc.d/init.d/postfix stop >&2
330         fi
331         /sbin/chkconfig --del postfix
332 fi
333
334 %postun
335 /sbin/ldconfig
336 if [ "$1" = "0" ]; then
337         /usr/sbin/groupdel maildrop 2> /dev/null
338         /usr/sbin/userdel postfix 2> /dev/null
339         /usr/sbin/groupdel postfix 2> /dev/null
340 fi
341
342 %triggerpostun -- postfix < 1:1.1.2
343 umask 022
344 sed -e 's/^\(pickup[    ]\+fifo[        ]\+[^   ]\+[    ]\+\)[^         ]\+\([  ]\)/\1-\2/;
345 s/^\(cleanup[   ]\+unix[        ]\+\)[^         ]\+\([  ]\)/\1n\2/' /etc/mail/master.cf \
346         > /etc/mail/master.cf.rpmtmp
347 mv -f /etc/mail/master.cf.rpmtmp /etc/mail/master.cf
348
349 %files
350 %defattr(644,root,root,755)
351 %doc html *README COMPATIBILITY HISTORY LICENSE RELEASE_NOTES
352 %doc README_FILES/*README
353 %doc sample-conf
354 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/access
355 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/aliases
356 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/canonical
357 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/pcre_table
358 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/regexp_table
359 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/relocated
360 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/transport
361 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/virtual
362 #%ghost %{_sysconfdir}/mail/*.db
363 %dir %{_sysconfdir}/mail
364 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/dynamicmaps.cf
365 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/main.cf
366 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/master.cf
367 %attr(755,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/postfix-script
368 %attr(755,root,root) %{_sysconfdir}/mail/post-install
369 %{_sysconfdir}/mail/postfix-files
370 %attr(740,root,root) /etc/cron.daily/postfix
371 %attr(754,root,root) /etc/rc.d/init.d/postfix
372 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/postfix
373 %{?with_sasl:%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sasl/smtpd.conf}
374 %attr(755,root,root) %{_libdir}/libpostfix-*.so.*
375 %attr(755,root,root) %{_bindir}/*
376 %attr(755,root,root) %{_sbindir}/s*
377 %attr(755,root,root) %{_sbindir}/postfix
378 %attr(755,root,root) %{_sbindir}/postalias
379 %attr(755,root,root) %{_sbindir}/postkick
380 %attr(755,root,root) %{_sbindir}/postl*
381 %attr(755,root,root) %{_sbindir}/postc*
382 %attr(755,root,root) %{_sbindir}/postmap
383 %attr(2755,root,maildrop) %{_sbindir}/postqueue
384 %attr(755,root,root) %{_sbindir}/postsuper
385 %attr(2755,root,maildrop) %{_sbindir}/postdrop
386 %attr(755,root,root) %{_sbindir}/qmqp-source
387 %attr(755,root,root) /usr/lib/sendmail
388 %dir %{_libdir}/postfix
389 %attr(755,root,root) %{_libdir}/postfix/[!d]*
390 %attr(755,root,root) %dir %{_var}/spool/postfix
391 %attr(700, postfix,root) %dir %{_var}/spool/postfix/active
392 %attr(700, postfix,root) %dir %{_var}/spool/postfix/bounce
393 %attr(700, postfix,root) %dir %{_var}/spool/postfix/corrupt
394 %attr(700, postfix,root) %dir %{_var}/spool/postfix/defer
395 %attr(700, postfix,root) %dir %{_var}/spool/postfix/deferred
396 %attr(700, postfix,root) %dir %{_var}/spool/postfix/incoming
397 %attr(1730,postfix,maildrop) %dir %{_var}/spool/postfix/maildrop
398 %attr(755, postfix,root) %dir %{_var}/spool/postfix/pid
399 %attr(700, postfix,root) %dir %{_var}/spool/postfix/private
400 %attr(710, postfix,maildrop) %dir %{_var}/spool/postfix/public
401 %attr(700, postfix,root) %dir %{_var}/spool/postfix/saved
402 %attr(644, postfix,root) %{_var}/spool/postfix/.nofinger
403 %{_mandir}/man*/*
404
405 %files devel
406 %defattr(644,root,root,755)
407 %attr(755,root,root) %{_libdir}/libpostfix-*.so
408 %{_includedir}/postfix
409
410 %if %{with ldap}
411 %files dict-ldap
412 %defattr(644,root,root,755)
413 %attr(755,root,root) %{_libdir}/postfix/dict_ldap.so
414 %endif
415
416 %if %{with mysql}
417 %files dict-mysql
418 %defattr(644,root,root,755)
419 %attr(755,root,root) %{_libdir}/postfix/dict_mysql.so
420 %endif
421
422 %files dict-pcre
423 %defattr(644,root,root,755)
424 %attr(755,root,root) %{_libdir}/postfix/dict_pcre.so
425
426 %if %{with pgsql}
427 %files dict-pgsql
428 %defattr(644,root,root,755)
429 %attr(755,root,root) %{_libdir}/postfix/dict_pgsql.so
430 %endif
This page took 0.426764 seconds and 4 git commands to generate.