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