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