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