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