%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
# release number; make it '0.x' for pre-releases
%global rel 0.1
%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}.5
Summary: An 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
%global _description \
UltraJSON is an ultra fast JSON encoder and decoder written in\
pure C with bindings for Python.
%description %{_description}
%package -n python2-%{modname}
Summary: %{summary}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-six
BuildRequires: python2-pytz
BuildRequires: python2-blist
BuildRequires: python2-unittest2
%{?python_provide:%python_provide python2-%{modname}}
%description -n python2-%{modname} %{_description}
Python 2 version.
%package -n python3-%{modname}
Summary: %{summary}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-six
BuildRequires: python3-pytz
BuildRequires: python3-blist
%{?python_provide:%python_provide python3-%{modname}}
%description -n python3-%{modname} %{_description}
Python 3 version.
%prep
%if 0%{?github_date}
%autosetup -n %{srcname}-%{github_commit} -p1
%else
%autosetup -n %{srcname}-%{version} -p1
%endif
%build
%py2_build
%py3_build
%install
%py2_install
%py3_install
%check
PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} tests/tests.py -v
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} tests/tests.py -v
%files -n python2-%{modname}
%license LICENSE.txt
%doc README.rst
%{python2_sitearch}/%{modname}-%{version}-py%{python2_version}.egg-info/
%{python2_sitearch}/%{modname}.so
%files -n python3-%{modname}
%license LICENSE.txt
%doc README.rst
%{python3_sitearch}/%{modname}-%{version}-py%{python3_version}.egg-info/
%{python3_sitearch}/%{modname}*.so
%changelog
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.0-0.1.20170206git2f1d487.5
- Rebuilt for Python 3.7
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.0-0.1.20170206git2f1d487.4
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-0.1.20170206git2f1d487.3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-0.1.20170206git2f1d487.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-0.1.20170206git2f1d487.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Adam Williamson <awilliam@redhat.com> - 2.0-0.1.20170206git2f1d487
- Update to pre-2.0 git snapshot, removes non-standard serialization behaviour
* Sun Jan 01 2017 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.35-1
- Update to 1.35
- Run test suite
- Spec cleanups
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.33-5
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.33-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.33-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Fri Nov 06 2015 Robert Kuska <rkuska@redhat.com> - 1.33-2
- Rebuilt for Python3.5 rebuild
* Sat Aug 1 2015 Julien Enselme <jujens@jujens.eu> - 1.33-1
- Update to 1.33
- Enable python3 subpackage
- Update SPEC to match packaging guidelines
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Dec 19 2012 Kushal Das <kushal@fedoraproject.org> 1.23-1
- Intial package