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