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