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