%define name	rdist
%define version	6.1.5
%define release	2

Summary:	Maintains identical copies of files on multiple machines
Name:		%{name}
Version:	%{version}
Release:	%{release}
License:	IBM_ILA
Group:		Applications/Internet

Source:		ftp://ftp.sunet.se/pub/unix/admin/mirror-magnicomp/download/rdist/rdist-%{version}.tar.gz
Source1:	IBM_ILA
Patch0:		rdist-6.1.5-toolbox.patch
Patch1:		rdist-6.1.5-links.patch
Patch2:		rdist-6.1.5-environ.patch
# tmpfile security fix
Patch3:		rdist-6.1.5-tmpfile.patch

URL:		http://www.MagniComp.com/rdist
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
Prefix:		%{_prefix}

%description
The rdist program maintains identical copies of files on multiple
hosts.  If possible, rdist will preserve the owner, group, mode and
mtime of files and it can update programs that are executing.

%prep

%setup -q
%patch0 -p0 -b .toolbox
%patch1 -p0 -b .links
%patch2 -p0 -b .environ
%patch3 -p1 -b .tmpfile

# Add license info
cat $RPM_SOURCE_DIR/IBM_ILA > LICENSE
cat $RPM_SOURCE_DIR/rdist-license.html >> LICENSE

%build
make

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
mkdir -p $RPM_BUILD_ROOT/%{_sbindir}
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man8

install -s -m755 src/rdist $RPM_BUILD_ROOT%{_bindir}
install -s -m755 src/rdistd $RPM_BUILD_ROOT%{_bindir}

install -m644 doc/rdist.man $RPM_BUILD_ROOT/%{_mandir}/man1/rdist.1
install -m644 doc/rdistd.man $RPM_BUILD_ROOT/%{_mandir}/man8/rdistd.8

( cd $RPM_BUILD_ROOT

 /usr/bin/strip .%{prefix}/bin/* || :

    mkdir -p usr/linux/bin
    cd usr/linux/bin
    ln -sf ../../..%{prefix}/bin/* .
    cd -
)

%clean
rm -fr $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc README LICENSE
%{_bindir}/*
/usr/linux/bin/*
%{_mandir}/man*/*

%changelog
* Fri Jan 25 2002 David Clissold <cliss@austin.ibm.com> 6.1.5-1
- Adapt spec file for AIX Toolbox

* Tue Sep 11 2001 Stefan van der Eijk <stefan@eijk.nu> 6.1.5-18mdk
- BuildRequires: bison

* Wed Jan 10 2001 Vincent Danen <baudens@mandrakesoft.com> 6.1.5-17mdk
- security fix for tmpfile problems

* Tue Dec 20 2000 David BAUDENS <baudens@mandrakesoft.com> 6.1.5-16mdk
- Fix build on Linux 2.4 (aka fix very buggy OS detection)

* Fri Dec 08 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 6.1.5-15mdk
- add a correct links patch. (wls@astro.umd.edu)

* Thu Oct 26 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 6.1.5-14mdk
- remove the patch 1 which was causing some problems apparently.

* Wed Jul 26 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 6.1.5-13mdk
- macroszifications
- BM

* Sun Apr 16 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 6.1.5-12mdk
- Be sure to keep the environnement variable.

* Fri Apr 07 2000 Christopher Molnar <molnarc@mandrakesoft.com> 6.1.5-11mdk
- Update group to new grousp

* Sun Oct 31 1999 Axalon Bloodstone <axalon@linux-mandrake.com>
- Update Url
- Enable SMP build/check

* Sun Jul  4 1999 Axalon Bloodstone <axalon@linux-mandrake.com>
- bzip2 man pages not just rename them

* Wed May 05 1999 Bernhard Rosenkraenzer <bero@mandrakesoft.com>
- Mandrake adaptions
- handle RPM_OPT_FLAGS

* Tue Apr 13 1999 Jeff Johnson <jbj@redhat.com>
- add /usr/bin/rdistd symlink (#2154)
- update docs to reflect /usr/bin/oldrdist change.

* Mon Apr 12 1999 Jeff Johnson <jbj@redhat.com>
- use /usr/bin/oldrdist for old rdist compatibility path (#2044).

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 5)

* Wed Feb 17 1999 Jeff Johnson <jbj@redhat.com>
- dynamic allocation for link info (#1046)

* Thu Nov 12 1998 Jeff Johnson <jbj@redhat.com>
- update to 6.1.5

* Sun Aug 16 1998 Jeff Johnson <jbj@redhat.com>
- build root

* Tue May 05 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Mon Oct 20 1997 Otto Hammersmith <otto@redhat.com>
- fixed the url to the source
- fixed the copyright field

* Mon Jul 21 1997 Erik Troan <ewt@redhat.com>
- built against glibc
