diff --git a/.gitignore b/.gitignore index 631037c..ccee22b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /ujson-1.33.zip /ujson-1.35.tar.gz /ultrajson-2f1d4874f4f4d2a40a460678004c80e69387c663.tar.gz +/ujson-2.0.3.tar.gz diff --git a/0001-Use-system-wide-double-conversion.patch b/0001-Use-system-wide-double-conversion.patch new file mode 100644 index 0000000..13042e1 --- /dev/null +++ b/0001-Use-system-wide-double-conversion.patch @@ -0,0 +1,44 @@ +From 6f7d2565037b4a85bdc0da69da59be876327e166 Mon Sep 17 00:00:00 2001 +From: Igor Raits +Date: Tue, 12 May 2020 06:15:45 +0200 +Subject: [PATCH] Use system-wide double-conversion + +Signed-off-by: Igor Raits +--- + setup.py | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/setup.py b/setup.py +index 06eb031..53d72cd 100644 +--- a/setup.py ++++ b/setup.py +@@ -18,22 +18,19 @@ Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + """ + +-dconv_source_files = glob("./deps/double-conversion/double-conversion/*.cc") +-dconv_source_files.append("./lib/dconv_wrapper.cc") +- + module1 = Extension( + "ujson", +- sources=dconv_source_files +- + [ ++ sources=[ ++ "./lib/dconv_wrapper.cc", + "./python/ujson.c", + "./python/objToJSON.c", + "./python/JSONtoObj.c", + "./lib/ultrajsonenc.c", + "./lib/ultrajsondec.c", + ], +- include_dirs=["./python", "./lib", "./deps/double-conversion/double-conversion"], ++ include_dirs=["./python", "./lib", "/usr/include/double-conversion"], + extra_compile_args=["-D_GNU_SOURCE"], +- extra_link_args=["-lstdc++", "-lm"], ++ extra_link_args=["-lstdc++", "-lm", "-ldouble-conversion"], + ) + + +-- +2.26.2 + diff --git a/python-ujson.spec b/python-ujson.spec index 77bc727..e1016c3 100644 --- a/python-ujson.spec +++ b/python-ujson.spec @@ -1,33 +1,20 @@ %global modname ujson %global srcname ultrajson -%global github_owner esnme -%global github_name %{srcname} -%global github_commit 2f1d4874f4f4d2a40a460678004c80e69387c663 -# if set, build will be a snapshot. change % to # to disable -%global github_date 20170206 -# rpmdev-bumpsec will bump this number -%global baserelease 3 -# release number; make it '0.x' for pre-releases -%global rel 0.%{baserelease} - -%global shortcommit %(c=%{github_commit}; echo ${c:0:7}) - Name: python-%{modname} -Version: 2.0 -# include the snapshot bits if github_date is set -Release: %{rel}%{?github_date:.%{github_date}git%{shortcommit}}%{?dist} -Summary: An ultra fast JSON encoder and decoder written in pure C +Version: 2.0.3 +Release: 1%{?dist} +Summary: Ultra fast JSON encoder and decoder written in pure C License: BSD -URL: https://github.com/%{github_owner}/%{github_name} -%if 0%{?github_date} -Source0: %{url}/archive/%{github_commit}/%{github_name}-%{github_commit}.tar.gz -%else -Source0: %{url}/archive/v%{version}/%{modname}-%{version}.tar.gz -%endif +URL: https://github.com/ultrajson/ultrajson +Source: %{pypi_source %{modname}} BuildRequires: gcc +BuildRequires: double-conversion-devel + +%patchlist +0001-Use-system-wide-double-conversion.patch %global _description \ UltraJSON is an ultra fast JSON encoder and decoder written in\ @@ -38,10 +25,9 @@ pure C with bindings for Python. %package -n python3-%{modname} Summary: %{summary} BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-six -BuildRequires: python3-pytz -BuildRequires: python3-blist +BuildRequires: python3dist(setuptools) +BuildRequires: python3dist(setuptools-scm) +BuildRequires: python3dist(pytest) %{?python_provide:%python_provide python3-%{modname}} %description -n python3-%{modname} %{_description} @@ -49,11 +35,8 @@ BuildRequires: python3-blist Python 3 version. %prep -%if 0%{?github_date} -%autosetup -n %{srcname}-%{github_commit} -p1 -%else -%autosetup -n %{srcname}-%{version} -p1 -%endif +%autosetup -n %{modname}-%{version} -p1 +rm -vrf deps %build %py3_build @@ -62,7 +45,7 @@ Python 3 version. %py3_install %check -PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} tests/tests.py -v +PYTHONPATH=%{buildroot}%{python3_sitearch} %python3 -m pytest -v %files -n python3-%{modname} %license LICENSE.txt @@ -71,6 +54,9 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} tests/tests.py -v %{python3_sitearch}/%{modname}*.so %changelog +* Tue May 12 2020 Igor Raits - 2.0.3-1 +- Update to 2.0.3 + * Thu Jan 30 2020 Fedora Release Engineering - 2.0-0.3.20170206git2f1d487 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/sources b/sources index f3bb467..19a3e4b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ultrajson-2f1d4874f4f4d2a40a460678004c80e69387c663.tar.gz) = 847bba6993d9a5cd956ff9eb039436e3bdc8e56e8b1e725e0c427fc6c530f4cf23286e21437dc2f5433caa12000f8610fe5e39430fa51b747c8a8690498685a5 +SHA512 (ujson-2.0.3.tar.gz) = 2c1879c372745966a00e064559dbf615f282ef192cbdbb29243c48169fc5f6e9344eba29988a1de3b5b0d1fe7699fcd88373d6dbb2e3fb59b1e8ef12b8a0375d