From 22cbe2b7afd579c7b7326363e075466297b1899b Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Aug 07 2013 14:54:09 +0000 Subject: Build python3 version as well --- diff --git a/pysvn.spec b/pysvn.spec index 33e41b0..c11f30a 100644 --- a/pysvn.spec +++ b/pysvn.spec @@ -1,8 +1,10 @@ -%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%if 0%{?fedora} +%global with_python3 1 +%endif Name: pysvn Version: 1.7.6 -Release: 7%{dist} +Release: 8%{dist} Summary: Pythonic style bindings for Subversion Group: Development/Languages License: ASL 1.1 @@ -21,12 +23,30 @@ BuildRequires: python-pycxx-devel Pythonic style bindings for Subversion +%if 0%{?with_python3} +%package -n python3-pysvn +Summary: Pythonic style bindings for Subversion + +BuildRequires: python3-devel +BuildRequires: python3-pycxx-devel + +%description -n python3-pysvn +Pythonic style bindings for Subversion + +%endif + + %prep %setup -q -n %{name}-%{version} # Remove bundled libs rm -Rf Import +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif + %build pushd Source CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py configure \ @@ -36,9 +56,29 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py configure \ %{__sed} -i -e 's/-Wall -fPIC -fexceptions -frtti/%{optflags} -fPIC -frtti/' Makefile %{__make} %{?_smp_mflags} +%if 0%{?with_python3} +pushd %{py3dir}/Source +CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py configure \ + --enable-debug --verbose --fixed-module-name --norpath \ + --pycxx-dir=/usr/include --pycxx-src-dir=/usr/src/CXX + +%{__sed} -i -e 's/-Wall -fPIC -fexceptions -frtti/%{optflags} -fPIC -frtti/' Makefile +%{__make} %{?_smp_mflags} +popd +%endif + %install %{__rm} -rf %{buildroot} + +%if 0%{?with_python3} +pushd %{py3dir} +%{__install} -d -m 755 %{buildroot}%{python3_sitearch}/%{name} +%{__install} -p -m 644 Source/pysvn/__init__.py %{buildroot}%{python3_sitearch}/%{name} +%{__install} -p -m 755 Source/pysvn/_pysvn.so %{buildroot}%{python3_sitearch}/%{name} +popd +%endif + %{__install} -d -m 755 %{buildroot}%{python_sitearch}/%{name} %{__install} -p -m 644 Source/pysvn/__init__.py %{buildroot}%{python_sitearch}/%{name} %{__install} -p -m 755 Source/pysvn/_pysvn.so %{buildroot}%{python_sitearch}/%{name} @@ -61,8 +101,19 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py configure \ %doc LICENSE.txt %{python_sitearch}/%{name} +%files -n python3-pysvn +%defattr(-, root, root, -) +%doc Docs/pysvn.html Docs/pysvn_prog_guide.html Docs/pysvn_prog_ref.html +%doc Docs/pysvn_prog_ref.js +%doc Examples +%doc LICENSE.txt +%{python3_sitearch}/%{name} + %changelog +* Wed Aug 07 2013 Stephen Gallagher - 1.7.6-8 +- Build python3 version as well + * Wed Aug 07 2013 Stephen Gallagher - 1.7.6-7 - Remove bundled copy of pyCXX - Resolves: RHBZ#838249