Blame SPECS/python-jmespath.spec

82cdf2
%if 0%{?rhel}
82cdf2
%global with_python3 0
82cdf2
%{!?__python2: %global __python2 /usr/bin/python2}
82cdf2
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
82cdf2
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
82cdf2
%{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}}
82cdf2
%{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}}
82cdf2
%else
82cdf2
%global with_python3 1
82cdf2
%endif
82cdf2
82cdf2
%global pypi_name jmespath
82cdf2
82cdf2
Name:           python-%{pypi_name}
82cdf2
Version:        0.9.0
82cdf2
Release:        3%{?dist}
82cdf2
Summary:        JSON Matching Expressions
82cdf2
82cdf2
License:        MIT
82cdf2
URL:            https://github.com/jmespath/jmespath.py
82cdf2
Source0:        https://pypi.python.org/packages/source/j/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
82cdf2
BuildArch:      noarch
82cdf2
82cdf2
BuildRequires:  python2-devel
82cdf2
BuildRequires:  python-setuptools
82cdf2
%if 0%{?with_python3}
82cdf2
BuildRequires:  python3-devel
82cdf2
BuildRequires:  python3-setuptools
82cdf2
%endif # with_python3
82cdf2
82cdf2
%description
82cdf2
JMESPath allows you to declaratively specify how to extract elements from
82cdf2
a JSON document.
82cdf2
82cdf2
%package -n     python2-%{pypi_name}
82cdf2
Summary:        JSON Matching Expressions
82cdf2
Provides:       python-%{pypi_name} = %{version}-%{release}
82cdf2
%{?python_provide:%python_provide python2-%{pypi_name}}
82cdf2
82cdf2
%description -n python2-%{pypi_name}
82cdf2
JMESPath allows you to declaratively specify how to extract elements from
82cdf2
a JSON document.
82cdf2
82cdf2
%if 0%{?with_python3}
82cdf2
%package -n     python3-%{pypi_name}
82cdf2
Summary:        JSON Matching Expressions
82cdf2
%{?python_provide:%python_provide python3-%{pypi_name}}
82cdf2
82cdf2
%description -n python3-%{pypi_name}
82cdf2
JMESPath allows you to declaratively specify how to extract elements from
82cdf2
a JSON document.
82cdf2
%endif # with_python3
82cdf2
82cdf2
%prep
82cdf2
%setup -n %{pypi_name}-%{version}
82cdf2
rm -rf %{pypi_name}.egg-info
82cdf2
82cdf2
%build
82cdf2
%py2_build
82cdf2
%if 0%{?with_python3}
82cdf2
%py3_build
82cdf2
%endif # with_python3
82cdf2
82cdf2
%install
82cdf2
%if 0%{?with_python3}
82cdf2
%py3_install
82cdf2
cp %{buildroot}/%{_bindir}/jp.py %{buildroot}/%{_bindir}/jp.py-3
82cdf2
ln -sf %{_bindir}/jp.py-3 %{buildroot}/%{_bindir}/jp.py-%{python3_version}
82cdf2
%endif # with_python3
82cdf2
82cdf2
%py2_install
82cdf2
cp %{buildroot}/%{_bindir}/jp.py %{buildroot}/%{_bindir}/jp.py-2
82cdf2
ln -sf %{_bindir}/jp.py-2 %{buildroot}/%{_bindir}/jp.py-%{python2_version}
82cdf2
82cdf2
82cdf2
%files -n python2-%{pypi_name}
82cdf2
%{!?_licensedir:%global license %doc}
82cdf2
%doc README.rst
82cdf2
%license LICENSE.txt
82cdf2
%{_bindir}/jp.py
82cdf2
%{_bindir}/jp.py-2
82cdf2
%{_bindir}/jp.py-%{python2_version}
82cdf2
%{python2_sitelib}/%{pypi_name}
82cdf2
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
82cdf2
82cdf2
%if 0%{?with_python3}
82cdf2
%files -n python3-%{pypi_name}
82cdf2
%doc README.rst
82cdf2
%license LICENSE.txt
82cdf2
%{_bindir}/jp.py-3
82cdf2
%{_bindir}/jp.py-%{python3_version}
82cdf2
%{python3_sitelib}/%{pypi_name}
82cdf2
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
82cdf2
%endif # with_python3
82cdf2
82cdf2
%changelog
82cdf2
* Mon Sep 11 2017 Pavel Cahyna <pcahyna@redhat.com> - 0.9.0-3
82cdf2
- Rebuilt for RHEL 7 Extras
82cdf2
82cdf2
* Tue Dec 29 2015 Fabio Alessandro Locati <fabio@locati.cc> - 0.9.0-1
82cdf2
- Upgrade to upstream current version
82cdf2
- Improve the spec file
82cdf2
- Make possible to build in EL6
82cdf2
82cdf2
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-3
82cdf2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
82cdf2
82cdf2
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-2
82cdf2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
82cdf2
82cdf2
* Fri Dec 19 2014 Lubomir Rintel <lkundrak@v3.sk> - 0.5.0-1
82cdf2
- New version
82cdf2
82cdf2
* Fri Jul 25 2014 Lubomir Rintel <lkundrak@v3.sk> - 0.4.1-2
82cdf2
- Add Python 3 support
82cdf2
82cdf2
* Fri Jul 25 2014 Lubomir Rintel <lkundrak@v3.sk> - 0.4.1-1
82cdf2
- Initial packaging