]> git.pld-linux.org Git - packages/exim.git/blob - exim.spec
- release 4.
[packages/exim.git] / exim.spec
1 # Conditional build:
2 # bcond_off_pgsql - build wihtout PostgreSQ support
3 # bcond_on_mysql - build with MySQL support
4 # bcond_off_ldap - build without LDAP support
5
6 Summary:        University of Cambridge Mail Transfer Agent 
7 Summary(pl):    Agent Transferu Poczty Uniwersytetu w Cambridge
8 Name:           exim
9 Version:        3.20
10 Release:        4
11 License:        GPL
12 Group:          Networking/Daemons
13 Group(de):      Netzwerkwesen/Server
14 Group(pl):      Sieciowe/Serwery
15 Source0:        ftp://ftp.cus.cam.ac.uk/pub/software/programs/exim/%{name}-%{version}.tar.gz
16 Source1:        ftp://ftp.cus.cam.ac.uk/pub/software/programs/exim/%{name}-texinfo-3.10.tar.gz
17 Source2:        %{name}.init
18 Source3:        %{name}.cron.db
19 Source4:        %{name}.8
20 Source5:        analyse-log-errors
21 Source6:        %{name}on.desktop
22 Source8:        Makefile-Linux
23 Source9:        %{name}.aliases
24 Source10:       %{name}.conf
25 Source11:       newaliases
26 Source12:       %{name}.logrotate
27 Source13:       %{name}.sysconfig
28 #Source14:      ftp://ftp.cus.cam.ac.uk/pub/software/programs/exim/FAQ.txt.gz
29 Source14:       %{name}-FAQ.txt.gz
30 #Source15:      ftp://ftp.cus.cam.ac.uk/pub/software/programs/exim/config.samples.tar.gz
31 Source15:       %{name}-config.samples.tar.gz
32 Patch0:         %{name}-EDITME.patch
33 Patch1:         %{name}-monitor-EDITME.patch
34 Patch2:         %{name}-texinfo.patch
35 Patch3:         %{name}-use_system_pcre.patch
36 Patch4:         %{name}-Makefile-Default.patch
37 URL:            http://www.exim.org/
38 %{!?bcond_off_ldap:BuildRequires: openldap-devel >= 2.0.0}
39 %{?bcond_on_mysql:BuildRequires: mysql-devel}
40 %{!?bcond_off_pgsql:BuildRequires: postgresql-devel}
41 BuildRequires:  texinfo
42 BuildRequires:  perl
43 BuildRequires:  pam-devel
44 BuildRequires:  pcre-devel
45 BuildRequires:  db3-devel
46 BuildRequires:  openssl-devel
47 Provides:       smtpdaemon
48 Prereq:         /usr/sbin/useradd
49 Prereq:         /usr/sbin/groupadd
50 Prereq:         /bin/awk
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 Obsoletes:      smtpdaemon
53 Obsoletes:      sendmail
54 Obsoletes:      sendmail-cf
55 Obsoletes:      sendmail-doc
56 Obsoletes:      postfix
57 Obsoletes:      zmailer
58 Obsoletes:      smail
59 Obsoletes:      qmail
60 Obsoletes:      qmail-client
61
62 %description
63 Smail like Mail Transfer Agent with single configuration file.
64 Features: flexible retry algorithms, header & envelope rewriting,
65 multiple deliveries down single connection or multiple deliveries in
66 parallel, regular expressions in configuration parameters, file
67 lookups, supports sender and/or reciever verification, selective
68 relaying, supports virtual domains, built-in mail filtering and can be
69 configured to drop root privilleges when possible.
70
71 %description -l pl
72 Agent transferu poczty (MTA) z pojedynczym plikiem konfiguracyjnym.
73 Jego zalety: ¶wietne algorytmy, mo¿liwo¶æ przepisywania nag³ówków &
74 koperty, wielokrotne dostarczanie poczty podczas jednego po³±czenia
75 lub równoleg³e dostarczanie poczty, wyra¿enia regularne w parametrach
76 konfiguracyjnych, weryfikacja nadawcy i/lub odbiorcy, selektywne
77 relayowanie, wsparcie dla wirtualnych domen, wbudowany system filtrów,
78 mo¿liwo¶æ odrzucania praw roota kiedy jest to mo¿liwe.
79
80 %package X11
81 Summary:        X Window based Exim administration tool
82 Summary(pl):    Narzêdzia administracyjne exima dla X Window
83 Group:          X11/Applications
84 Group(de):      X11/Applikationen
85 Group(pl):      X11/Aplikacje
86 Requires:       applnk
87
88 %description X11
89 X Window based monitor & administration utility for the Exim Mail
90 Transfer Agent.
91
92 %description -l pl X11
93 Bazuj±ce na X Window narzêdzia dla Exima - monitor i program
94 administracyjny.
95
96 %prep
97
98 %setup -q -T -b 0
99 %setup -q -T -D -a 1
100 %patch0 -p1
101 %patch1 -p1
102 %patch2 -p0
103 %patch3 -p1
104 %patch4 -p1
105
106 install %{SOURCE14} doc/FAQ.txt.gz
107 install %{SOURCE15} doc/config.samples.tar.gz
108
109 install -d Local
110 cp src/EDITME Local/Makefile
111 cp exim_monitor/EDITME Local/eximon.conf
112
113 %build
114 %{__make} CFLAGS="%{?debug:-O -g}%{!?debug:$RPM_OPT_FLAGS}" \
115         %{?bcond_on_mysql:LOOKUP_MYSQL=yes} \
116         %{!?bcond_off_pgsql:LOOKUP_PGSQL=yes} \
117         %{!?bcond_off_ldap:LOOKUP_LDAP=yes LDAP_LIB_TYPE=OPENLDAP2} \
118         LOOKUP_LIBS="%{!?bcond_off_ldap:-lldap -llber} %{?bcond_on_mysql:-lmysqlclient} %{!?bcond_off_pgsql:-lpq}" \
119         LOOKUP_INCLUDE="%{!?bcond_off_mysql:-I/usr/include/mysql} %{!?bcond_off_pgsql:-I/usr/include/pgsql}"
120
121 makeinfo exim-texinfo-*/doc/{oview,spec,filter}.texinfo
122
123 %install
124 rm -rf $RPM_BUILD_ROOT
125 install -d $RPM_BUILD_ROOT/etc/{cron.{daily,weekly},logrotate.d,rc.d/init.d,sysconfig,mail} \
126         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man8,%{_libdir}} \
127         $RPM_BUILD_ROOT%{_var}/{spool/exim/{db,input,msglog},log/{archiv,}/exim,mail} \
128         $RPM_BUILD_ROOT{%{_infodir},/usr/X11R6/bin,%{_applnkdir}/System}
129
130 install build-Linux-pld/exim{,_fixdb,_tidydb,_dbmbuild,on.bin,_dumpdb,_lock} \
131         build-Linux-pld/exinext \
132         build-Linux-pld/exi{cyclog,next,what} %{SOURCE11} \
133         util/{exigrep,eximstats,exiqsumm,exiqsumm,unknownuser.sh,unknownuser.sh,transport-filter.pl} \
134         $RPM_BUILD_ROOT%{_bindir}
135 install build-Linux-pld/eximon.bin $RPM_BUILD_ROOT/usr/X11R6/bin
136 install build-Linux-pld/eximon $RPM_BUILD_ROOT/usr/X11R6/bin
137
138 install %{SOURCE5} .
139 install %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.daily/
140 install %{SOURCE13} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
141 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
142 install %{SOURCE12} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
143 install %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/mail/
144 install %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man8/
145 install %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases
146 install *.info* $RPM_BUILD_ROOT%{_infodir}/
147
148 ln -s %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/sendmail
149 ln -s %{_bindir}/exim $RPM_BUILD_ROOT%{_libdir}/sendmail
150 ln -s %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/mailq
151 ln -s %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/rsmtp
152 ln -s %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/rmail
153 ln -s %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/runq
154
155 install %{SOURCE6} $RPM_BUILD_ROOT%{_applnkdir}/System
156
157 touch $RPM_BUILD_ROOT%{_var}/log/exim/{main,reject,panic,process}.log
158
159 gzip -9nf README* NOTICE LICENCE analyse-log-errors \
160         doc/{ChangeLog,NewStuff,dbm.discuss.txt,filter.txt,oview.txt,spec.txt}
161
162 %pre
163 if [ -n "`/usr/bin/getgid exim`" ]; then
164         if [ "`getgid exim`" != "79" ]; then
165                 echo "Warning: group exim haven't gid=79. Corect this before install exim" 1>&2
166                 exit 1
167         fi
168 else
169         /usr/sbin/groupadd -g 79 -r -f exim
170 fi
171
172 if [ -n "`/bin/id/id -u exim 2>/dev/null`" ]; then
173         if [ "`id -u exim`" != "79" ]; then
174                 echo "Warning: user exim doesn't have uid=79. Corect this before installing Exim" 1>&2
175                 exit 1
176         fi
177 else
178         /usr/sbin/useradd -u 79 -r -d /var/spool/exim -s /bin/false -c "Exim pseudo user" -g exim exim 1>&2
179 fi
180
181 %post
182 umask 022
183 /sbin/chkconfig --add %{name}
184 if [ -f /var/lock/subsys/exim ]; then
185         /etc/rc.d/init.d/%{name} restart >&2
186 else
187         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start exim daemon."
188 fi
189
190 if [ ! -f /etc/mail/mailname ]; then
191         rm -f /etc/mail/mailname && hostname -f > /etc/mail/mailname
192         chmod 644 /etc/mail/mailname
193 fi
194 newaliases
195 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
196
197 # Add/modify MAIL variable via pam_env.
198 mv -f %{_sysconfdir}/security/pam_env.conf{,.tmp}
199 awk '$1 != "MAIL" { print $0; }; END { print "MAIL\t\tDEFAULT=${HOME}/Mail/Mailbox"; }' \
200         < %{_sysconfdir}/security/pam_env.conf.tmp \
201         > %{_sysconfdir}/security/pam_env.conf
202 rm -f %{_sysconfdir}/security/pam_env.conf.tmp
203
204 %preun
205 if [ "$1" = "0" ]; then
206         if [ -f /var/lock/subsys/exim ]; then
207                 /etc/rc.d/init.d/exim stop >&2
208         fi
209         /sbin/chkconfig --del %{name}
210 fi
211
212 %postun
213 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
214 if [ "$1" = "0" ]; then
215         /usr/sbin/userdel exim
216         /usr/sbin/groupdel exim
217         
218         mv -f %{_sysconfdir}/security/pam_env.conf{,.tmp}
219         awk '$1 != "MAIL" { print $0; }' \
220                 < %{_sysconfdir}/security/pam_env.conf.tmp \
221                 > %{_sysconfdir}/security/pam_env.conf
222         rm -f %{_sysconfdir}/security/pam_env.conf.tmp
223 fi
224
225 %clean
226 rm -rf $RPM_BUILD_ROOT
227
228 %files
229 %defattr(644,root,root,755)
230 %doc *.gz doc/*.gz
231 %attr( 644,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/exim.conf
232 %attr( 644,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/aliases
233 %attr( 644,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/exim
234 %attr( 644,root,root) /etc/logrotate.d/exim
235 %attr( 754,root,root) /etc/rc.d/init.d/exim
236 %attr(4755,root,root) %{_bindir}/exim
237 %attr( 775,root,mail) %dir %{_var}/mail
238 %attr( 770,root,exim) %dir %{_var}/spool/exim
239 %attr( 750,exim,exim) %dir %{_var}/spool/exim/db
240 %attr( 700,exim,root) %dir %{_var}/spool/exim/input
241 %attr( 750,exim,root) %dir %{_var}/spool/exim/msglog
242 %attr( 755,root,root) %{_bindir}/exim_*
243 %attr( 755,root,root) %{_bindir}/exinext
244 %attr( 755,root,root) %{_bindir}/exiwhat
245 %attr( 755,root,root) %{_bindir}/exicyclog
246 %attr( 755,root,root) %{_bindir}/exigrep
247 %attr( 755,root,root) %{_bindir}/eximstats
248 %attr( 755,root,root) %{_bindir}/exiqsumm
249 %attr( 755,root,root) %{_bindir}/unknownuser.sh
250 %attr( 755,root,root) %{_bindir}/transport-filter.pl
251 %attr( 755,root,root) %{_bindir}/newaliases
252 %attr( 755,root,root) %{_sbindir}/*
253 %attr( 755,root,root) %{_libdir}/*
254 %attr( 754,root,root) /etc/cron.daily/exim.cron.db
255 %attr( 750,exim,root) %dir %{_var}/log/exim
256 %attr( 750,exim,root) %dir %{_var}/log/archiv/exim
257 %attr( 640,exim,root) %ghost %{_var}/log/exim/*
258 %{_infodir}/*
259 %{_mandir}/man8/*
260
261 %files X11
262 %defattr(644,root,root,755)
263 %attr(755,root,root) /usr/X11R6/bin/*
264 %{_applnkdir}/System/*
This page took 0.397081 seconds and 4 git commands to generate.