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