minor spec cleanups, python3 support
This commit is contained in:
parent
6aa5a78ccd
commit
62fec7034c
@ -1,34 +1,66 @@
|
||||
%global with_python3 1
|
||||
|
||||
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
|
||||
Name: python-httplib2
|
||||
Version: 0.6.0
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: A comprehensive HTTP client library
|
||||
|
||||
Group: System Environment/Libraries
|
||||
License: MIT
|
||||
URL: http://code.google.com/p/httplib2/
|
||||
Source0: http://httplib2.googlecode.com/files/httplib2-0.6.0.tar.gz
|
||||
Source0: http://httplib2.googlecode.com/files/httplib2-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: python-setuptools-devel
|
||||
BuildRequires: python-devel
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: python-setuptools-devel
|
||||
BuildRequires: python-devel
|
||||
BuildArch: noarch
|
||||
%if 0%{?with_python3}
|
||||
BuildRequires: python3-devel
|
||||
%endif # if with_python3
|
||||
|
||||
%description
|
||||
A comprehensive HTTP client library that supports many features left out of
|
||||
other HTTP libraries.
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%package -n python3-httplib2
|
||||
Summary: A comprehensive HTTP client library
|
||||
Group: System Environment/Libraries
|
||||
|
||||
%description -n python3-httplib2
|
||||
A comprehensive HTTP client library that supports many features left out of
|
||||
other HTTP libraries.
|
||||
%endif # with_python3
|
||||
|
||||
%prep
|
||||
%setup -q -n httplib2-%{version}
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS" python setup.py build
|
||||
%if 0%{?with_python3}
|
||||
rm -rf %{py3dir}
|
||||
cp -a . %{py3dir}
|
||||
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
|
||||
%endif # with_python3
|
||||
|
||||
%build
|
||||
%{__python} setup.py build
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py build
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
@ -37,7 +69,18 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%doc README
|
||||
%{python_sitelib}/*
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%files -n python3-httplib2
|
||||
%defattr(-,root,root,-)
|
||||
%doc README
|
||||
%{python3_sitelib}/*
|
||||
%endif # with_python3
|
||||
|
||||
%changelog
|
||||
* Tue Apr 20 2010 Tom "spot" Callaway <tcallawa@redhat.com>
|
||||
- minor spec cleanups
|
||||
- enable python3 support
|
||||
|
||||
* Fri Apr 02 2010 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
|
||||
- 0.6.0-1
|
||||
- version upgrade (#566721)
|
||||
|
Loading…
Reference in New Issue
Block a user