]> git.pld-linux.org Git - packages/postfix.git/blob - postfix.spec
- (proper) release 1
[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 #
9 Summary:        Postfix Mail Transport Agent
10 Summary(pl):    Serwer SMTP Postfix
11 Name:           postfix
12 Version:        20010228
13 Release:        1
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
20 Source2:        %{name}.cron
21 Source3:        %{name}.init
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/
28 Provides:       smtpdaemon
29 Prereq:         rc-scripts
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
35 BuildRequires:  grep
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
42 Prereq:         /bin/id
43 Prereq:         /bin/hostname
44 %{!?bcond_off_ldap:Prereq:      openldap >= 2.0.0}
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 Obsoletes:      smtpdaemon
47 Obsoletes:      exim
48 Obsoletes:      sendmail
49 Obsoletes:      sendmail-cf
50 Obsoletes:      sendmail-doc
51
52 %define         _sysconfdir     /etc
53
54 %description
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.
60
61 %description -l pl
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}.
67
68 %prep
69 %setup -q -n snapshot-%{version}
70 %patch0 -p1
71 %patch1 -p1
72 %patch2 -p1
73 %patch3 -p1
74
75 %build
76 %{__make} -f Makefile.init makefiles
77 %{__make} tidy
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}"
81
82 %install
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} \
87            pfixtls
88
89 rm -f {html,man}/Makefile.in conf/{LICENSE,main.cf.default}
90
91 install -d sample-conf; mv -f conf/sample* sample-conf/ || :
92
93 install bin/* $RPM_BUILD_ROOT%{_sbindir}
94 install libexec/* $RPM_BUILD_ROOT%{_libdir}/postfix
95 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail
96
97 (cd man; tar cf - .) | (cd $RPM_BUILD_ROOT%{_mandir}; tar xf -)
98
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
103
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
107
108 mv -f  $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script-sgid \
109         $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script
110
111 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/mail/postfix-script-{diff,nosgid}
112
113 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/\
114         {aliases,access,canonical,relocated,transport,virtual}{,.db}
115
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 \
119         IPV6_README
120
121 touch $RPM_BUILD_ROOT/var/spool/postfix/.nofinger
122
123 %pre
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
127                 exit 1
128         fi
129 else
130         /usr/sbin/groupadd -g 62 -r -f postfix
131 fi
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
135                 exit 1
136         fi
137 else
138         /usr/sbin/groupadd -g 63 -r -f maildrop
139 fi
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
143                 exit 1
144         fi
145 else
146         /usr/sbin/useradd -u 62 -r -d /var/spool/postfix -s /bin/false -c "Postfix User" -g postfix postfix 1>&2
147 fi
148
149 %post
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
153 fi
154 if ! grep -q "^myhostname" /etc/mail/main.cf; then
155         postconf -e myhostname=`/bin/hostname -f`
156 fi
157
158 newaliases
159 /sbin/chkconfig --add postfix
160 if [ -f /var/lock/subsys/postfix ]; then
161         /etc/rc.d/init.d/postfix restart >&2
162 else
163         echo "Run \"/etc/rc.d/init.d/postfix start\" to start postfix daemon." >&2
164 fi
165
166 %preun
167 if [ "$1" = "0" ]; then
168         if [ -f /var/lock/subsys/postfix ]; then
169                 /etc/rc.d/init.d/postfix stop >&2
170         fi
171         /sbin/chkconfig --del postfix
172 fi
173
174 %postun
175 if [ $1 = 0 ]; then
176         /usr/sbin/groupdel maildrop 2> /dev/null
177         /usr/sbin/userdel postfix 2> /dev/null
178         /usr/sbin/groupdel postfix 2> /dev/null
179 fi
180
181 %clean
182 rm -rf $RPM_BUILD_ROOT
183
184 %files
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
189 %doc sample-conf
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
227 %{_mandir}/man*/*
This page took 0.093438 seconds and 3 git commands to generate.