]> git.pld-linux.org Git - packages/python-dulwich.git/commitdiff
- added python3 module auto/th/python-dulwich-0.17.3-1
authorJakub Bogusz <qboosh@pld-linux.org>
Thu, 27 Apr 2017 18:05:16 +0000 (20:05 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Thu, 27 Apr 2017 18:05:16 +0000 (20:05 +0200)
python-dulwich.spec

index 4da76d7067fc28006c0ec2f77d53811c40b0d894..16c831659543fdb844208eae839523397a399e45 100644 (file)
@@ -1,9 +1,10 @@
-# TODO
-# - python3 package
 #
 # Conditional build:
-%bcond_with    tests   # do not perform "make test"
-%bcond_without doc     # don't build doc
+%bcond_without python2         # CPython 2.x module
+%bcond_without python3         # CPython 3.x module
+%bcond_with    python3_default # default binary names to Python 3 version
+%bcond_without tests           # nose tests
+%bcond_without doc             # don't build doc
 
 %define        module  dulwich
 Summary:       A Python implementation of the Git file formats and protocols
@@ -16,16 +17,28 @@ Group:              Libraries/Python
 Source0:       https://www.dulwich.io/releases/%{module}-%{version}.tar.gz
 # Source0-md5: 2e5a14b1f4cbc9207b8a4134683a6054
 URL:           https://www.dulwich.io/
+%if %{with python2}
 BuildRequires: python-devel >= 1:2.7
 BuildRequires: python-setuptools
-BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.714
 %if %{with tests}
 BuildRequires: python-gevent
 BuildRequires: python-geventhttpclient
 BuildRequires: python-nose
 BuildRequires: python-setuptools >= 17.1
 %endif
+%endif
+%if %{with python3}
+BuildRequires: python3-devel >= 1:3.3
+BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-gevent
+BuildRequires: python3-geventhttpclient
+BuildRequires: python3-nose
+BuildRequires: python3-setuptools >= 17.1
+%endif
+%endif
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
 %if %{with doc}
 BuildRequires: python-docutils
 BuildRequires: sphinx-pdg-2
@@ -53,6 +66,32 @@ można zbudować rozszerzenia w C poprawiające wydajność.
 Nazwa projektu wywodzi się od wioski, w której żyją Pan i Pani Git w
 skeczu Monty Pythona.
 
+%package -n python3-%{module}
+Summary:       A Python implementation of the Git file formats and protocols
+Summary(pl.UTF-8):     Pythonowa implementacja formatów plików i protokołów Gita
+Group:         Libraries/Python
+Requires:      python3-modules >= 1:3.3
+
+%description -n python3-%{module}
+Dulwich is a Python implementation of the Git file formats and
+protocols, which does not depend on Git itself.
+
+All functionality is available in pure Python. Optional C extensions
+can be built for improved performance.
+
+The project is named after the village in which Mr. and Mrs. Git live
+in the Monty Python sketch.
+
+%description -n python3-%{module} -l pl.UTF-8
+Dulwich to pythonowa implementacja formatów plików i protokołów Gita,
+nie zależąca od samego Gita.
+
+Cała funkcjonalność jest dostępna w czystym Pythonie. Opcjonalnie
+można zbudować rozszerzenia w C poprawiające wydajność.
+
+Nazwa projektu wywodzi się od wioski, w której żyją Pan i Pani Git w
+skeczu Monty Pythona.
+
 %package apidocs
 Summary:       Documentation for Python Dulwich module
 Summary(pl.UTF-8):     Dokumentacja moduły Pythona Dulwich
@@ -70,12 +109,20 @@ Dokumentacja moduły Pythona Dulwich.
 %{__rm} -r %{module}.egg-info
 
 %build
+%if %{with python2}
 %py_build
 
 %if %{with tests}
-cd dulwich/tests
-nosetests-%{py_ver} test*.py
-cd ../..
+nosetests-%{py_ver} dulwich/tests/test*.py
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+nosetests-%{py3_ver} dulwich/tests/test*.py
+%endif
 %endif
 
 %if %{with doc}
@@ -86,29 +133,82 @@ cd ../..
 
 %install
 rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
 %py_install
 
+for p in dul-receive-pack dul-upload-pack dulwich ; do
+       %{__mv} $RPM_BUILD_ROOT%{_bindir}/$p $RPM_BUILD_ROOT%{_bindir}/${p}-2
+done
+
 %py_postclean
 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{module}/*.[ch]
 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/%{module}/tests
 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/%{module}/contrib/test_*.py*
 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/docs/tutorial
+%endif
+
+%if %{with python3}
+%py3_install
+
+for p in dul-receive-pack dul-upload-pack dulwich ; do
+       %{__mv} $RPM_BUILD_ROOT%{_bindir}/$p $RPM_BUILD_ROOT%{_bindir}/${p}-3
+done
+
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/*.[ch]
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/tests
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/contrib/test_*.py*
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/docs/tutorial
+%endif
+
+for p in dul-receive-pack dul-upload-pack dulwich ; do
+       ln -sf ${p}-%{?with_python3_default:3}%{!?with_python3_default:2} $RPM_BUILD_ROOT%{_bindir}/${p}
+done
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS COPYING NEWS README.md README.swift.md TODO
+%attr(755,root,root) %{_bindir}/dul-receive-pack-2
+%attr(755,root,root) %{_bindir}/dul-upload-pack-2
+%attr(755,root,root) %{_bindir}/dulwich-2
+%if %{without python3_default}
 %attr(755,root,root) %{_bindir}/dul-receive-pack
 %attr(755,root,root) %{_bindir}/dul-upload-pack
 %attr(755,root,root) %{_bindir}/dulwich
+%endif
 %dir %{py_sitedir}/%{module}
 %{py_sitedir}/%{module}/*.py[co]
 %attr(755,root,root) %{py_sitedir}/%{module}/_*.so
 %dir %{py_sitedir}/%{module}/contrib
 %{py_sitedir}/%{module}/contrib/*.py[co]
 %{py_sitedir}/%{module}-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc AUTHORS COPYING NEWS README.md README.swift.md TODO
+%attr(755,root,root) %{_bindir}/dul-receive-pack-3
+%attr(755,root,root) %{_bindir}/dul-upload-pack-3
+%attr(755,root,root) %{_bindir}/dulwich-3
+%if %{with python3_default}
+%attr(755,root,root) %{_bindir}/dul-receive-pack
+%attr(755,root,root) %{_bindir}/dul-upload-pack
+%attr(755,root,root) %{_bindir}/dulwich
+%endif
+%dir %{py3_sitedir}/%{module}
+%{py3_sitedir}/%{module}/*.py
+%{py3_sitedir}/%{module}/__pycache__
+%attr(755,root,root) %{py3_sitedir}/%{module}/_*.cpython-*.so
+%dir %{py3_sitedir}/%{module}/contrib
+%{py3_sitedir}/%{module}/contrib/*.py
+%{py3_sitedir}/%{module}/contrib/__pycache__
+%{py3_sitedir}/%{module}-%{version}-py*.egg-info
+%endif
 
 %if %{with doc}
 %files apidocs
This page took 0.149765 seconds and 4 git commands to generate.