]> git.pld-linux.org Git - packages/postfix.git/blob - postfix.spec
- ipv6 patch: fixes in mynetworks detection and relay checking based on
[packages/postfix.git] / postfix.spec
1 #
2 # Conditional build:    
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
9 #
10 %define tls_ver 0.7.13c-snap20011127-0.9.6b
11 Summary:        Postfix Mail Transport Agent
12 Summary(pl):    Serwer SMTP Postfix
13 Name:           postfix
14 Version:        20011127
15 Release:        5
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
22 Source2:        %{name}.cron
23 Source3:        %{name}.init
24 Source5:        %{name}.sysconfig
25 Source6:        ftp://ftp.aet.tu-cottbus.de/pub/pfixtls/pfixtls-%{tls_ver}.tar.gz
26 Source7:        %{name}.sasl
27 Patch0:         %{name}-config.patch
28 Patch1:         %{name}-pl.patch
29 Patch2:         %{name}-conf_msg.patch
30 Patch3:         %{name}-ipv6.patch
31 URL:            http://www.postfix.org/
32 Provides:       smtpdaemon
33 Prereq:         rc-scripts
34 %{!?_without_ldap:BuildRequires:        openldap-devel >= 2.0.0}
35 %{!?_without_ssl:BuildRequires: openssl-devel >= 0.9.6a}
36 %{!?_without_pcre:BuildRequires:        pcre-devel}
37 %{!?_without_sasl:BuildRequires:        cyrus-sasl-devel}
38 %{!?_without_ipv6:BuildRequires:        libinet6 >= 0.20010420-3}
39 BuildRequires:  db3-devel
40 BuildRequires:  grep
41 BuildRequires:  awk
42 Prereq:         /sbin/chkconfig
43 Prereq:         /usr/sbin/useradd
44 Prereq:         /usr/sbin/groupadd
45 Prereq:         /usr/sbin/userdel
46 Prereq:         /usr/sbin/groupdel
47 Prereq:         /usr/bin/getgid
48 Prereq:         /bin/id
49 Prereq:         /bin/hostname
50 %{!?_without_ldap:Prereq:       openldap >= 2.0.0}
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 Obsoletes:      smtpdaemon
53 Obsoletes:      exim
54 Obsoletes:      masqmail
55 Obsoletes:      omta
56 Obsoletes:      qmail
57 Obsoletes:      sendmail
58 Obsoletes:      sendmail-cf
59 Obsoletes:      sendmail-doc
60 Obsoletes:      smail
61 Obsoletes:      zmailer
62 Requires:       procmail
63
64 %description
65 Postfix is attempt to provide an alternative to the widely-used
66 Sendmail program. Postfix attempts to be fast, easy to administer, and
67 hopefully secure, while at the same time being sendmail compatible
68 enough to not upset your users. This version have IPv6 support and
69 %{!?_without_ldap:no }LDAP support.
70
71 %description -l pl
72 Postfix jest prób± dostarczenia alternatywnego MTA w stosunku do
73 szeroko u¿ywanego sendmaila. Postfix w zamierzeniu ma byæ szybki,
74 ³atwy w administrowaniu, bezpieczny oraz ma byæ na tyle kompatybilny z
75 sendmailem by nie denerwowaæ Twoich u¿ytkowników. Ta wersja wspiera
76 IPv6%{!?_without_ldap: oraz LDAP}.
77
78 %prep
79 %setup -q -n snapshot-%{version} -a 6 
80 %patch0 -p1
81 %patch1 -p1
82 patch -p1 -s <pfixtls-%{tls_ver}/pfixtls.diff 
83 %patch2 -p1
84 %{!?_without_ipv6:%patch3 -p1 }
85
86 %build
87 %{__make} -f Makefile.init makefiles
88 %{__make} tidy
89 %{__make} DEBUG="" OPT="%{rpmcflags}" \
90         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}" \
91         AUXLIBS="%{!?_without_ldap:-llber -lldap} -lnsl -ldb -lresolv %{!?_without_pcre:-lpcre} %{!?_without_sasl:-lsasl} %{?_with_mysql:-lmysqlclient} %{!?_without_ssl:-lssl -lcrypto}"
92
93 %install
94 rm -rf $RPM_BUILD_ROOT
95 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{mail,cron.daily,rc.d/init.d,sasl,sysconfig} \
96            $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}/postfix,%{_mandir}/man{1,5,8}} \
97            $RPM_BUILD_ROOT%{_var}/spool/postfix/{active,corrupt,deferred,maildrop,private,saved,bounce,defer,incoming,pid,public} \
98            pfixtls
99
100 rm -f {html,man}/Makefile.in conf/{LICENSE,main.cf.default}
101
102 install -d sample-conf; mv -f conf/sample* sample-conf/ || :
103
104 install bin/* $RPM_BUILD_ROOT%{_sbindir}
105 install libexec/* $RPM_BUILD_ROOT%{_libdir}/postfix
106 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail
107
108 (cd man; tar cf - .) | (cd $RPM_BUILD_ROOT%{_mandir}; tar xf -)
109
110 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
111 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/postfix
112 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/postfix
113 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/postfix
114 install %{SOURCE7} $RPM_BUILD_ROOT/etc/sasl/smtpd.conf
115 install auxiliary/rmail/rmail $RPM_BUILD_ROOT%{_bindir}/rmail
116
117 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/mailq
118 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_bindir}/newaliases
119 ln -sf ../sbin/sendmail $RPM_BUILD_ROOT%{_libdir}/sendmail
120
121 mv -f  $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script-sgid \
122         $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script
123
124 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script-{diff,nosgid}
125
126 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/\
127         {aliases,access,canonical,relocated,transport,virtual}{,.db}
128
129 gzip -9nf *README HISTORY COMPATIBILITY LICENSE RELEASE_NOTES \
130            RESTRICTION_CLASS TODO
131
132 touch $RPM_BUILD_ROOT/var/spool/postfix/.nofinger
133
134 %clean
135 rm -rf $RPM_BUILD_ROOT
136
137 %pre
138 if [ -n "`/usr/bin/getgid postfix`" ]; then
139         if [ "`getgid postfix`" != "62" ]; then
140                 echo "Warning: group postfix haven't gid=62. Correct this before installing postfix" 1>&2
141                 exit 1
142         fi
143 else
144         /usr/sbin/groupadd -g 62 -r -f postfix
145 fi
146 if [ -n "`/usr/bin/getgid maildrop`" ]; then
147         if [ "`/usr/bin/getgid maildrop`" != "63" ]; then
148                 echo "Warning: group maildrop haven't gid=63. Correct this before installing postfix" 1>&2
149                 exit 1
150         fi
151 else
152         /usr/sbin/groupadd -g 63 -r -f maildrop
153 fi
154 if [ -n "`/bin/id -u postfix 2>/dev/null`" ]; then
155         if [ "`/bin/id -u postfix`" != "62" ]; then
156                 echo "Warning: user postfix haven't uid=62. Correct this before installing postfix" 1>&2
157                 exit 1
158         fi
159 else
160         /usr/sbin/useradd -u 62 -r -d /var/spool/postfix -s /bin/false -c "Postfix User" -g postfix postfix 1>&2
161 fi
162
163 %post
164 if ! grep -q "^postmaster:" /etc/mail/aliases; then
165         echo "Adding Entry for postmaster in /etc/mail/aliases" >&2
166         echo "postmaster:       root" >>/etc/mail/aliases
167 fi
168 if ! grep -q "^myhostname" /etc/mail/main.cf; then
169         postconf -e myhostname=`/bin/hostname -f`
170 fi
171
172 newaliases
173 /sbin/chkconfig --add postfix
174 if [ -f /var/lock/subsys/postfix ]; then
175         /etc/rc.d/init.d/postfix restart >&2
176 else
177         echo "Run \"/etc/rc.d/init.d/postfix start\" to start postfix daemon." >&2
178 fi
179
180 %preun
181 if [ "$1" = "0" ]; then
182         if [ -f /var/lock/subsys/postfix ]; then
183                 /etc/rc.d/init.d/postfix stop >&2
184         fi
185         /sbin/chkconfig --del postfix
186 fi
187
188 %postun
189 if [ $1 = 0 ]; then
190         /usr/sbin/groupdel maildrop 2> /dev/null
191         /usr/sbin/userdel postfix 2> /dev/null
192         /usr/sbin/groupdel postfix 2> /dev/null
193 fi
194
195 %files
196 %defattr(644,root,root,755)
197 %doc html *README.gz
198 %doc {HISTORY,COMPATIBILITY,LICENSE,RELEASE_NOTES,RESTRICTION_CLASS,TODO}.gz
199 %doc sample-conf
200 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/access
201 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/aliases
202 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/canonical
203 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/relocated
204 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/transport
205 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/virtual
206 #%ghost %{_sysconfdir}/mail/*.db
207 %dir %{_sysconfdir}/mail
208 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/main.cf
209 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/master.cf
210 %attr(755,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/postfix-script
211 %attr(740,root,root) /etc/cron.daily/postfix
212 %attr(754,root,root) /etc/rc.d/init.d/postfix
213 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/postfix
214 %{!?_without_sasl:%config(noreplace) %verify(not size mtime md5) /etc/sasl/smtpd.conf}
215 %attr(755,root,root) %{_bindir}/*
216 %attr(755,root,root) %{_sbindir}/s*
217 %attr(2755,root,mail) %{_sbindir}/postfix
218 %attr(755,root,root) %{_sbindir}/postalias
219 %attr(755,root,root) %{_sbindir}/postkick
220 %attr(755,root,root) %{_sbindir}/postl*
221 %attr(755,root,root) %{_sbindir}/postc*
222 %attr(755,root,root) %{_sbindir}/postmap
223 %attr(755,root,root) %{_sbindir}/postsuper
224 %attr(2755,root,maildrop) %{_sbindir}/postdrop
225 %attr(755,root,root) %{_libdir}/sendmail
226 %attr(755,root,root) %{_libdir}/postfix
227 %attr(755,root,root) %dir %{_var}/spool/postfix
228 %attr(700, postfix,root) %dir %{_var}/spool/postfix/active
229 %attr(700, postfix,root) %dir %{_var}/spool/postfix/bounce
230 %attr(700, postfix,root) %dir %{_var}/spool/postfix/corrupt
231 %attr(700, postfix,root) %dir %{_var}/spool/postfix/defer
232 %attr(700, postfix,root) %dir %{_var}/spool/postfix/deferred
233 %attr(700, postfix,root) %dir %{_var}/spool/postfix/incoming
234 %attr(1730,postfix,maildrop) %dir %{_var}/spool/postfix/maildrop
235 %attr(755, postfix,root) %dir %{_var}/spool/postfix/pid
236 %attr(700, postfix,root) %dir %{_var}/spool/postfix/private
237 %attr(755, postfix,root) %dir %{_var}/spool/postfix/public
238 %attr(700, postfix,root) %dir %{_var}/spool/postfix/saved
239 %attr(644, postfix,root) %{_var}/spool/postfix/.nofinger
240 %{_mandir}/man*/*
This page took 0.106521 seconds and 4 git commands to generate.