947843a
%if 0%{?fedora} > 12
947843a
%bcond_without python3
947843a
%else
947843a
%bcond_with python3
947843a
%endif
947843a
947843a
Name:           python-jmespath
a2d32c4
Version:        0.5.0
a2d32c4
Release:        1%{?dist}
947843a
Summary:        JSON Matching Expressions
947843a
Group:          System Environment/Libraries
947843a
947843a
License:        ASL 2.0
947843a
URL:            https://github.com/boto/jmespath
947843a
Source0:        https://pypi.python.org/packages/source/j/jmespath/jmespath-%{version}.tar.gz
947843a
947843a
BuildArch:      noarch
947843a
BuildRequires:  python2-devel
947843a
BuildRequires:  python-setuptools
947843a
%if %with python3
947843a
BuildRequires:  python3-devel
947843a
BuildRequires:  python3-setuptools
947843a
%endif
947843a
947843a
%description
947843a
JMESPath allows you to declaratively specify how to extract elements from
947843a
a JSON document.
947843a
947843a
This package contains the library for Python 2.
947843a
947843a
947843a
%package -n python3-jmespath
947843a
Summary:        JSON Matching Expressions
947843a
Group:          System Environment/Libraries
947843a
947843a
%description -n python3-jmespath
947843a
JMESPath allows you to declaratively specify how to extract elements from
947843a
a JSON document.
947843a
947843a
This package contains the library for Python 3.
947843a
947843a
947843a
%prep
947843a
%setup -q -n jmespath-%{version}
947843a
947843a
%if %with python3
947843a
rm -rf %{py3dir}
947843a
cp -a . %{py3dir}
947843a
find %{py3dir} -name '*.py' |xargs sed -i 's|^#!.*python|#!%{__python3}|'
947843a
%endif
947843a
947843a
find -name '*.py' |xargs sed -i 's|^#!.*python|#!%{__python2}|'
947843a
947843a
947843a
%build
947843a
%if %with python3
947843a
pushd %{py3dir}
947843a
%{__python3} setup.py build
947843a
popd
947843a
%endif
947843a
947843a
%{__python2} setup.py build
947843a
947843a
947843a
%install
947843a
%if %with python3
947843a
pushd %{py3dir}
947843a
%{__python3} setup.py install --skip-build --root %{buildroot}
947843a
mv %{buildroot}%{_bindir}/{,python3-}jp
947843a
popd
947843a
%endif
947843a
947843a
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
947843a
947843a
 
947843a
%check
947843a
%if %with python3
947843a
pushd %{py3dir}
947843a
%{__python3} setup.py test
947843a
popd
947843a
%endif
947843a
947843a
%{__python2} setup.py test
947843a
947843a
947843a
%files
947843a
%{python2_sitelib}/*
947843a
%{_bindir}/jp
947843a
%doc README.rst
947843a
%doc LICENSE.txt
947843a
947843a
947843a
%if %with python3
947843a
%files -n python3-jmespath
947843a
%{python3_sitelib}/*
947843a
%{_bindir}/python3-jp
947843a
%doc README.rst
947843a
%doc LICENSE.txt
947843a
%endif
947843a
947843a
947843a
%changelog
a2d32c4
* Fri Dec 19 2014 Lubomir Rintel <lkundrak@v3.sk> - 0.5.0-1
a2d32c4
- New version
a2d32c4
947843a
* Fri Jul 25 2014 Lubomir Rintel <lkundrak@v3.sk> - 0.4.1-2
947843a
- Add Python 3 support
947843a
947843a
* Fri Jul 25 2014 Lubomir Rintel <lkundrak@v3.sk> - 0.4.1-1
947843a
- Initial packaging