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