3 # --without sasl - build wihtout SMTP AUTH support
4 # --without ldap - build without LDAP support
5 # --without pcre - build without Perl Compatible Regular Expresion support
6 # --without ssl - build without SSL/TLS support
7 # --with mysql - build with MySQL support
8 # --without ipv6 - build without IPv6 support
10 %define tls_ver 0.7.3-snap20010525-0.9.6a
11 Summary: Postfix Mail Transport Agent
12 Summary(pl): Serwer SMTP Postfix
16 Group: Networking/Daemons
17 Group(de): Netzwerkwesen/Server
18 Group(pl): Sieciowe/Serwery
19 License: Distributable
20 Source0: ftp://ftp.porcupine.org/mirrors/postfix-release/experimental/snapshot-%{version}.tar.gz
21 Source1: %{name}.aliases
24 Source5: %{name}.sysconfig
25 Source6: ftp://ftp.aet.tu-cottbus.de/pub/pfixtls/pfixtls-%{tls_ver}.tar.gz
27 Patch0: %{name}-config.patch
28 Patch1: %{name}-pl.patch
29 Patch2: %{name}-conf_msg.patch
30 Patch3: %{name}-ipv6.patch
31 # ftp://ftp.aet.tu-cottbus.de/pub/pfixtls
32 #Patch4: %{name}-ssl.patch
33 URL: http://www.postfix.org/
36 %{!?_without_ldap:BuildRequires: openldap-devel >= 2.0.0}
37 %{!?_without_ssl:BuildRequires: openssl-devel >= 0.9.6a}
38 %{!?_without_pcre:BuildRequires: pcre-devel}
39 %{!?_without_sasl:BuildRequires: cyrus-sasl-devel}
40 %{!?_without_ipv6:BuildRequires: libinet6 >= 0.20010420-3}
41 BuildRequires: db3-devel
43 Prereq: /sbin/chkconfig
44 Prereq: /usr/sbin/useradd
45 Prereq: /usr/sbin/groupadd
46 Prereq: /usr/sbin/userdel
47 Prereq: /usr/sbin/groupdel
48 Prereq: /usr/bin/getgid
51 %{!?_without_ldap:Prereq: openldap >= 2.0.0}
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 Obsoletes: sendmail-cf
60 Obsoletes: sendmail-doc
64 %define _sysconfdir /etc
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 have IPv6 support and
71 %{!?_without_ldap:no }LDAP support.
74 Postfix jest prób± dostarczenia alternatywnego MTA w stosunku do
75 szeroko u¿ywanego sendmaila. Postfix w zamierzeniu ma byæ szybki,
76 ³atwy w administrowaniu, bezpieczny oraz ma byæ na tyle kompatybilny z
77 sendmailem by nie denerwowaæ Twoich u¿ytkowników. Ta wersja wspiera
78 IPv6%{!?_without_ldap: oraz LDAP}.
81 %setup -q -n snapshot-%{version} -a 6
84 patch -p1 -s <pfixtls-%{tls_ver}/pfixtls.diff
86 %{!?_without_ipv6:%patch3 -p1 }
89 %{__make} -f Makefile.init makefiles
91 %{__make} DEBUG="" OPT="%{rpmcflags}" \
92 CCARGS="%{!?_without_ldap:-DHAS_LDAP} %{!?_without_pcre:-DHAS_PCRE} %{!?_without_sasl:-DUSE_SASL_AUTH} %{?_with_mysql:-DHAS_MYSQL -I%{_includedir}/mysql} %{!?_without_ssl:-DHAS_SSL -I%{_includedir}/openssl}" \
93 AUXLIBS="%{!?_without_ldap:-llber -lldap} -lnsl -ldb -lresolv %{!?_without_pcre:-lpcre} %{!?_without_sasl:-lsasl} %{?_with_mysql:-lmysqlclient} %{!?_without_ssl:-lssl -lcrypto}"
96 rm -rf $RPM_BUILD_ROOT
97 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{mail,cron.daily,rc.d/init.d,sasl,sysconfig} \
98 $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}/postfix,%{_mandir}/man{1,5,8}} \
99 $RPM_BUILD_ROOT%{_var}/spool/postfix/{active,corrupt,deferred,maildrop,private,saved,bounce,defer,incoming,pid,public} \
102 rm -f {html,man}/Makefile.in conf/{LICENSE,main.cf.default}
104 install -d sample-conf; mv -f conf/sample* sample-conf/ || :
106 install bin/* $RPM_BUILD_ROOT%{_sbindir}
107 install libexec/* $RPM_BUILD_ROOT%{_libdir}/postfix
108 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail
110 (cd man; tar cf - .) | (cd $RPM_BUILD_ROOT%{_mandir}; tar xf -)
112 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
113 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/postfix
114 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/postfix
115 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/postfix
116 install %{SOURCE7} $RPM_BUILD_ROOT/etc/sasl/smtpd.conf
118 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/mailq
119 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/newaliases
120 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_libdir}/sendmail
122 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script-sgid \
123 $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script
125 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script-{diff,nosgid}
127 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/\
128 {aliases,access,canonical,relocated,transport,virtual}{,.db}
130 gzip -9nf *README HISTORY COMPATIBILITY LICENSE RELEASE_NOTES \
131 RESTRICTION_CLASS TODO
133 touch $RPM_BUILD_ROOT/var/spool/postfix/.nofinger
136 rm -rf $RPM_BUILD_ROOT
139 if [ -n "`/usr/bin/getgid postfix`" ]; then
140 if [ "`getgid postfix`" != "62" ]; then
141 echo "Warning: group postfix haven't gid=62. Correct this before installing postfix" 1>&2
145 /usr/sbin/groupadd -g 62 -r -f postfix
147 if [ -n "`/usr/bin/getgid maildrop`" ]; then
148 if [ "`/usr/bin/getgid maildrop`" != "63" ]; then
149 echo "Warning: group maildrop haven't gid=63. Correct this before installing postfix" 1>&2
153 /usr/sbin/groupadd -g 63 -r -f maildrop
155 if [ -n "`/bin/id -u postfix 2>/dev/null`" ]; then
156 if [ "`/bin/id -u postfix`" != "62" ]; then
157 echo "Warning: user postfix haven't uid=62. Correct this before installing postfix" 1>&2
161 /usr/sbin/useradd -u 62 -r -d /var/spool/postfix -s /bin/false -c "Postfix User" -g postfix postfix 1>&2
165 if ! grep -q "^postmaster:" /etc/mail/aliases; then
166 echo "Adding Entry for postmaster in /etc/mail/aliases" >&2
167 echo "postmaster: root" >>/etc/mail/aliases
169 if ! grep -q "^myhostname" /etc/mail/main.cf; then
170 postconf -e myhostname=`/bin/hostname -f`
174 /sbin/chkconfig --add postfix
175 if [ -f /var/lock/subsys/postfix ]; then
176 /etc/rc.d/init.d/postfix restart >&2
178 echo "Run \"/etc/rc.d/init.d/postfix start\" to start postfix daemon." >&2
182 if [ "$1" = "0" ]; then
183 if [ -f /var/lock/subsys/postfix ]; then
184 /etc/rc.d/init.d/postfix stop >&2
186 /sbin/chkconfig --del postfix
191 /usr/sbin/groupdel maildrop 2> /dev/null
192 /usr/sbin/userdel postfix 2> /dev/null
193 /usr/sbin/groupdel postfix 2> /dev/null
197 %defattr(644,root,root,755)
199 %doc {HISTORY,COMPATIBILITY,LICENSE,RELEASE_NOTES,RESTRICTION_CLASS,TODO}.gz
201 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/access
202 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/aliases
203 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/canonical
204 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/relocated
205 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/transport
206 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/virtual
207 #%ghost %{_sysconfdir}/mail/*.db
208 %dir %{_sysconfdir}/mail
209 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/main.cf
210 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/master.cf
211 %attr(755,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/postfix-script
212 %attr(740,root,root) /etc/cron.daily/postfix
213 %attr(754,root,root) /etc/rc.d/init.d/postfix
214 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/postfix
215 %{!?_without_sasl:%config(noreplace) %verify(not size mtime md5) /etc/sasl/smtpd.conf}
216 %attr(755,root,root) %{_bindir}/*
217 %attr(755,root,root) %{_sbindir}/s*
218 %attr(755,root,root) %{_sbindir}/post*i*
219 %attr(755,root,root) %{_sbindir}/postl*
220 %attr(755,root,root) %{_sbindir}/postc*
221 %attr(755,root,root) %{_sbindir}/postmap
222 %attr(755,root,root) %{_sbindir}/postsuper
223 %attr(2755,root,maildrop) %{_sbindir}/postdrop
224 %attr(755,root,root) %{_libdir}/sendmail
225 %attr(755,root,root) %{_libdir}/postfix
226 %attr(755,root,root) %dir %{_var}/spool/postfix
227 %attr(700, postfix,root) %dir %{_var}/spool/postfix/active
228 %attr(700, postfix,root) %dir %{_var}/spool/postfix/bounce
229 %attr(700, postfix,root) %dir %{_var}/spool/postfix/corrupt
230 %attr(700, postfix,root) %dir %{_var}/spool/postfix/defer
231 %attr(700, postfix,root) %dir %{_var}/spool/postfix/deferred
232 %attr(700, postfix,root) %dir %{_var}/spool/postfix/incoming
233 %attr(1730,postfix,maildrop) %dir %{_var}/spool/postfix/maildrop
234 %attr(755, postfix,root) %dir %{_var}/spool/postfix/pid
235 %attr(700, postfix,root) %dir %{_var}/spool/postfix/private
236 %attr(755, postfix,root) %dir %{_var}/spool/postfix/public
237 %attr(700, postfix,root) %dir %{_var}/spool/postfix/saved
238 %attr(644, postfix,root) %{_var}/spool/postfix/.nofinger