Blob Blame History Raw
# sitelib for noarch packages, sitearch for others (remove the unneeded one)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%define python_version %(%{__python} -c "import sys ; print sys.version[:3] ")

Name:           python-couchdb
Version:        0.6.1
Release:        4%{?dist}
Summary:        A Python library for working with CouchDB

Group:          Development/Languages
License:        BSD
URL:            http://code.google.com/p/couchdb-python/
Source0:        http://pypi.python.org/packages/source/C/CouchDB/CouchDB-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch0:         python-couchdb-shebang.patch

BuildArch:      noarch
BuildRequires:  python-setuptools python-devel
Requires:       couchdb
Requires:       python-httplib2
Requires:       python-simplejson

%package devel
Summary:        The  API reference files for CouchDB 
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}


%description
Providing a convenient high level interface for the CouchDB server.

%description devel
CouchDB python binding API reference documentation for use in development. 


%prep
%setup -q -n CouchDB-%{version}
%patch0 -p1


%build
%{__python} setup.py build


%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT

# calm rpmlint down
find  $RPM_BUILD_ROOT/%{python_sitelib}/couchdb -name \*.py -print0 | xargs --null chmod 0644


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc ChangeLog.txt COPYING README.txt 
%{_bindir}/couchdb-dump
%{_bindir}/couchdb-load
%{_bindir}/couchdb-replicate
%{_bindir}/couchpy
%{python_sitelib}/CouchDB-%{version}-py%{python_version}.egg-info
%{python_sitelib}/couchdb

%files devel
%defattr(-,root,root,-)
%doc doc/api doc/index.html

%changelog
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.1-3
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Wed Dec 16 2009 Jef Spaleta <jspaleta@fedoraproject.org> - 0.6.1-2
- Brown paper bag packaging fixes for the Fedora build system

* Tue Dec 15 2009 Jef Spaleta <jspaleta@fedoraproject.org> - 0.6.1-1
- New upstream version

* Mon Dec 14 2009 Jef Spaleta <jspaleta@fedoraproject.org> - 0.6-2
- Specfile cleanup based on review feedback

* Wed Nov 25 2009 Sebastian Dziallas <sebastian@when.com> - 0.6-1
- initial packaging