%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Summary: Convenient and transparent local/remote incremental mirror/backup
Name: rdiff-backup
Version: 1.0.5
Release: 2%{?_dist_release}

URL: http://www.nongnu.org/rdiff-backup/
Source: http://savannah.nongnu.org/download/%{name}/%{name}-%{version}.tar.gz
License: GPL
Group: Applications/Internet

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: python-devel >= 2.2, librsync-devel >= 0.9.6

%description
rdiff-backup is a script, written in Python, that backs up one
directory to another and is intended to be run periodically (nightly
from cron for instance). The target directory ends up a copy of the
source directory, but extra reverse diffs are stored in the target
directory, so you can still recover files lost some time ago. The idea
is to combine the best features of a mirror and an incremental
backup. rdiff-backup can also operate in a bandwidth efficient manner
over a pipe, like rsync. Thus you can use rdiff-backup and ssh to
securely back a hard drive up to a remote location, and only the
differences from the previous backup will be transmitted.

%prep
%setup -q

%build
python setup.py build

%install
rm -rf $RPM_BUILD_ROOT
python setup.py install --root $RPM_BUILD_ROOT
# Produce .pyo files for %ghost directive later
python -Oc 'from compileall import *; compile_dir("'$RPM_BUILD_ROOT/%{python_sitearch}/rdiff_backup'")'

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc CHANGELOG COPYING FAQ.html README
%{_bindir}/rdiff-backup
%{_mandir}/man1/rdiff-backup*
%dir %{python_sitearch}/rdiff_backup
%{python_sitearch}/rdiff_backup/*.py
%{python_sitearch}/rdiff_backup/*.pyc
%{python_sitearch}/rdiff_backup/*.so
%{python_sitearch}/rdiff_backup/*.pyo

%changelog
* Mon Apr 19 2010 Shu KONNO <owa@bg.wakwak.com> 1.0.5-2
- rebuilt with python-2.6

* Mon Jul 21 2008 Shu KONNO <owa@bg.wakwak.com> 1.0.5-1vl5
- rebuilt with python-2.5.2
- applied new versioning policy

* Mon Jun 25 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0.5-0vl1
- initial build for Vine Linux

* Sun Dec 17 2006 Kevin Fenzi <kevin@tummy.com> - 1.0.5-2
- Rebuild for python 2.5

* Tue Dec 5  2006 Gavin Henry <ghenry@suretecsystems.com> - 0:1.0.5-1 
- Update to latest version

* Thu Oct 05 2006 Christian Iseli <Christian.Iseli@licr.org> 1.0.4-3
 - rebuilt for unwind info generation, broken in gcc-4.1.1-21

* Tue Sep 19 2006 Kevin Fenzi <kevin@tummy.com> - 1.0.4-2
- Build for fc6
- No longer need to ghost pyo files (bug 205431)

* Fri Dec 9  2005 Gavin Henry <ghenry@suretecsystems.com> - 0:1.0.4-1 
- Update to latest version

* Fri Dec 9  2005 Gavin Henry <ghenry@suretecsystems.com> - 0:1.0.3-1 
- Update to latest version

* Wed Sep 14 2005 Gavin Henry <ghenry@suretecsystems.com> - 0:1.0.1-1
- New version

* Thu Aug 15 2005 Gavin Henry <ghenry@suretecsystems.com> - 0:1.0.0-1
- Latest version

* Wed May 11 2005 Bill Nottingham <notting@redhat.com> - 0:0.12.7-3
- rebuilt

* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
- rebuilt

* Sat Jan 22 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 0:0.12.7-1
- Update to 0.12.7 which was released May 31st, 2004.
- Enhance spec with python-abi and arch-dependent sitelib paths.
- Update URL and Source.

* Sun Oct 05 2003 Ben Escoto <bescoto@stanford.edu> - 0:0.12.5-0.fdr.1
- Added epochs to python versions, more concise %%defines, %%ghost files

* Thu Aug 16 2003 Ben Escoto <bescoto@stanford.edu> - 0:0.12.3-0.fdr.4
- Implemented various suggestions of Fedora QA

* Sun Nov 4 2001 Ben Escoto <bescoto@stanford.edu>
- Initial RPM
