]> git.pld-linux.org Git - packages/postfix.git/blob - postfix.spec
- postfix up to 2.0.10 (code cleanup)
[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.13-2.0.9-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.10
27 Release:        1
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 Source1:        %{name}.aliases
33 Source2:        %{name}.cron
34 Source3:        %{name}.init
35 Source5:        %{name}.sysconfig
36 Source6:        ftp://ftp.aet.tu-cottbus.de/pub/pfixtls/pfixtls-%{tls_ver}.tar.gz
37 Source7:        %{name}.sasl
38 Source8:        ftp://ftp.corpit.ru/pub/postfix/%{name}-dict_cdb-1.1.11-20021104.tar.gz
39 Patch0:         %{name}-config.patch
40 Patch1:         %{name}-conf_msg.patch
41 Patch2:         %{name}-dynamicmaps.patch
42 Patch3:         %{name}-pgsql.patch
43 Patch4:         %{name}-master.cf_cyrus.patch
44 Patch5:         %{name}-ipv6.patch
45 Patch6:         %{name}-pl.patch
46 Patch7:         %{name}-cdb_man.patch
47 URL:            http://www.postfix.org/
48 BuildRequires:  awk
49 %{!?_without_sasl:BuildRequires:        cyrus-sasl-devel}
50 BuildRequires:  db-devel
51 BuildRequires:  grep
52 %{!?_without_ipv6:BuildRequires:        libinet6 >= 0.20030228-1}
53 %{!?_without_mysql:BuildRequires:       mysql-devel}
54 %{!?_without_ldap:BuildRequires:        openldap-devel >= 2.0.0}
55 %{!?_without_ssl:BuildRequires:         openssl-devel >= 0.9.7b}
56 BuildRequires:  pcre-devel
57 %{!?_without_pgsql:BuildRequires:       postgresql-devel}
58 %{?_with_cdb:BuildRequires:             tinycdb-devel}
59 PreReq:         rc-scripts
60 PreReq:         sed
61 Requires(pre):  /usr/sbin/useradd
62 Requires(pre):  /usr/sbin/groupadd
63 Requires(pre):  /usr/bin/getgid
64 Requires(pre):  /bin/id
65 Requires(post): /bin/hostname
66 Requires(post,postun):  /sbin/ldconfig
67 Requires(post,preun):   /sbin/chkconfig
68 Requires(postun):       /usr/sbin/userdel
69 Requires(postun):       /usr/sbin/groupdel
70 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71 Provides:       smtpdaemon
72 Obsoletes:      smtpdaemon
73 Obsoletes:      exim
74 Obsoletes:      masqmail
75 Obsoletes:      omta
76 Obsoletes:      qmail
77 Obsoletes:      sendmail
78 Obsoletes:      sendmail-cf
79 Obsoletes:      sendmail-doc
80 Obsoletes:      smail
81 Obsoletes:      zmailer
82 Requires:       diffutils
83 Requires:       findutils
84 %{?_with_cdb:Requires:tinycdb}
85
86 %description
87 Postfix is attempt to provide an alternative to the widely-used
88 Sendmail program. Postfix attempts to be fast, easy to administer, and
89 hopefully secure, while at the same time being sendmail compatible
90 enough to not upset your users. %{!?_without_ipv6:This version has IPv6 support.}
91
92 %description -l pt_BR
93 O Postfix é uma alternativa para o mundialmente utilizado sendmail. Se
94 você deseja um servidor SMTP *rápido*, instale este pacote.
95
96 %description -l es
97 Postfix es una alternativa para el mundialmente utilizado sendmail. Si
98 desea tener un servidor SMTP *rápido*, debe instalar este paquete.
99
100 %description -l fr
101 Postfix (voir http://www.postfix.org/) se veut une alternative à
102 sendmail, responsable de l'acheminement de 70% des courriers
103 électroniques sur Internet. IBM en a suppotré le développement, mais
104 ne contrôle pas son évolution. Le but est d'installer Postfix sur le
105 plus grand nombre de systèmes possible. Dans cette optique, il a été
106 écrit pour être totalement sous le contrôle de l'utilisateur.
107
108 %description -l it
109 Postfix (http://www.postfix.org/) e' un'alternativa al programma
110 sendmail utilizzato per la gestione del 70 per cento della posta
111 Internet.
112
113 Seppur IBM supporti lo sviluppo di Postfix, non controlla la sua
114 evoluzione.
115
116 Consultate la pagine web http://www.moongroup.com/how-to.phtml nella
117 quale troverete le indicazioni per una corretta installazione e
118 configurazione di questo programma.
119
120 %description -l pl
121 Postfix jest prób± dostarczenia alternatywnego MTA w stosunku do
122 szeroko u¿ywanego sendmaila. Postfix w zamierzeniu ma byæ szybki,
123 ³atwy w administrowaniu, bezpieczny oraz ma byæ na tyle kompatybilny z
124 sendmailem by nie denerwowaæ Twoich u¿ytkowników. %{!?_without_ipv6:Ta wersja wspiera IPv6.}
125
126 %description -l pt_BR
127 O Postfix é uma alternativa para o mundialmente utilizado sendmail. Se
128 você deseja um servidor SMTP *rápido*, instale este pacote.
129
130 %description -l sk
131 Postfix (pozri http://www.postfix.org/) má za cieµ by» alternatívou k
132 ¹iroko roz¹írenému programu sendmail, zodpovednému za 70% v¹etkej
133 elektronickej po¹ty doruèenej na Internete.
134
135 Aj keï IBM podporovala vývoj Postfixu, zdr¾iava sa vplyvu na jeho
136 vývoj. Cieµom je in¹talácia Postfixu na èo najväè¹om poète systémov.
137 Do tohoto momentu je softvér poskytovaný bez ovplyvòovania, tak¾e sa
138 mô¾e vyvíja» podµa jeho pou¾ívateµov.
139
140 Urèite si preèítajte http://www.moongroup.com/how-to.phtml, kde sú
141 popísané kroky potrebné pred a po in¹talácii Postfixu.
142
143 %package devel
144 Summary:        Postfix loadable modules development package
145 Summary(pl):    Pakiet dla programistów ³adowanych modu³ów do postfiksa
146 Group:          Development/Libraries
147 Requires:       %{name} = %{version}
148
149 %description devel
150 Header files to build additional map types for Postfix.
151
152 %description devel -l pl
153 Pliki nag³ówkowe do tworzenia dodatkowych typów map dla Postfiksa.
154
155 %package dict-ldap
156 Summary:        LDAP map support for Postfix
157 Summary(pl):    Obs³uga map LDAP dla Postfiksa
158 Group:          Networking/Daemons
159 Requires:       %{name} = %{version}
160 Requires:       openldap >= 2.0.0
161
162 %description dict-ldap
163 This package provides support for LDAP maps in Postfix.
164
165 %description dict-ldap -l pl
166 Ten pakiet dodaje obs³ugê map LDAP do Postfiksa.
167
168 %package dict-mysql
169 Summary:        MySQL map support for Postfix
170 Summary(pl):    Obs³uga map MySQL dla Postfiksa
171 Group:          Networking/Daemons
172 Requires:       %{name} = %{version}
173
174 %description dict-mysql
175 This package provides support for MySQL maps in Postfix.
176
177 %description dict-mysql -l pl
178 Ten pakiet dodaje obs³ugê map MySQL do Postfiksa.
179
180 %package dict-pcre
181 Summary:        PCRE map support for Postfix
182 Summary(pl):    Obs³uga map PCRE dla Postfiksa
183 Group:          Networking/Daemons
184 Requires:       %{name} = %{version}
185
186 %description dict-pcre
187 This package provides support for PCRE maps in Postfix.
188
189 %description dict-pcre -l pl
190 Ten pakiet dodaje obs³ugê map PCRE do Postfiksa.
191
192 %package dict-pgsql
193 Summary:        PostgreSQL map support for Postfix
194 Summary(pl):    Obs³uga map PostgreSQL dla Postfiksa
195 Group:          Networking/Daemons
196 Requires:       %{name} = %{version}
197
198 %description dict-pgsql
199 This package provides support for PostgreSQL maps in Postfix.
200
201 %description dict-pgsql -l pl
202 Ten pakiet dodaje obs³ugê map PostgreSQL do Postfiksa.
203
204 %prep
205 %setup -q -a6 %{?_with_cdb:-a8}
206 echo Postfix TLS patch:
207 patch -p1 -s <pfixtls-%{tls_ver}/pfixtls.diff
208 %patch0 -p1
209 %patch1 -p1
210 %patch2 -p1
211 %patch3 -p1
212 %patch4 -p1
213 %{!?_without_ipv6:%patch5 -p1}
214 %{?_with_polish:%patch6 -p1}
215 %{?_with_cdb:%patch7 -p1}
216 %{?_with_cdb:sh dict_cdb.sh}
217
218 %build
219 %{__make} -f Makefile.init makefiles
220 %{__make} tidy
221 %{__make} DEBUG="" OPT="%{rpmcflags}" \
222         %{?_without_ldap:LDAPSO=""} \
223         %{?_without_mysql:MYSQLSO=""} \
224         %{?_without_pgsql:PGSQLSO=""} \
225         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}" \
226         AUXLIBS="-ldb -lresolv %{!?_without_sasl:-lsasl} %{!?_without_ssl:-lssl -lcrypto} %{?_with_cdb:-L/usr/lib/libcdb.a -lcdb}"
227
228 %install
229 rm -rf $RPM_BUILD_ROOT
230 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{mail,cron.daily,rc.d/init.d,sasl,sysconfig} \
231         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}/postfix,%{_includedir}/postfix,%{_mandir}/man{1,5,8}} \
232         $RPM_BUILD_ROOT%{_var}/spool/postfix/{active,corrupt,deferred,maildrop,private,saved,bounce,defer,incoming,pid,public} \
233         pfixtls
234
235 rm -f {html,man}/Makefile.in conf/{LICENSE,main.cf.default}
236
237 install -d sample-conf; mv -f conf/sample* sample-conf/ || :
238
239 install bin/* $RPM_BUILD_ROOT%{_sbindir}
240 install libexec/* $RPM_BUILD_ROOT%{_libdir}/postfix
241 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail
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 %{SOURCE7} $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%{_libdir}/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 %{!?_without_sasl:%config(noreplace) %verify(not size mtime md5) /etc/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) %{_libdir}/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 0%{!?_without_ldap:1}
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 0%{!?_without_mysql:1}
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 0%{!?_without_pgsql:1}
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.108014 seconds and 4 git commands to generate.