From b27e9695b3038cd96c3d55a60d340a4e7ca4607b73c8e2a17aa20112816c5149 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 14 Dec 2020 21:39:06 +0000 Subject: [PATCH 1/6] Accepting request 855849 from home:andythe_great:branches:devel:languages:python I honestly don't know why the original build script does not work, so I replace it with spec file from Fedora and got it working, it is most likely the way the pysvn were install and build that make testing fail. Hopes this is good enough. Thanks. OBS-URL: https://build.opensuse.org/request/show/855849 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysvn?expand=0&rev=44 --- python-pysvn.changes | 5 +++++ python-pysvn.spec | 45 ++++++++++++++++++++++---------------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/python-pysvn.changes b/python-pysvn.changes index f9f9760..3abd26f 100644 --- a/python-pysvn.changes +++ b/python-pysvn.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Dec 14 20:09:13 UTC 2020 - andy great + +- Adopt spec file from Fedora and enable testing. + ------------------------------------------------------------------- Fri Dec 11 13:34:16 UTC 2020 - andy great diff --git a/python-pysvn.spec b/python-pysvn.spec index a85814a..9fb66a9 100644 --- a/python-pysvn.spec +++ b/python-pysvn.spec @@ -16,6 +16,7 @@ # +%define packagename pysvn %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pysvn Version: 1.9.12 @@ -24,7 +25,7 @@ Summary: Highlevel Subversion Python Bindings License: Apache-1.1 Group: Development/Libraries/Python URL: https://pysvn.sourceforge.io/ -Source0: https://sourceforge.net/projects/pysvn/files/pysvn/V1.9.12/pysvn-%{version}.tar.gz +Source0: https://sourceforge.net/projects/pysvn/files/pysvn/V%{version}/pysvn-%{version}.tar.gz BuildRequires: %{python_module devel} BuildRequires: %{python_module pycxx-devel} BuildRequires: %{python_module xml} @@ -54,41 +55,39 @@ Features: * No need to understand the Subversion C API %prep -%setup -q -n pysvn-%{version} +%setup -q -n %{packagename}-%{version} + +# Remove bundled libs +rm -rf Import %build export CFLAGS="%{optflags}" -%{python_expand cp -r Source Source-%{$python_bin_suffix} -pushd Source-%{$python_bin_suffix} -$python setup.py backport -$python setup.py configure \ - --enable-debug --verbose --fixed-module-name --norpath \ - --pycxx-dir=%{$python_sysconfig_path include}/ --pycxx-src-dir=%{_datadir}/python%{$python_bin_suffix}/CXX +pushd Source +%{__python3} setup.py configure \ + --enable-debug --verbose --fixed-module-name --norpath + sed -i -e 's@-Wall -fPIC -fexceptions -frtti@%{optflags} -fPIC -frtti@' Makefile make %{?_smp_mflags} -popd -} %install -%{python_expand mkdir -p %{buildroot}/%{$python_sitearch}/pysvn -pushd Source-%{$python_bin_suffix} -cp pysvn/{__init__.py,_pysvn*.so} %{buildroot}/%{$python_sitearch}/pysvn -$python -m compileall -d %{$python_sitearch} %{buildroot}/%{$python_sitearch}/pysvn -$python -O -m compileall -d %{$python_sitearch} %{buildroot}/%{$python_sitearch}/pysvn -popd -} -rm -f Docs/generate_cpp_docs_from_html_docs.py +install -d -m 755 %{buildroot}%{python_sitearch}/%{packagename} +install -p -m 644 Source/%{packagename}/__init__.py %{buildroot}%{python_sitearch}/%{packagename} +install -p -m 755 Source/%{packagename}/_pysvn.so %{buildroot}%{python_sitearch}/%{packagename} -%fdupes %{buildroot}%{python_sitearch}/pysvn/__pycache__ +%fdupes %{buildroot}%{python_sitearch}/%{packagename}/__pycache__ %check -# Disabled test because there are errors. Bug report: https://sourceforge.net/p/pysvn/tickets/8/ -# cd Tests -# %%python_expand PYTHONPATH=%%{buildroot}%%{$python_sitearch} PYTHON=$python make %%{?_smp_mflags} || : +pushd Tests +# the tests expect a valid answer from locale.getdefaultlocale() +# C.UTF-8 does not work. Use en_US.utf-8. +# The test have not been test in parallel, use one core for now. +export LC_ALL=en_US.UTF-8 +%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} PYTHON=$python make -j1 +popd %files %{python_files} %license LICENSE.txt %doc Docs Examples -%{python_sitearch}/pysvn +%{python_sitearch}/%{packagename} %changelog From 1b5c9d4e7ca30f1f8e6784183f6a3dc672b5da8bf79d9e08103e23b3ae929b59 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 15 Dec 2020 15:24:24 +0000 Subject: [PATCH 2/6] Replace %__python3 with %python_exec OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysvn?expand=0&rev=45 --- python-pysvn.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pysvn.spec b/python-pysvn.spec index 9fb66a9..d867db5 100644 --- a/python-pysvn.spec +++ b/python-pysvn.spec @@ -63,7 +63,7 @@ rm -rf Import %build export CFLAGS="%{optflags}" pushd Source -%{__python3} setup.py configure \ +%{python_exec} setup.py configure \ --enable-debug --verbose --fixed-module-name --norpath sed -i -e 's@-Wall -fPIC -fexceptions -frtti@%{optflags} -fPIC -frtti@' Makefile From b5a59e283a74e527e93812d5167744c2279c3037a2beb34288b7711d4228cc2b Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 15 Dec 2020 15:24:48 +0000 Subject: [PATCH 3/6] Fix changes OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysvn?expand=0&rev=46 --- python-pysvn.changes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python-pysvn.changes b/python-pysvn.changes index 3abd26f..793a384 100644 --- a/python-pysvn.changes +++ b/python-pysvn.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Dec 15 15:24:30 UTC 2020 - Matej Cepl + +- Replace %__python3 with %python_exec + ------------------------------------------------------------------- Mon Dec 14 20:09:13 UTC 2020 - andy great From 3104e6cad9f4f090792eed25b1aa3803dfe2dc69039fe6fc51e564e0f49ba265 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 15 Dec 2020 15:34:38 +0000 Subject: [PATCH 4/6] Fix syntax OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysvn?expand=0&rev=47 --- python-pysvn.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-pysvn.spec b/python-pysvn.spec index d867db5..96d5ffa 100644 --- a/python-pysvn.spec +++ b/python-pysvn.spec @@ -63,7 +63,7 @@ rm -rf Import %build export CFLAGS="%{optflags}" pushd Source -%{python_exec} setup.py configure \ +%python_exec setup.py configure \ --enable-debug --verbose --fixed-module-name --norpath sed -i -e 's@-Wall -fPIC -fexceptions -frtti@%{optflags} -fPIC -frtti@' Makefile From 86e16bbb5e6b24ce1968d85080df2449b7215c3118b34aebdac8292137aa25f0 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 15 Dec 2020 17:08:06 +0000 Subject: [PATCH 5/6] Fix syntax OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysvn?expand=0&rev=48 --- python-pysvn.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python-pysvn.spec b/python-pysvn.spec index 96d5ffa..0f0782c 100644 --- a/python-pysvn.spec +++ b/python-pysvn.spec @@ -63,8 +63,7 @@ rm -rf Import %build export CFLAGS="%{optflags}" pushd Source -%python_exec setup.py configure \ - --enable-debug --verbose --fixed-module-name --norpath +%python_exec setup.py configure --enable-debug --verbose --fixed-module-name --norpath sed -i -e 's@-Wall -fPIC -fexceptions -frtti@%{optflags} -fPIC -frtti@' Makefile make %{?_smp_mflags} From d513c7fa5a13fbf6858c24b39b4aa2d2aacc18e4f7f14eb8d54331130ad6e69a Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 15 Dec 2020 17:52:53 +0000 Subject: [PATCH 6/6] Improve %%files OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysvn?expand=0&rev=49 --- python-pysvn.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python-pysvn.spec b/python-pysvn.spec index 0f0782c..d39f5cd 100644 --- a/python-pysvn.spec +++ b/python-pysvn.spec @@ -87,6 +87,7 @@ popd %files %{python_files} %license LICENSE.txt %doc Docs Examples -%{python_sitearch}/%{packagename} +%dir %{python_sitearch}/%{packagename} +%{python_sitearch}/%{packagename}/* %changelog