From 66c5e4e4809b05da9ca5febdcde75de44d693c06 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Jan 01 2017 13:14:29 +0000 Subject: Update to 1.35; Run test suite; Spec cleanups Signed-off-by: Igor Gnatenko --- diff --git a/.gitignore b/.gitignore index d467f7d..d219002 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /ujson-1.23.zip /ujson-1.33.zip +/ujson-1.35.tar.gz diff --git a/0001-do-not-forcefully-remove-the-build-directory-manuall.patch b/0001-do-not-forcefully-remove-the-build-directory-manuall.patch new file mode 100644 index 0000000..5f2d6f3 --- /dev/null +++ b/0001-do-not-forcefully-remove-the-build-directory-manuall.patch @@ -0,0 +1,51 @@ +From 39435177118c9fbc5d3863879c6e4616fd4c12c5 Mon Sep 17 00:00:00 2001 +From: anthraxx +Date: Tue, 26 Jan 2016 14:34:08 +0100 +Subject: [PATCH] do not forcefully remove the build directory manually + +this fixes issue #179. +setuptools should itself know when to use cache or create a +new build... however if someone wants to override that, it's +still possible but forcefully doing that on whatever +setuptools target will (and does) introduce problems. + +Build directory should be cleaned up via the clean sub-command. +examples: +- clean up temp: + python setup.py clean +- clean up whole build dir + python setup.py clean -a + +Or if somebody wants to, the build dir could be removed on the +shell. +--- + setup.py | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/setup.py b/setup.py +index 1e1e220..9f9c8b6 100644 +--- a/setup.py ++++ b/setup.py +@@ -3,7 +3,6 @@ try: + except ImportError: + from distutils.core import setup, Extension + import distutils.sysconfig +-import shutil + import os.path + import re + import sys +@@ -22,11 +21,6 @@ Programming Language :: Python :: 3 + Programming Language :: Python :: 3.2 + """.splitlines())) + +-try: +- shutil.rmtree("./build") +-except(OSError): +- pass +- + module1 = Extension('ujson', + sources = ['./python/ujson.c', + './python/objToJSON.c', +-- +2.11.0 + diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 6fc6994..0000000 --- a/LICENSE.txt +++ /dev/null @@ -1,35 +0,0 @@ -Developed by ESN, an Electronic Arts Inc. studio. -Copyright (c) 2014, Electronic Arts Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -* Neither the name of ESN, Electronic Arts Inc. nor the -names of its contributors may be used to endorse or promote products -derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL ELECTRONIC ARTS INC. BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -Portions of code from MODP_ASCII - Ascii transformations (upper/lower, etc) -http://code.google.com/p/stringencoders/ -Copyright (c) 2007 Nick Galbreath -- nickg [at] modp [dot] com. All rights reserved. - -Numeric decoder derived from from TCL library -http://www.opensource.apple.com/source/tcl/tcl-14/tcl/license.terms - * Copyright (c) 1988-1993 The Regents of the University of California. - * Copyright (c) 1994 Sun Microsystems, Inc. \ No newline at end of file diff --git a/python-ujson.spec b/python-ujson.spec index a5566a6..a1b0052 100644 --- a/python-ujson.spec +++ b/python-ujson.spec @@ -1,89 +1,79 @@ -%global pypi_name ujson +%global modname ujson +%global srcname ultrajson -Name: python-%{pypi_name} -Version: 1.33 -Release: 5%{?dist} +Name: python-%{modname} +Version: 1.35 +Release: 1%{?dist} Summary: An ultra fast JSON encoder and decoder written in pure C -Group: Development/Libraries License: BSD -URL: http://pypi.python.org/pypi/%{pypi_name} -Source0: http://pypi.python.org/packages/source/u/%{pypi_name}/%{pypi_name}-%{version}.zip -Source1: https://raw.githubusercontent.com/esnme/ultrajson/master/LICENSE.txt -BuildRequires: python2-devel -BuildRequires: python-setuptools -BuildRequires: python-tools +URL: https://github.com/esnme/ultrajson +Source0: %{url}/archive/v%{version}/%{modname}-%{version}.tar.gz +# https://github.com/esnme/ultrajson/commit/39435177118c9fbc5d3863879c6e4616fd4c12c5 +Patch0001: 0001-do-not-forcefully-remove-the-build-directory-manuall.patch +BuildRequires: python-tools -%description -UltraJSON is an ultra fast JSON encoder and decoder written in -pure C with bindings for Python +%global _description \ +UltraJSON is an ultra fast JSON encoder and decoder written in\ +pure C with bindings for Python. +%description %{_description} -%package -n python2-%{pypi_name} -Summary: An ultra fast JSON encoder and decoder written in pure C -%{?python_provide:%python_provide python2-%{pypi_name}} +%package -n python2-%{modname} +Summary: %{summary} +BuildRequires: python2-devel +BuildRequires: python2-setuptools +BuildRequires: python2-unittest2 +%{?python_provide:%python_provide python2-%{modname}} -%description -n python2-%{pypi_name} -UltraJSON is an ultra fast JSON encoder and decoder written in -pure C with bindings for Python +%description -n python2-%{modname} %{_description} +Python 2 version. -%package -n python3-%{pypi_name} -Summary: An ultra fast JSON encoder and decoder written in pure C +%package -n python3-%{modname} +Summary: %{summary} BuildRequires: python3-devel BuildRequires: python3-setuptools -%{?python_provide:%python_provide python3-%{pypi_name}} +%{?python_provide:%python_provide python3-%{modname}} -%description -n python3-%{pypi_name} -UltraJSON is an ultra fast JSON encoder and decoder written in -pure C with bindings for Python +%description -n python3-%{modname} %{_description} +Python 3 version. %prep -%setup -qn %{pypi_name}-%{version} -cp -a %{SOURCE1} . -# Remove egg-info -rm -rf *.egg-info - +%autosetup -n %{srcname}-%{version} -p1 %build %py2_build %py3_build - %install -# If we install with --skip-build the build directory containing the C -# extensions are deleted before the install. So, nothing install besides the -# egg-info. See: https://github.com/esnme/ultrajson/issues/179 -%{__python2} setup.py install -O1 --root %{buildroot} -%{__python3} setup.py install -O1 --root %{buildroot} - +%py2_install +%py3_install %check -# Test requires the PYTHONPATH to be updated with the result of the build. This -# requires to correctly go in the arm folder. -# See: https://lists.fedoraproject.org/pipermail/packaging/2015-July/010898.html -# %%{__python2} tests/tests.py -# Must run 2to3 before running test suite with python3 -2to3 -w tests/tests.py -# %%{__python3} tests/tests.py +PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} tests/tests.py -v +PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} tests/tests.py -v - -%files -n python2-%{pypi_name} +%files -n python2-%{modname} %license LICENSE.txt %doc README.rst -%{python2_sitearch}/%{pypi_name}-%{version}-py%{python2_version}.egg-info/ -%{python2_sitearch}/%{pypi_name}.so +%{python2_sitearch}/%{modname}-%{version}-py%{python2_version}.egg-info/ +%{python2_sitearch}/%{modname}.so -%files -n python3-%{pypi_name} +%files -n python3-%{modname} %license LICENSE.txt %doc README.rst -%{python3_sitearch}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/ -%{python3_sitearch}/%{pypi_name}*.so - +%{python3_sitearch}/%{modname}-%{version}-py%{python3_version}.egg-info/ +%{python3_sitearch}/%{modname}*.so %changelog +* Sun Jan 01 2017 Igor Gnatenko - 1.35-1 +- Update to 1.35 +- Run test suite +- Spec cleanups + * Mon Dec 19 2016 Miro HronĨok - 1.33-5 - Rebuild for Python 3.6 diff --git a/sources b/sources index dbecc3c..1825370 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8148a2493fff78940feab1e11dc0a893 ujson-1.33.zip +SHA512 (ujson-1.35.tar.gz) = cd5dc8d08e072cf703aec7d689070713f7073c22f13167d7e10a89219179248d6668894c1d742ca658672bb82e1dccbf72e3fd69e036d8cb2ee0ee799d10db11