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 URL: http://www.postfix.org/
30 %{!?bcond_off_ldap:BuildRequires: openldap-devel >= 2.0.0}
31 %{!?bcond_off_ssl:BuildRequires: openssl-devel >= 0.9.6-2}
32 %{!?bcond_off_pcre:BuildRequires: pcre-devel}
33 %{!?bcond_off_sasl:BuildRequires: cyrus-sasl-devel}
34 BuildRequires: db3-devel
36 Prereq: /sbin/chkconfig
37 Prereq: /usr/sbin/useradd
38 Prereq: /usr/sbin/groupadd
39 Prereq: /usr/sbin/userdel
40 Prereq: /usr/sbin/groupdel
41 Prereq: /usr/bin/getgid
44 %{!?bcond_off_ldap:Prereq: openldap >= 2.0.0}
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 Obsoletes: sendmail-cf
50 Obsoletes: sendmail-doc
52 %define _sysconfdir /etc
55 Postfix is attempt to provide an alternative to the widely-used
56 Sendmail program. Postfix attempts to be fast, easy to administer, and
57 hopefully secure, while at the same time being sendmail compatible
58 enough to not upset your users. This version have IPv6 support and
59 %{!?bcond_off_ldap:no } LDAP support.
62 Postfix jest prób± dostarczenia alternatywnego MTA w stosunku do
63 szeroko u¿ywanego sendmaila. Postfix w zamierzeniu ma byæ szybki,
64 ³atwy w administrowaniu, bezpieczny oraz ma byæ na tyle kompatybilny z
65 sendmailem by nie denerwowaæ Twoich u¿ytkowników. Ta wersja wspiera
66 IPv6%{!?bcond_off_ldap: oraz LDAP} %{?bcond_off_ldap: i nie zawiera wsparcia LDAP}.
69 %setup -q -n snapshot-%{version}
76 %{__make} -f Makefile.init makefiles
78 %{__make} DEBUG="" OPT="%{?debug:-O0 -g}%{!?debug:$RPM_OPT_FLAGS}" \
79 CCARGS="%{!?bcond_off_ldap:-DHAS_LDAP} %{!?bcond_off_pcre:-DHAS_PCRE} %{!?bcond_off_sasl:-DUSE_SASL_AUTH} %{?bcond_on_mysql:-DHAS_MYSQL -I/usr/include/mysql} %{!?bcond_off_ssl:-DHAS_SSL -I/usr/include/openssl}" \
80 AUXLIBS="%{!?bcond_off_ldap:-llber -lldap} -lnsl -ldb -lresolv %{!?bcond_off_pcre:-lpcre} %{!?bcond_off_sasl:-lsasl} %{?bcond_on_mysql:-lmysqlclient}"
83 rm -rf $RPM_BUILD_ROOT
84 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{mail,cron.daily,rc.d/init.d,sysconfig} \
85 $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}/postfix,%{_mandir}/man{1,5,8}} \
86 $RPM_BUILD_ROOT%{_var}/spool/postfix/{active,corrupt,deferred,maildrop,private,saved,bounce,defer,incoming,pid,public} \
89 rm -f {html,man}/Makefile.in conf/{LICENSE,main.cf.default}
91 install -d sample-conf; mv -f conf/sample* sample-conf/ || :
93 install bin/* $RPM_BUILD_ROOT%{_sbindir}
94 install libexec/* $RPM_BUILD_ROOT%{_libdir}/postfix
95 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail
97 (cd man; tar cf - .) | (cd $RPM_BUILD_ROOT%{_mandir}; tar xf -)
99 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
100 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/postfix
101 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/postfix
102 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/postfix
104 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/mailq
105 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/newaliases
106 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_libdir}/sendmail
108 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script-sgid \
109 $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script
111 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script-{diff,nosgid}
113 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/\
114 {aliases,access,canonical,relocated,transport,virtual}{,.db}
116 gzip -9nf LDAP_README HISTORY MYSQL_README UUCP_README 0README \
117 COMPATIBILITY DEBUG_README LICENSE LMTP_README PCRE_README \
118 RELEASE_NOTES RESTRICTION_CLASS SASL_README TODO FILTER_README \
121 touch $RPM_BUILD_ROOT/var/spool/postfix/.nofinger
124 if [ -n "`/usr/bin/getgid postfix`" ]; then
125 if [ "`getgid postfix`" != "62" ]; then
126 echo "Warning: group postfix haven't gid=62. Corect this before install postfix" 1>&2
130 /usr/sbin/groupadd -g 62 -r -f postfix
132 if [ -n "`/usr/bin/getgid maildrop`" ]; then
133 if [ "`/usr/bin/getgid maildrop`" != "63" ]; then
134 echo "Warning: group maildrop haven't gid=63. Corect this before install postfix" 1>&2
138 /usr/sbin/groupadd -g 63 -r -f maildrop
140 if [ -n "`/bin/id -u postfix 2>/dev/null`" ]; then
141 if [ "`/bin/id -u postfix`" != "62" ]; then
142 echo "Warning: user postfix haven't uid=62. Corect this before install postfix" 1>&2
146 /usr/sbin/useradd -u 62 -r -d /var/spool/postfix -s /bin/false -c "Postfix User" -g postfix postfix 1>&2
150 if ! grep -q "^postmaster:" /etc/mail/aliases; then
151 echo "Adding Entry for postmaster in /etc/mail/aliases" >&2
152 echo "postmaster: root" >>/etc/mail/aliases
154 if ! grep -q "^myhostname" /etc/mail/main.cf; then
155 postconf -e myhostname=`/bin/hostname -f`
159 /sbin/chkconfig --add postfix
160 if [ -f /var/lock/subsys/postfix ]; then
161 /etc/rc.d/init.d/postfix restart >&2
163 echo "Run \"/etc/rc.d/init.d/postfix start\" to start postfix daemon." >&2
167 if [ "$1" = "0" ]; then
168 if [ -f /var/lock/subsys/postfix ]; then
169 /etc/rc.d/init.d/postfix stop >&2
171 /sbin/chkconfig --del postfix
176 /usr/sbin/groupdel maildrop 2> /dev/null
177 /usr/sbin/userdel postfix 2> /dev/null
178 /usr/sbin/groupdel postfix 2> /dev/null
182 rm -rf $RPM_BUILD_ROOT
185 %defattr(644,root,root,755)
186 %doc html {LDAP_README,HISTORY,MYSQL_README,UUCP_README,IPV6_README}.gz
187 %doc {0README,COMPATIBILITY,DEBUG_README,LICENSE,LMTP_README,PCRE_README}.gz
188 %doc {RELEASE_NOTES,RESTRICTION_CLASS,SASL_README,TODO,FILTER_README}.gz
190 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/access
191 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/aliases
192 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/canonical
193 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/relocated
194 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/transport
195 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/virtual
196 #%ghost %{_sysconfdir}/mail/*.db
197 %dir %{_sysconfdir}/mail
198 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/main.cf
199 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/master.cf
200 %attr(755,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/postfix-script
201 %attr(740,root,root) /etc//cron.daily/postfix
202 %attr(754,root,root) /etc/rc.d/init.d/postfix
203 %attr(640,root,root) %config(noreplace) /etc/sysconfig/postfix
204 %attr(755,root,root) %{_bindir}/*
205 %attr(755,root,root) %{_sbindir}/s*
206 %attr(755,root,root) %{_sbindir}/post*i*
207 %attr(755,root,root) %{_sbindir}/postl*
208 %attr(755,root,root) %{_sbindir}/postc*
209 %attr(755,root,root) %{_sbindir}/postmap
210 %attr(755,root,root) %{_sbindir}/postsuper
211 %attr(2755,root,maildrop) %{_sbindir}/postdrop
212 %attr(755,root,root) %{_libdir}/sendmail
213 %attr(755,root,root) %{_libdir}/postfix
214 %attr(755,root,root) %dir %{_var}/spool/postfix
215 %attr(700, postfix,root) %dir %{_var}/spool/postfix/active
216 %attr(700, postfix,root) %dir %{_var}/spool/postfix/bounce
217 %attr(700, postfix,root) %dir %{_var}/spool/postfix/corrupt
218 %attr(700, postfix,root) %dir %{_var}/spool/postfix/defer
219 %attr(700, postfix,root) %dir %{_var}/spool/postfix/deferred
220 %attr(700, postfix,root) %dir %{_var}/spool/postfix/incoming
221 %attr(1730,postfix,maildrop) %dir %{_var}/spool/postfix/maildrop
222 %attr(755, postfix,root) %dir %{_var}/spool/postfix/pid
223 %attr(700, postfix,root) %dir %{_var}/spool/postfix/private
224 %attr(755, postfix,root) %dir %{_var}/spool/postfix/public
225 %attr(700, postfix,root) %dir %{_var}/spool/postfix/saved
226 %attr(644, postfix,root) %{_var}/spool/postfix/.nofinger