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