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