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