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