]> git.pld-linux.org Git - packages/postfix.git/blob - postfix.spec
- obsoletes courier
[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.3
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:  9e26a2bb0cf36d6a9739c501ec26246a
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 Patch8:         %{name}-kill_warnings.patch
45 Patch9:         %{name}-ipv6-kill_warnings.patch
46 URL:            http://www.postfix.org/
47 BuildRequires:  awk
48 %{?with_sasl:BuildRequires:     cyrus-sasl-devel}
49 BuildRequires:  db-devel
50 BuildRequires:  grep
51 BuildRequires:  libinet6 >= 0.20030228-1
52 %{?with_mysql:BuildRequires:    mysql-devel}
53 %{?with_ldap:BuildRequires:     openldap-devel >= 2.0.0}
54 %{?with_ssl:BuildRequires:      openssl-devel >= 0.9.7c}
55 BuildRequires:  pcre-devel
56 %{?with_pgsql:BuildRequires:    postgresql-devel}
57 %{?with_cdb:BuildRequires:      tinycdb-devel}
58 PreReq:         rc-scripts
59 PreReq:         sed
60 Requires(pre):  /usr/sbin/useradd
61 Requires(pre):  /usr/sbin/groupadd
62 Requires(pre):  /usr/bin/getgid
63 Requires(pre):  /bin/id
64 Requires(post): /bin/hostname
65 Requires(post,postun):  /sbin/ldconfig
66 Requires(post,preun):   /sbin/chkconfig
67 Requires(postun):       /usr/sbin/userdel
68 Requires(postun):       /usr/sbin/groupdel
69 Requires:       diffutils
70 Requires:       findutils
71 %{?with_cdb:Requires:tinycdb}
72 Provides:       smtpdaemon
73 Obsoletes:      courier
74 Obsoletes:      exim
75 Obsoletes:      masqmail
76 Obsoletes:      omta
77 Obsoletes:      qmail
78 Obsoletes:      sendmail
79 Obsoletes:      sendmail-cf
80 Obsoletes:      sendmail-doc
81 Obsoletes:      smail
82 Obsoletes:      smtpdaemon
83 Obsoletes:      zmailer
84 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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. 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. 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} = %{epoch}:%{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} = %{epoch}:%{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} = %{epoch}:%{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} = %{epoch}:%{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} = %{epoch}:%{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 %{?with_cdb:-a7}
206 zcat %{SOURCE8} | patch -p1 -s
207 %patch0 -p1
208 %patch1 -p1
209 %patch2 -p1
210 %patch3 -p1
211 %patch4 -p1
212 %{?with_polish:%patch5 -p1}
213 %{?with_cdb:%patch6 -p1}
214 %patch7 -p1
215 %patch8 -p1
216 %patch9 -p1
217 %{?with_cdb:sh dict_cdb.sh}
218
219 %build
220 %{__make} -f Makefile.init makefiles
221 %{__make} tidy
222 %{__make} DEBUG="" OPT="%{rpmcflags}" \
223         %{!?with_ldap:LDAPSO=""} \
224         %{!?with_mysql:MYSQLSO=""} \
225         %{!?with_pgsql:PGSQLSO=""} \
226         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}" \
227         AUXLIBS="-ldb -lresolv %{?with_sasl:-lsasl} %{?with_ssl:-lssl -lcrypto} %{?with_cdb:-lcdb}"
228
229 %install
230 rm -rf $RPM_BUILD_ROOT
231 install -d $RPM_BUILD_ROOT/etc/{cron.daily,rc.d/init.d,sysconfig} \
232         $RPM_BUILD_ROOT%{_sysconfdir}/{mail,sasl} \
233         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}/postfix,/usr/lib}\
234         $RPM_BUILD_ROOT{%{_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 sed -e's,^daemon_directory = .*,daemon_directory = %{_libdir}/postfix,' \
246         conf/main.cf > $RPM_BUILD_ROOT%{_sysconfdir}/mail/main.cf
247
248 for f in dns global master util ; do
249         install lib/lib${f}.a $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so.1
250         ln -sf lib${f}.so.1 $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so
251 done
252 install lib/dict*.so $RPM_BUILD_ROOT%{_libdir}/postfix
253 install include/*.h $RPM_BUILD_ROOT%{_includedir}/postfix
254
255 (cd man; tar cf - .) | (cd $RPM_BUILD_ROOT%{_mandir}; tar xf -)
256
257 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
258 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/postfix
259 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/postfix
260 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/postfix
261 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/sasl/smtpd.conf
262 install auxiliary/rmail/rmail $RPM_BUILD_ROOT%{_bindir}/rmail
263
264 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/mailq
265 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/newaliases
266 ln -sf /usr/sbin/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail
267
268 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/\
269         {aliases,access,canonical,relocated,transport,virtual}{,.db}
270
271 > $RPM_BUILD_ROOT/var/spool/postfix/.nofinger
272
273 %clean
274 rm -rf $RPM_BUILD_ROOT
275
276 %pre
277 if [ -n "`/usr/bin/getgid postfix`" ]; then
278         if [ "`getgid postfix`" != "62" ]; then
279                 echo "Error: group postfix doesn't have gid=62. Correct this before installing postfix." 1>&2
280                 exit 1
281         fi
282 else
283         /usr/sbin/groupadd -g 62 -r -f postfix
284 fi
285 if [ -n "`/usr/bin/getgid maildrop`" ]; then
286         if [ "`/usr/bin/getgid maildrop`" != "63" ]; then
287                 echo "Error: group maildrop doesn't have gid=63. Correct this before installing postfix." 1>&2
288                 exit 1
289         fi
290 else
291         /usr/sbin/groupadd -g 63 -r -f maildrop
292 fi
293 if [ -n "`/bin/id -u postfix 2>/dev/null`" ]; then
294         if [ "`/bin/id -u postfix`" != "62" ]; then
295                 echo "Error: user postfix doesn't have uid=62. Correct this before installing postfix." 1>&2
296                 exit 1
297         fi
298 else
299         /usr/sbin/useradd -u 62 -r -d /var/spool/postfix -s /bin/false -c "Postfix User" -g postfix postfix 1>&2
300 fi
301
302 %post
303 /sbin/ldconfig
304 if ! grep -q "^postmaster:" /etc/mail/aliases; then
305         echo "Adding Entry for postmaster in /etc/mail/aliases" >&2
306         echo "postmaster:       root" >>/etc/mail/aliases
307 fi
308 if [ "$1" = "1" ]; then
309 # only on installation, not upgrade
310         if ! grep -q "^myhostname" /etc/mail/main.cf; then
311                 postconf -e myhostname=`/bin/hostname -f`
312         fi
313 fi
314
315 newaliases
316 /sbin/chkconfig --add postfix
317 if [ -f /var/lock/subsys/postfix ]; then
318         /etc/rc.d/init.d/postfix restart >&2
319 else
320         echo "Run \"/etc/rc.d/init.d/postfix start\" to start postfix daemon." >&2
321 fi
322
323 %preun
324 if [ "$1" = "0" ]; then
325         if [ -f /var/lock/subsys/postfix ]; then
326                 /etc/rc.d/init.d/postfix stop >&2
327         fi
328         /sbin/chkconfig --del postfix
329 fi
330
331 %postun
332 /sbin/ldconfig
333 if [ "$1" = "0" ]; then
334         /usr/sbin/groupdel maildrop 2> /dev/null
335         /usr/sbin/userdel postfix 2> /dev/null
336         /usr/sbin/groupdel postfix 2> /dev/null
337 fi
338
339 %triggerpostun -- postfix < 1:1.1.2
340 umask 022
341 sed -e 's/^\(pickup[    ]\+fifo[        ]\+[^   ]\+[    ]\+\)[^         ]\+\([  ]\)/\1-\2/;
342 s/^\(cleanup[   ]\+unix[        ]\+\)[^         ]\+\([  ]\)/\1n\2/' /etc/mail/master.cf \
343         > /etc/mail/master.cf.rpmtmp
344 mv -f /etc/mail/master.cf.rpmtmp /etc/mail/master.cf
345
346 %files
347 %defattr(644,root,root,755)
348 %doc html *README COMPATIBILITY HISTORY LICENSE RELEASE_NOTES
349 %doc README_FILES/*README
350 %doc sample-conf
351 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/access
352 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/aliases
353 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/canonical
354 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/pcre_table
355 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/regexp_table
356 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/relocated
357 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/transport
358 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/virtual
359 #%ghost %{_sysconfdir}/mail/*.db
360 %dir %{_sysconfdir}/mail
361 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/dynamicmaps.cf
362 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/main.cf
363 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/master.cf
364 %attr(755,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/postfix-script
365 %attr(755,root,root) %{_sysconfdir}/mail/post-install
366 %{_sysconfdir}/mail/postfix-files
367 %attr(740,root,root) /etc/cron.daily/postfix
368 %attr(754,root,root) /etc/rc.d/init.d/postfix
369 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/postfix
370 %{?with_sasl:%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sasl/smtpd.conf}
371 %attr(755,root,root) %{_libdir}/libpostfix-*.so.*
372 %attr(755,root,root) %{_bindir}/*
373 %attr(755,root,root) %{_sbindir}/s*
374 %attr(755,root,root) %{_sbindir}/postfix
375 %attr(755,root,root) %{_sbindir}/postalias
376 %attr(755,root,root) %{_sbindir}/postkick
377 %attr(755,root,root) %{_sbindir}/postl*
378 %attr(755,root,root) %{_sbindir}/postc*
379 %attr(755,root,root) %{_sbindir}/postmap
380 %attr(2755,root,maildrop) %{_sbindir}/postqueue
381 %attr(755,root,root) %{_sbindir}/postsuper
382 %attr(2755,root,maildrop) %{_sbindir}/postdrop
383 %attr(755,root,root) %{_sbindir}/qmqp-source
384 %attr(755,root,root) /usr/lib/sendmail
385 %dir %{_libdir}/postfix
386 %attr(755,root,root) %{_libdir}/postfix/[!d]*
387 %attr(755,root,root) %dir %{_var}/spool/postfix
388 %attr(700, postfix,root) %dir %{_var}/spool/postfix/active
389 %attr(700, postfix,root) %dir %{_var}/spool/postfix/bounce
390 %attr(700, postfix,root) %dir %{_var}/spool/postfix/corrupt
391 %attr(700, postfix,root) %dir %{_var}/spool/postfix/defer
392 %attr(700, postfix,root) %dir %{_var}/spool/postfix/deferred
393 %attr(700, postfix,root) %dir %{_var}/spool/postfix/incoming
394 %attr(1730,postfix,maildrop) %dir %{_var}/spool/postfix/maildrop
395 %attr(755, postfix,root) %dir %{_var}/spool/postfix/pid
396 %attr(700, postfix,root) %dir %{_var}/spool/postfix/private
397 %attr(710, postfix,maildrop) %dir %{_var}/spool/postfix/public
398 %attr(700, postfix,root) %dir %{_var}/spool/postfix/saved
399 %attr(644, postfix,root) %{_var}/spool/postfix/.nofinger
400 %{_mandir}/man*/*
401
402 %files devel
403 %defattr(644,root,root,755)
404 %attr(755,root,root) %{_libdir}/libpostfix-*.so
405 %{_includedir}/postfix
406
407 %if %{with ldap}
408 %files dict-ldap
409 %defattr(644,root,root,755)
410 %attr(755,root,root) %{_libdir}/postfix/dict_ldap.so
411 %endif
412
413 %if %{with mysql}
414 %files dict-mysql
415 %defattr(644,root,root,755)
416 %attr(755,root,root) %{_libdir}/postfix/dict_mysql.so
417 %endif
418
419 %files dict-pcre
420 %defattr(644,root,root,755)
421 %attr(755,root,root) %{_libdir}/postfix/dict_pcre.so
422
423 %if %{with pgsql}
424 %files dict-pgsql
425 %defattr(644,root,root,755)
426 %attr(755,root,root) %{_libdir}/postfix/dict_pgsql.so
427 %endif
This page took 0.0585329999999999 seconds and 4 git commands to generate.