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