%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
Name: RBTools
Version: 0.2
Release: 5%{?dist}
Summary: Tools for use with ReviewBoard
Group: Applications/Internet
License: MIT
URL: http://www.review-board.org
Source0: http://downloads.review-board.org/releases/%{name}/0.2/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-devel
BuildRequires: python-setuptools
Requires: python-setuptools
Requires: python-simplejson
### Patches ###
# Don't use ez_setup, since RPM provides equivalent functionality
Patch0001: FED01-Disable-ez_setup-when-installing-by-RPM.patch
%description
RBTools provides client tools for interacting with a ReviewBoard
code-review server.
%prep
%setup -q -n %{name}-%{version}
# Apply patches
%patch0001 -p1
%build
%{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
# While /usr/bin/post-review also exists for this purpose,
# it is still sensible to make postreview.py executable
chmod +x $RPM_BUILD_ROOT/%{python_sitelib}/rbtools/postreview.py
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc AUTHORS NEWS README
%{_bindir}/post-review
%{python_sitelib}/rbtools/
%{python_sitelib}/RBTools*.egg-info/
%changelog
* Tue Apr 20 2010 Stephen Gallagher <sgallagh@redhat.com> - 0.2-5
- Update to 0.2 final release
* Tue Apr 06 2010 Stephen Gallagher <sgallagh@redhat.com> - 0.2-3.rc1
- Add runtime requirement for python-setuptools
* Mon Apr 05 2010 Stephen Gallagher <sgallagh@redhat.com> - 0.2-2.rc1
- Remove git-patchset patch
- Add patch to check for GNU diff
- Add patch to give more useful error messages on failure
* Mon Mar 15 2010 Stephen Gallagher <sgallagh@redhat.com> - 0.2-1.rc1
- Import upstream release 0.2rc1
- Add patches from upstream
- Add patch to support git patchsets