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
9 Summary: Postfix Mail Transport Agent
10 Summary(pl): Serwer SMTP Postfix
14 Group: Networking/Daemons
15 Group(de): Netzwerkwesen/Server
16 Group(pl): Sieciowe/Serwery
17 Copyright: Distributable
18 Source0: ftp://ftp.porcupine.org/mirrors/postfix-release/experimental/snapshot-%{version}.tar.gz
19 Source1: %{name}.aliases
22 Source5: %{name}.sysconfig
23 Patch0: %{name}-config.patch
24 Patch1: %{name}-pl.patch
25 Patch2: %{name}-ssl.patch
26 Patch3: %{name}-ipv6.patch.gz
27 Patch4: %{name}-script.patch
28 Patch5: %{name}-conf_msg.patch
29 URL: http://www.postfix.org/
32 %{!?bcond_off_ldap:BuildRequires: openldap-devel >= 2.0.0}
33 %{!?bcond_off_ssl:BuildRequires: openssl-devel >= 0.9.6-2}
34 %{!?bcond_off_pcre:BuildRequires: pcre-devel}
35 %{!?bcond_off_sasl:BuildRequires: cyrus-sasl-devel}
36 BuildRequires: db3-devel
38 BuildRequires: libinet6
39 Prereq: /sbin/chkconfig
40 Prereq: /usr/sbin/useradd
41 Prereq: /usr/sbin/groupadd
42 Prereq: /usr/sbin/userdel
43 Prereq: /usr/sbin/groupdel
44 Prereq: /usr/bin/getgid
47 %{!?bcond_off_ldap:Prereq: openldap >= 2.0.0}
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 Obsoletes: sendmail-cf
53 Obsoletes: sendmail-doc
55 %define _sysconfdir /etc
58 Postfix is attempt to provide an alternative to the widely-used
59 Sendmail program. Postfix attempts to be fast, easy to administer, and
60 hopefully secure, while at the same time being sendmail compatible
61 enough to not upset your users. This version have IPv6 support and
62 %{!?bcond_off_ldap:no } LDAP support.
65 Postfix jest prób± dostarczenia alternatywnego MTA w stosunku do
66 szeroko u¿ywanego sendmaila. Postfix w zamierzeniu ma byæ szybki,
67 ³atwy w administrowaniu, bezpieczny oraz ma byæ na tyle kompatybilny z
68 sendmailem by nie denerwowaæ Twoich u¿ytkowników. Ta wersja wspiera
69 IPv6%{!?bcond_off_ldap: oraz LDAP}.
72 %setup -q -n snapshot-%{version}
81 %{__make} -f Makefile.init makefiles
83 %{__make} DEBUG="" OPT="%{?debug:-O0 -g}%{!?debug:$RPM_OPT_FLAGS}" \
84 CCARGS="%{!?bcond_off_ldap:-DHAS_LDAP} %{!?bcond_off_pcre:-DHAS_PCRE} %{!?bcond_off_sasl:-DUSE_SASL_AUTH} %{?bcond_on_mysql:-DHAS_MYSQL -I%{_includedir}/mysql} %{!?bcond_off_ssl:-DHAS_SSL -I%{_includedir}/openssl}" \
85 AUXLIBS="%{!?bcond_off_ldap:-llber -lldap} -lnsl -ldb -lresolv %{!?bcond_off_pcre:-lpcre} %{!?bcond_off_sasl:-lsasl} %{?bcond_on_mysql:-lmysqlclient} %{!?bcond_off_ssl:-lssl -lcrypto}"
88 rm -rf $RPM_BUILD_ROOT
89 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{mail,cron.daily,rc.d/init.d,sysconfig} \
90 $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}/postfix,%{_mandir}/man{1,5,8}} \
91 $RPM_BUILD_ROOT%{_var}/spool/postfix/{active,corrupt,deferred,maildrop,private,saved,bounce,defer,incoming,pid,public} \
94 rm -f {html,man}/Makefile.in conf/{LICENSE,main.cf.default}
96 install -d sample-conf; mv -f conf/sample* sample-conf/ || :
98 install bin/* $RPM_BUILD_ROOT%{_sbindir}
99 install libexec/* $RPM_BUILD_ROOT%{_libdir}/postfix
100 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail
102 (cd man; tar cf - .) | (cd $RPM_BUILD_ROOT%{_mandir}; tar xf -)
104 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
105 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/postfix
106 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/postfix
107 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/postfix
109 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/mailq
110 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/newaliases
111 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_libdir}/sendmail
113 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script-sgid \
114 $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script
116 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script-{diff,nosgid}
118 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/\
119 {aliases,access,canonical,relocated,transport,virtual}{,.db}
121 gzip -9nf LDAP_README HISTORY MYSQL_README UUCP_README 0README \
122 COMPATIBILITY DEBUG_README LICENSE LMTP_README PCRE_README \
123 RELEASE_NOTES RESTRICTION_CLASS SASL_README TODO FILTER_README \
126 touch $RPM_BUILD_ROOT/var/spool/postfix/.nofinger
129 if [ -n "`/usr/bin/getgid postfix`" ]; then
130 if [ "`getgid postfix`" != "62" ]; then
131 echo "Warning: group postfix haven't gid=62. Corect this before install postfix" 1>&2
135 /usr/sbin/groupadd -g 62 -r -f postfix
137 if [ -n "`/usr/bin/getgid maildrop`" ]; then
138 if [ "`/usr/bin/getgid maildrop`" != "63" ]; then
139 echo "Warning: group maildrop haven't gid=63. Corect this before install postfix" 1>&2
143 /usr/sbin/groupadd -g 63 -r -f maildrop
145 if [ -n "`/bin/id -u postfix 2>/dev/null`" ]; then
146 if [ "`/bin/id -u postfix`" != "62" ]; then
147 echo "Warning: user postfix haven't uid=62. Corect this before install postfix" 1>&2
151 /usr/sbin/useradd -u 62 -r -d /var/spool/postfix -s /bin/false -c "Postfix User" -g postfix postfix 1>&2
155 if ! grep -q "^postmaster:" /etc/mail/aliases; then
156 echo "Adding Entry for postmaster in /etc/mail/aliases" >&2
157 echo "postmaster: root" >>/etc/mail/aliases
159 if ! grep -q "^myhostname" /etc/mail/main.cf; then
160 postconf -e myhostname=`/bin/hostname -f`
164 /sbin/chkconfig --add postfix
165 if [ -f /var/lock/subsys/postfix ]; then
166 /etc/rc.d/init.d/postfix restart >&2
168 echo "Run \"/etc/rc.d/init.d/postfix start\" to start postfix daemon." >&2
172 if [ "$1" = "0" ]; then
173 if [ -f /var/lock/subsys/postfix ]; then
174 /etc/rc.d/init.d/postfix stop >&2
176 /sbin/chkconfig --del postfix
181 /usr/sbin/groupdel maildrop 2> /dev/null
182 /usr/sbin/userdel postfix 2> /dev/null
183 /usr/sbin/groupdel postfix 2> /dev/null
187 rm -rf $RPM_BUILD_ROOT
190 %defattr(644,root,root,755)
191 %doc html {LDAP_README,HISTORY,MYSQL_README,UUCP_README,IPV6_README}.gz
192 %doc {0README,COMPATIBILITY,DEBUG_README,LICENSE,LMTP_README,PCRE_README}.gz
193 %doc {RELEASE_NOTES,RESTRICTION_CLASS,SASL_README,TODO,FILTER_README}.gz
195 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/access
196 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/aliases
197 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/canonical
198 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/relocated
199 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/transport
200 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/virtual
201 #%ghost %{_sysconfdir}/mail/*.db
202 %dir %{_sysconfdir}/mail
203 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/main.cf
204 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/master.cf
205 %attr(755,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/postfix-script
206 %attr(740,root,root) /etc//cron.daily/postfix
207 %attr(754,root,root) /etc/rc.d/init.d/postfix
208 %attr(640,root,root) %config(noreplace) /etc/sysconfig/postfix
209 %attr(755,root,root) %{_bindir}/*
210 %attr(755,root,root) %{_sbindir}/s*
211 %attr(755,root,root) %{_sbindir}/post*i*
212 %attr(755,root,root) %{_sbindir}/postl*
213 %attr(755,root,root) %{_sbindir}/postc*
214 %attr(755,root,root) %{_sbindir}/postmap
215 %attr(755,root,root) %{_sbindir}/postsuper
216 %attr(2755,root,maildrop) %{_sbindir}/postdrop
217 %attr(755,root,root) %{_libdir}/sendmail
218 %attr(755,root,root) %{_libdir}/postfix
219 %attr(755,root,root) %dir %{_var}/spool/postfix
220 %attr(700, postfix,root) %dir %{_var}/spool/postfix/active
221 %attr(700, postfix,root) %dir %{_var}/spool/postfix/bounce
222 %attr(700, postfix,root) %dir %{_var}/spool/postfix/corrupt
223 %attr(700, postfix,root) %dir %{_var}/spool/postfix/defer
224 %attr(700, postfix,root) %dir %{_var}/spool/postfix/deferred
225 %attr(700, postfix,root) %dir %{_var}/spool/postfix/incoming
226 %attr(1730,postfix,maildrop) %dir %{_var}/spool/postfix/maildrop
227 %attr(755, postfix,root) %dir %{_var}/spool/postfix/pid
228 %attr(700, postfix,root) %dir %{_var}/spool/postfix/private
229 %attr(755, postfix,root) %dir %{_var}/spool/postfix/public
230 %attr(700, postfix,root) %dir %{_var}/spool/postfix/saved
231 %attr(644, postfix,root) %{_var}/spool/postfix/.nofinger