17
0

Accepting request 865003 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/865003
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-python-cjson?expand=0&rev=5
This commit is contained in:
2021-01-20 17:29:07 +00:00
committed by Git OBS Bridge
2 changed files with 26 additions and 13 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Jan 20 10:16:09 UTC 2021 - John Vandenberg <jayvdb@gmail.com>
- Fix Tumbleweed multi Python 3 builds
-------------------------------------------------------------------
Wed Aug 5 14:50:03 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>

View File

@@ -47,36 +47,44 @@ the the range of 10-200 times for encoding operations and in the range of
%prep
%setup -q -n python-cjson-%{version}
cp jsontest.py jsontest2.py
%if %{with python2}
cp cjson.c cjson%{python2_bin_suffix}.c
cp jsontest.py jsontest%{python2_bin_suffix}.py
cp cjson.c cjson2.c
%endif
%patch0 -p1
cp cjson.c cjson%{python3_bin_suffix}.c
cp cjson.c cjson3.c
cp jsontest.py jsontest%{python3_bin_suffix}.py
cp jsontest.py jsontest3.py
# Workaround dict order differences on Python 3.4
if [ %{python3_bin_suffix} = '3.4' ]; then
sed -i 's/\(testWriteComplexArray\|testWriteSmallObject\)/_\1/' jsontest%{python3_bin_suffix}.py
sed -i 's/\(testWriteComplexArray\|testWriteSmallObject\)/_\1/' jsontest3.py
fi
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
%if %{with python2}
%{python_expand #
rm cjson.c
ln -s cjson%{python2_bin_suffix}.c cjson.c
%python2_build
%endif
rm cjson.c
ln -s cjson%{python3_bin_suffix}.c cjson.c
%python3_build
if [ "$python" == "python2" ]; then
ln -s cjson2.c cjson.c
else
ln -s cjson3.c cjson.c
fi
%{$python_build}
}
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python jsontest%{$python_bin_suffix}.py
%{python_expand # run test
if [ "$python" == "python2" ]; then
python_major_ver=2
else
python_major_ver=3
fi
PYTHONPATH=%{buildroot}%{$python_sitearch} $python jsontest${python_major_ver}.py -v
}
%files %{python_files}
%doc ChangeLog README