]> git.pld-linux.org Git - packages/postfix.git/blob - postfix.spec
-"implicit declaration of function" and "assignment makes pointer from integer withou...
[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:        2
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,/usr/lib}\
239         $RPM_BUILD_ROOT{%{_includedir}/postfix,%{_mandir}/man{1,5,8}} \
240         $RPM_BUILD_ROOT%{_var}/spool/postfix/{active,corrupt,deferred,maildrop,private,saved,bounce,defer,incoming,pid,public} \
241         pfixtls
242
243 rm -f {html,man}/Makefile.in conf/{LICENSE,main.cf.default}
244
245 install -d sample-conf; mv -f conf/sample* sample-conf || :
246
247 install bin/* $RPM_BUILD_ROOT%{_sbindir}
248 install libexec/* $RPM_BUILD_ROOT%{_libdir}/postfix
249 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail
250
251 for f in dns global master util ; do
252         install lib/lib${f}.a $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so.1
253         ln -sf lib${f}.so.1 $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so
254 done
255 install lib/dict*.so $RPM_BUILD_ROOT%{_libdir}/postfix
256 install include/*.h $RPM_BUILD_ROOT%{_includedir}/postfix
257
258 (cd man; tar cf - .) | (cd $RPM_BUILD_ROOT%{_mandir}; tar xf -)
259
260 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
261 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/postfix
262 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/postfix
263 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/postfix
264 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/sasl/smtpd.conf
265 install auxiliary/rmail/rmail $RPM_BUILD_ROOT%{_bindir}/rmail
266
267 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/mailq
268 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/newaliases
269 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail
270
271 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/\
272         {aliases,access,canonical,relocated,transport,virtual}{,.db}
273
274 > $RPM_BUILD_ROOT/var/spool/postfix/.nofinger
275
276 %clean
277 rm -rf $RPM_BUILD_ROOT
278
279 %pre
280 if [ -n "`/usr/bin/getgid postfix`" ]; then
281         if [ "`getgid postfix`" != "62" ]; then
282                 echo "Error: group postfix doesn't have gid=62. Correct this before installing postfix." 1>&2
283                 exit 1
284         fi
285 else
286         /usr/sbin/groupadd -g 62 -r -f postfix
287 fi
288 if [ -n "`/usr/bin/getgid maildrop`" ]; then
289         if [ "`/usr/bin/getgid maildrop`" != "63" ]; then
290                 echo "Error: group maildrop doesn't have gid=63. Correct this before installing postfix." 1>&2
291                 exit 1
292         fi
293 else
294         /usr/sbin/groupadd -g 63 -r -f maildrop
295 fi
296 if [ -n "`/bin/id -u postfix 2>/dev/null`" ]; then
297         if [ "`/bin/id -u postfix`" != "62" ]; then
298                 echo "Error: user postfix doesn't have uid=62. Correct this before installing postfix." 1>&2
299                 exit 1
300         fi
301 else
302         /usr/sbin/useradd -u 62 -r -d /var/spool/postfix -s /bin/false -c "Postfix User" -g postfix postfix 1>&2
303 fi
304
305 %post
306 /sbin/ldconfig
307 if ! grep -q "^postmaster:" /etc/mail/aliases; then
308         echo "Adding Entry for postmaster in /etc/mail/aliases" >&2
309         echo "postmaster:       root" >>/etc/mail/aliases
310 fi
311 if ! grep -q "^myhostname" /etc/mail/main.cf; then
312         postconf -e myhostname=`/bin/hostname -f`
313 fi
314
315 newaliases
316 /sbin/chkconfig --add postfix
317 if [ -f /var/lock/subsys/postfix ]; then
318         /etc/rc.d/init.d/postfix restart >&2
319 else
320         echo "Run \"/etc/rc.d/init.d/postfix start\" to start postfix daemon." >&2
321 fi
322
323 %preun
324 if [ "$1" = "0" ]; then
325         if [ -f /var/lock/subsys/postfix ]; then
326                 /etc/rc.d/init.d/postfix stop >&2
327         fi
328         /sbin/chkconfig --del postfix
329 fi
330
331 %postun
332 /sbin/ldconfig
333 if [ "$1" = "0" ]; then
334         /usr/sbin/groupdel maildrop 2> /dev/null
335         /usr/sbin/userdel postfix 2> /dev/null
336         /usr/sbin/groupdel postfix 2> /dev/null
337 fi
338
339 %triggerpostun -- postfix < 1:1.1.2
340 umask 022
341 sed -e 's/^\(pickup[    ]\+fifo[        ]\+[^   ]\+[    ]\+\)[^         ]\+\([  ]\)/\1-\2/;
342 s/^\(cleanup[   ]\+unix[        ]\+\)[^         ]\+\([  ]\)/\1n\2/' /etc/mail/master.cf \
343         > /etc/mail/master.cf.rpmtmp
344 mv -f /etc/mail/master.cf.rpmtmp /etc/mail/master.cf
345
346 %files
347 %defattr(644,root,root,755)
348 %doc html *README COMPATIBILITY HISTORY LICENSE RELEASE_NOTES
349 %doc README_FILES/*README
350 %doc sample-conf
351 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/access
352 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/aliases
353 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/canonical
354 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/pcre_table
355 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/regexp_table
356 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/relocated
357 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/transport
358 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/virtual
359 #%ghost %{_sysconfdir}/mail/*.db
360 %dir %{_sysconfdir}/mail
361 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/dynamicmaps.cf
362 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/main.cf
363 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/master.cf
364 %attr(755,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/postfix-script
365 %attr(755,root,root) %{_sysconfdir}/mail/post-install
366 %{_sysconfdir}/mail/postfix-files
367 %attr(740,root,root) /etc/cron.daily/postfix
368 %attr(754,root,root) /etc/rc.d/init.d/postfix
369 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/postfix
370 %{?with_sasl:%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sasl/smtpd.conf}
371 %attr(755,root,root) %{_libdir}/libpostfix-*.so.*
372 %attr(755,root,root) %{_bindir}/*
373 %attr(755,root,root) %{_sbindir}/s*
374 %attr(755,root,root) %{_sbindir}/postfix
375 %attr(755,root,root) %{_sbindir}/postalias
376 %attr(755,root,root) %{_sbindir}/postkick
377 %attr(755,root,root) %{_sbindir}/postl*
378 %attr(755,root,root) %{_sbindir}/postc*
379 %attr(755,root,root) %{_sbindir}/postmap
380 %attr(2755,root,maildrop) %{_sbindir}/postqueue
381 %attr(755,root,root) %{_sbindir}/postsuper
382 %attr(2755,root,maildrop) %{_sbindir}/postdrop
383 %attr(755,root,root) %{_sbindir}/qmqp-source
384 %attr(755,root,root) /usr/lib/sendmail
385 %dir %{_libdir}/postfix
386 %attr(755,root,root) %{_libdir}/postfix/[!d]*
387 %attr(755,root,root) %dir %{_var}/spool/postfix
388 %attr(700, postfix,root) %dir %{_var}/spool/postfix/active
389 %attr(700, postfix,root) %dir %{_var}/spool/postfix/bounce
390 %attr(700, postfix,root) %dir %{_var}/spool/postfix/corrupt
391 %attr(700, postfix,root) %dir %{_var}/spool/postfix/defer
392 %attr(700, postfix,root) %dir %{_var}/spool/postfix/deferred
393 %attr(700, postfix,root) %dir %{_var}/spool/postfix/incoming
394 %attr(1730,postfix,maildrop) %dir %{_var}/spool/postfix/maildrop
395 %attr(755, postfix,root) %dir %{_var}/spool/postfix/pid
396 %attr(700, postfix,root) %dir %{_var}/spool/postfix/private
397 %attr(710, postfix,maildrop) %dir %{_var}/spool/postfix/public
398 %attr(700, postfix,root) %dir %{_var}/spool/postfix/saved
399 %attr(644, postfix,root) %{_var}/spool/postfix/.nofinger
400 %{_mandir}/man*/*
401
402 %files devel
403 %defattr(644,root,root,755)
404 %attr(755,root,root) %{_libdir}/libpostfix-*.so
405 %{_includedir}/postfix
406
407 %if %{with ldap}
408 %files dict-ldap
409 %defattr(644,root,root,755)
410 %attr(755,root,root) %{_libdir}/postfix/dict_ldap.so
411 %endif
412
413 %if %{with mysql}
414 %files dict-mysql
415 %defattr(644,root,root,755)
416 %attr(755,root,root) %{_libdir}/postfix/dict_mysql.so
417 %endif
418
419 %files dict-pcre
420 %defattr(644,root,root,755)
421 %attr(755,root,root) %{_libdir}/postfix/dict_pcre.so
422
423 %if %{with pgsql}
424 %files dict-pgsql
425 %defattr(644,root,root,755)
426 %attr(755,root,root) %{_libdir}/postfix/dict_pgsql.so
427 %endif
This page took 0.084996 seconds and 3 git commands to generate.