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