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