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