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