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