From 19f509b3ef86f67c73efe927e0a0cda00e4a9f8d Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: May 30 2015 00:03:56 +0000 Subject: update to 0.6.4 - enable python3 support --- diff --git a/.gitignore b/.gitignore index 4fd1cca..947cd86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /gitdb-0.5.2-17d9d13.tar.gz /gitdb-0.5.4.tar.gz +/gitdb-0.6.4.tar.gz diff --git a/python-gitdb.spec b/python-gitdb.spec index e6c7aa1..3f41618 100644 --- a/python-gitdb.spec +++ b/python-gitdb.spec @@ -1,26 +1,26 @@ -# sitelib for noarch packages, sitearch for others (remove the unneeded one) -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%if 0%{?fedora} > 12 +%global with_python3 1 +%else +%if 0%{?rhel} && 0%{?rhel} <= 7 +%{!?__python2: %global __python2 /usr/bin/python2} +%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%else +%global with_python3 1 +%endif +%endif Name: python-gitdb -Version: 0.5.4 -Release: 8%{?dist} +Version: 0.6.4 +Release: 1%{?dist} Summary: A pure-Python git object database Group: Development/Languages License: BSD -URL: http://pypi.python.org/packages/source/g/gitdb/gitdb-%{version}.tar.gz#md5=25353bb8d3ea527ba443dd88cd4e8a1c +URL: http://pypi.python.org/packages/source/g/gitdb/gitdb-%{version}.tar.gz#md5=44e4366b8bdfd306b075c3a52c96ae1a Source0: gitdb-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires: python-async >= 0.6.1, python-smmap +Requires: python-smmap -# python-async is needed for the check section -BuildRequires: python-devel, python-nose, python-async - -# Filter the private provide -%{?filter_setup: -%filter_provides_in %{python_sitearch}/gitdb/_perf.so -%filter_setup -} +BuildRequires: python-devel, python-nose, python-setuptools %description GitDB allows you to access bare git repositories for reading and writing. It @@ -28,33 +28,83 @@ aims at allowing full access to loose objects as well as packs with performance and scalability in mind. It operates exclusively on streams, allowing to operate on large objects with a small memory footprint. +%if 0%{?with_python3} +%package -n python3-gitdb +Summary: Python3 Git Library +Requires: python3-smmap +BuildRequires: python3-devel, python3-nose, python3-setuptools + +%description -n python3-gitdb +%{description} +%endif + +# Filter the private provide +%{?filter_setup: +%filter_provides_in %{python3_sitearch}/gitdb/_perf.so +%filter_setup +} %prep -%setup -q -n gitdb-%{version} +%setup -qc -n gitdb-%{version} +mv gitdb-%{version} python2 +%if 0%{?with_python3} +cp -a python2 python3 +find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%endif # with_python3 -%build -# Remove CFLAGS=... for noarch packages (unneeded) -CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build +find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' +pushd python2 +cp AUTHORS LICENSE ../ +popd -%install -rm -rf $RPM_BUILD_ROOT -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT -chmod 0755 $RPM_BUILD_ROOT%{python_sitearch}/gitdb/_perf.so +%build +pushd python2 +CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build +popd - -%clean -rm -rf $RPM_BUILD_ROOT +%if 0%{?with_python3} +pushd python3 +CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build +popd +%endif +%install +pushd python2 +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} +chmod 0755 %{buildroot}%{python2_sitearch}/gitdb/_perf.so +popd +%if 0%{?with_python3} +pushd python3 +%{__python3} setup.py install -O1 --skip-build --root %{buildroot} +popd +%endif %files %defattr(-,root,root,-) -%doc AUTHORS LICENSE -# For arch-specific packages: sitearch -%{python_sitearch}/* +%if 0%{?fedora} +%license LICENSE +%else +%doc LICENSE +%endif +%doc AUTHORS +%{python2_sitearch}/gitdb-%{version}-py?.?.egg-info +%{python2_sitearch}/gitdb/ + +%if 0%{?with_python3} +%files -n python3-gitdb +%license LICENSE +%doc AUTHORS +%{python3_sitearch}/gitdb-%{version}-py?.?.egg-info +%{python3_sitearch}/gitdb/ +%endif %changelog +* Tue May 26 2015 Dennis Gilmore - 0.6.4-1 +- update to 0.6.4 +- enable python3 support + * Sun Aug 17 2014 Fedora Release Engineering - 0.5.4-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild diff --git a/sources b/sources index 8390520..af8eed8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -25353bb8d3ea527ba443dd88cd4e8a1c gitdb-0.5.4.tar.gz +44e4366b8bdfd306b075c3a52c96ae1a gitdb-0.6.4.tar.gz