python-jsonpointer/python-jsonpointer.spec

94 lines
2.3 KiB
RPMSpec
Raw Normal View History

2013-09-12 18:38:31 +00:00
%global pypi_name jsonpointer
%global github_name python-json-pointer
%global commit c1ec3dfd171b242e23b3fe078a99f0e23fb0c6ea
%global shortcommit %(c=%{commit}; echo ${c:0:7})
2014-02-05 10:54:11 +00:00
%if 0%{?fedora} > 12
%global with_python3 1
%endif
2013-09-12 18:38:31 +00:00
Name: python-%{pypi_name}
Version: 1.0
Release: 4%{?dist}
2013-09-12 18:38:31 +00:00
Summary: Resolve JSON Pointers in Python
License: BSD
URL: https://github.com/stefankoegl/%{github_name}
# pypi tarball does not contain COPYING
Source0: https://github.com/stefankoegl/%{github_name}/archive/%{commit}/%{github_name}-%{version}-%{shortcommit}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
2014-02-05 10:54:11 +00:00
%if 0%{?with_python3}
BuildRequires: python3-devel
%endif
2013-09-12 18:38:31 +00:00
%description
Library to resolve JSON Pointers according to RFC 6901.
2014-02-05 10:54:11 +00:00
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: Resolve JSON Pointers in Python
%description -n python3-%{pypi_name}
Library to resolve JSON Pointers according to RFC 6901.
%endif
2013-09-12 18:38:31 +00:00
%prep
%setup -qn %{github_name}-%{commit}
2014-02-05 10:54:11 +00:00
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -ar . %{py3dir}
%endif
2013-09-12 18:38:31 +00:00
%build
%{__python} setup.py build
2014-02-05 10:54:11 +00:00
%if 0%{?with_python3}
pushd %{py3dir}
LC_ALL=en_US.UTF-8 \
%{__python3} setup.py build
popd
%endif
2013-09-12 18:38:31 +00:00
%install
2014-02-05 10:54:11 +00:00
%if 0%{?with_python3}
pushd %{py3dir}
LC_ALL=en_US.UTF-8 \
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif
2013-09-12 18:38:31 +00:00
%{__python} setup.py install --skip-build --root %{buildroot}
%check
2014-02-05 10:54:11 +00:00
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} tests.py
popd
%endif
2013-09-12 18:38:31 +00:00
%{__python} tests.py
%files
%doc README.md COPYING AUTHORS
%{python_sitelib}/%{pypi_name}.py*
%{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
2014-02-05 10:54:11 +00:00
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc README.md COPYING AUTHORS
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/%{pypi_name}.py*
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif
2013-09-12 18:38:31 +00:00
%changelog
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
2014-02-05 10:54:11 +00:00
* Wed Feb 5 2014 Thomas Spura <tomspur@fedoraproject.org> - 1.0-3
- add python3 subpackage (#1061622)
2013-09-12 18:38:31 +00:00
* Thu Sep 05 2013 Alan Pevec <apevec@gmail.com> - 1.0-2
- add AUTHORS to docs
* Mon Jul 01 2013 Alan Pevec <apevec@gmail.com> - 1.0-1
- Initial package.