%define ver 		20050317
%define rel 		1.nvi
%define name 		exim-conf
%define eximcf 		/etc/exim
%define distserver 	http://bsd.falbi.kiev.ua/exim-4.50-conf/m4

Summary: 	The files needed to reconfigure Exim.
Name: 		%{name}
Version: 	%{ver}
Release:	%{rel}
URL:		http://bsd.falbi.kiev.ua
Group: 		System Environment/Daemons
License: 	GPL
BuildRoot: 	%{_tmppath}/%{name}-root
BuildPrereq: 	wget rsync sed
Requires: 	m4, rsync, exim >= 4.50
Vendor:		Victor Ustugov <victor@corvax.kiev.ua>
Packager:	Nikolai V. Ivanyushin <nvi@itadvisor.ru>
BuildArch:	noarch
Epoch: 		99999

%description
This package includes the configuration files you need to generate the
exim.conf file distributed with the exim package. You will need
the %{name} package if you ever need to reconfigure and rebuild
your exim.conf file.

%prep
%__rm -rf %{name}
%__mkdir %{name}
cd %{name}
%__mkdir m4 && cd m4
wget %{distserver}/Makefile

%build
cd %{name}/m4
%__make sync && %__make sync pre-install

%install
[ "$RPM_BUILD_ROOT" != "/" ] && %__rm -rf $RPM_BUILD_ROOT
cd %{name}
%__mkdir -p $RPM_BUILD_ROOT%{eximcf}
%__cp -R ./* $RPM_BUILD_ROOT%{eximcf}
# Fix perl path
for i in $RPM_BUILD_ROOT%{eximcf}/perl/*.pl; do
    %{__sed} 's:^#!/usr/local/bin/perl:#!/usr/bin/perl:' <$i >$i.tmp
    %{__mv} $i.tmp $i
    %{__chmod} +x $i
done

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && %__rm -rf $RPM_BUILD_ROOT
%__rm -rf $RPM_BUILD_DIR/%{name}

%files
%defattr(-,root,root)
%{eximcf}/acls
%{eximcf}/bin
%{eximcf}/deliveries
%{eximcf}/features
%{eximcf}/hacks
%{eximcf}/m4
%{eximcf}/patches
%{eximcf}/periodic
%{eximcf}/perl
%{eximcf}/redhat
%{eximcf}/samples
%config(missingok,noreplace) %{eximcf}/site/*
%{eximcf}/system_filters

%changelog
* Thu Mar 17 2005 Nikolai V. Ivanyushin <nvi@itadvisor.ru> nvi
- Rebuid for exim-4.50 support 
- new exim-conf branch was made by corvax

* Mon Jan 3 2005 Nikolai V. Ivanyushin <nvi@itadvisor.ru> nvi
- rebuilt with gpg signature and according to the nvi-release package

* Sun Nov 28 2004 Nikolai V. Ivanyushin <nvi@pisem.net> nvi
- rebuilt for fc3

* Mon Nov 15 2004 Nikolai V. Ivanyushin <nvi@pisem.net> nvi
- removed do_recode

* Thu Nov 11 2004 Nikolai V. Ivanyushin <nvi@pisem.net> nvi
- do_recode turned off by default

* Mon Nov 8 2004 Nikolai V. Ivanyushin <nvi@pisem.net> nvi
- added %{eximcf}/redhat directory
- some cosmetic changes

* Sat Nov 6 2004 Nikolai V. Ivanyushin <nvi@pisem.net> nvi
- some cosmetic changes

* Fri Nov 5 2004 Nikolai V. Ivanyushin <nvi@pisem.net> nvi
- %{eximcf}/site/* added to %%config files
- added Epoch: 99999
 
* Wed Nov 3 2004 Nikolai V. Ivanyushin <nvi@pisem.net> nvi
- files converted from koi8-r to %{locale} 
- added define do_recode
- recode added to BuildPrereq if defined do_recode

* Tue Nov 2 2004 Nikolai V. Ivanyushin <nvi@pisem.net> nvi
- roll back to /etc/exim inspired by Victor Ustugov
- changed name back to exim-conf thanx again Victor
- added Vendor tag, cheers Victor ;-)

* Mon Nov 1 2004 Nikolai V. Ivanyushin <nvi@pisem.net> nvi
- spec file changed to be in style of sendmail-cf rpm package
- changed name to exim-cf
- removed doc files
- moved to /usr/share/exim-cf
- added dependencies 
- fixed perl paths

* Sun Oct 31 2004 Nikolai V. Ivanyushin <nvi@pisem.net> nvi
- first build
