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