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