commit 2a53012afaf5f4f08e11edb488fb9c5b814f006c Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:15:05 2019 -0400 Package init diff --git a/0001-Skip-unit-test-in-packaging.patch b/0001-Skip-unit-test-in-packaging.patch new file mode 100644 index 0000000..5f03e5c --- /dev/null +++ b/0001-Skip-unit-test-in-packaging.patch @@ -0,0 +1,25 @@ +From 5bf37e237694ac7bf028f9129561d1265fd95621 Mon Sep 17 00:00:00 2001 +From: Alfredo Moralejo +Date: Tue, 6 Feb 2018 16:57:17 +0000 +Subject: [PATCH] Skip unit test in packaging + +Tarball from pypy does not provides tests.js file. +--- + tests.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tests.py b/tests.py +index 548d28b..0386e29 100755 +--- a/tests.py ++++ b/tests.py +@@ -13,6 +13,7 @@ import sys + + class ApplyPatchTestCase(unittest.TestCase): + ++ @unittest.skip("Skipping in packaging") + def test_js_file(self): + with open('./tests.js', 'r') as f: + tests = json.load(f) +-- +1.8.3.1 + diff --git a/jsonpatch-1.21.tar.gz b/jsonpatch-1.21.tar.gz new file mode 100644 index 0000000..b486f4f Binary files /dev/null and b/jsonpatch-1.21.tar.gz differ diff --git a/python-jsonpatch.spec b/python-jsonpatch.spec new file mode 100644 index 0000000..6a4fe20 --- /dev/null +++ b/python-jsonpatch.spec @@ -0,0 +1,97 @@ +%global pypi_name jsonpatch +%bcond_without python3 +%bcond_without python2 + +Name: python-%{pypi_name} +Version: 1.21 +Release: 5 +Summary: Applying JSON Patches in Python +License: BSD +URL: https://github.com/stefankoegl/%{github_name} +Source0: https://pypi.io/packages/source/j/jsonpatch/%{pypi_name}-%{version}.tar.gz +Patch0: 0001-Skip-unit-test-in-packaging.patch +BuildArch: noarch + +%description +Library to apply JSON Patches according to RFC 6902 - Python 2 build. + +%if %{with python2} +%package -n python2-jsonpatch +Summary: Applying JSON Patches in Python 2 +BuildRequires: python2-devel python2-setuptools python2-jsonpointer +Requires: python2-jsonpointer + +%{?python_provide:%python_provide python2-%{pypi_name}} +%description -n python2-%{pypi_name} +Library to apply JSON Patches according to RFC 6902 - Python 2 build. +%endif + +%package -n python3-jsonpatch +Summary: Applying JSON Patches in Python 3 +BuildRequires: python3-devel python3-setuptools python3-jsonpointer +Requires: python3-jsonpointer + +%{?python_provide:%python_provide python3-%{pypi_name}} +%description -n python3-jsonpatch +Library to apply JSON Patches according to RFC 6902 - Python 3 build. + +%package_help + +%prep +%autosetup -n %{pypi_name}-%{version} -p1 + +%build +%if %{with python2} +%py2_build +%endif +LANG=en_US.utf8 +%py3_build + +%install +%if %{with python2} +%py2_install +for bin in jsondiff jsonpatch; do +mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/$bin-%{python2_version} +ln -s ./$bin-%{python2_version} %{buildroot}%{_bindir}/$bin-2 +done; +%endif + +LANG=en_US.utf8 %py3_install +for bin in jsondiff jsonpatch; do +mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/$bin-%{python3_version} +ln -s ./$bin-%{python3_version} %{buildroot}%{_bindir}/$bin-3 +ln -s ./$bin-%{python3_version} %{buildroot}%{_bindir}/$bin +done; + +%check +%if %{with python2} +%{__python2} tests.py +%endif +%{__python3} tests.py + +%if %{with python2} +%files -n python2-%{pypi_name} +%license COPYING +%{_bindir}/jsondiff-2* +%{_bindir}/jsonpatch-2* +%{python2_sitelib}/%{pypi_name}.py* +%{python2_sitelib}/*.egg-info +%endif + +%files -n python3-%{pypi_name} +%license COPYING +%{_bindir}/jsondiff +%{_bindir}/jsonpatch +%{_bindir}/jsondiff-3* +%{_bindir}/jsonpatch-3* +%{python3_sitelib}/%{pypi_name}.py* +%{python3_sitelib}/__pycache__/* +%{python3_sitelib}/*.egg-info + +%files help +%defattr(-,root,root) +%doc README.md + +%changelog +* Thu Sep 12 2019 openEuler Buildteam - 1.21-5 +- Package init