Blame python-barbicanclient.spec

8ae42b6
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
1878ae0
1878ae0
%global sname barbicanclient
1878ae0
%if 0%{?fedora}
1878ae0
%global with_python3 1
4c8e63c
%endif
1878ae0
4c8e63c
4c8e63c
Name:           python-barbicanclient
6a558c4
Version:        4.1.0
6a558c4
Release:        1%{?dist}
4c8e63c
Summary:        Client Library for OpenStack Barbican Key Management API
4c8e63c
4c8e63c
License:        ASL 2.0
6a558c4
URL:            https://pypi.io/pypi/python-barbicanclient
1878ae0
Source0:        https://pypi.io/packages/source/p/%{name}/%{name}-%{version}%{?milestone}.tar.gz
4c8e63c
4c8e63c
BuildArch:      noarch
4c8e63c
1878ae0
1878ae0
%description
1878ae0
This is a client for the Barbican Key Management API. There is a
1878ae0
Python library for accessing the API (barbicanclient module), and
1878ae0
a command-line script (barbican).
1878ae0
1878ae0
1878ae0
%package -n python2-%{sname}
1878ae0
Summary:        Client Library for OpenStack Barbican Key Management API
1878ae0
4c8e63c
BuildRequires:  python2-devel
4c8e63c
BuildRequires:  python-pbr
4c8e63c
BuildRequires:  python-setuptools
4c8e63c
4c8e63c
Requires:       python-setuptools
4c8e63c
Requires:       python-requests
4c8e63c
Requires:       python-six >= 1.9.0
4c8e63c
Requires:       python-keystoneclient
4c8e63c
Requires:       python-cliff
4c8e63c
Requires:       python-oslo-i18n
4c8e63c
Requires:       python-oslo-serialization
4c8e63c
Requires:       python-oslo-utils
4c8e63c
Requires:       python-iso8601
4c8e63c
Requires:       python-babel
4c8e63c
Requires:       python-oslo-config
4c8e63c
Requires:       python-netaddr
4c8e63c
Requires:       python-prettytable
4c8e63c
Requires:       python-stevedore
4c8e63c
Requires:       pyparsing
4c8e63c
Requires:       python-cmd2
4c8e63c
Requires:       pytz
4c8e63c
Requires:       python-msgpack
4c8e63c
1878ae0
%{?python_provide:%python_provide python2-%{sname}}
1878ae0
1878ae0
%description -n python2-%{sname}
4c8e63c
This is a client for the Barbican Key Management API. There is a
4c8e63c
Python library for accessing the API (barbicanclient module), and
4c8e63c
a command-line script (barbican).
4c8e63c
1878ae0
1878ae0
%if 0%{?with_python3}
1878ae0
%package -n python3-%{sname}
1878ae0
Summary:        Client Library for OpenStack Barbican Key Management API
1878ae0
1878ae0
BuildRequires:  python3-devel
1878ae0
BuildRequires:  python3-pbr
1878ae0
BuildRequires:  python3-setuptools
1878ae0
1878ae0
Requires:       python3-setuptools
1878ae0
Requires:       python3-requests
1878ae0
Requires:       python3-six >= 1.9.0
1878ae0
Requires:       python3-keystoneclient
1878ae0
Requires:       python3-cliff
1878ae0
Requires:       python3-oslo-i18n
1878ae0
Requires:       python3-oslo-serialization
1878ae0
Requires:       python3-oslo-utils
1878ae0
Requires:       python3-iso8601
1878ae0
Requires:       python3-babel
1878ae0
Requires:       python3-oslo-config
1878ae0
Requires:       python3-netaddr
1878ae0
Requires:       python3-prettytable
1878ae0
Requires:       python3-stevedore
1878ae0
Requires:       python3-pyparsing
1878ae0
Requires:       python3-cmd2
1878ae0
Requires:       python3-pytz
1878ae0
Requires:       python3-msgpack
1878ae0
1878ae0
%{?python_provide:%python_provide python3-%{sname}}
1878ae0
1878ae0
%description -n python3-%{sname}
1878ae0
This is a client for the Barbican Key Management API. There is a
1878ae0
Python library for accessing the API (barbicanclient module), and
1878ae0
a command-line script (barbican).
1878ae0
%endif
1878ae0
1878ae0
4c8e63c
%package doc
4c8e63c
Summary: Documentation for OpenStack Barbican API client
4c8e63c
4c8e63c
BuildRequires:  python-sphinx
4c8e63c
BuildRequires:  python-oslo-sphinx
4c8e63c
BuildRequires:  python-oslo-utils
4c8e63c
BuildRequires:  dos2unix
4c8e63c
BuildRequires:  python-oslo-i18n
8ae42b6
BuildRequires:  python-prettytable
8ae42b6
BuildRequires:  python-keystoneclient
4c8e63c
4c8e63c
%description doc
4c8e63c
Documentation for the barbicanclient module
4c8e63c
4c8e63c
%prep
8ae42b6
%setup -q -n %{name}-%{upstream_version}
4c8e63c
# let RPM handle deps
4c8e63c
sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
4c8e63c
4c8e63c
rm -rf {test-,}requirements.txt
4c8e63c
4c8e63c
%build
1878ae0
%py2_build
1878ae0
%if 0%{?with_python3}
1878ae0
%py3_build
1878ae0
%endif
1878ae0
4c8e63c
# doc
4c8e63c
export PYTHONPATH="$( pwd ):$PYTHONPATH"
4c8e63c
pushd doc
4c8e63c
sphinx-build -b html -d build/doctrees   source build/html
4c8e63c
popd
4c8e63c
# Fix hidden-file-or-dir warnings
4c8e63c
rm -fr doc/build/html/.buildinfo
4c8e63c
4c8e63c
%install
1878ae0
%if 0%{?with_python3}
1878ae0
%py3_install
1878ae0
mv %{buildroot}%{_bindir}/barbican %{buildroot}%{_bindir}/barbican-%{python3_version}
1878ae0
ln -s ./barbican-%{python3_version} %{buildroot}%{_bindir}/barbican-3
1878ae0
%endif
1878ae0
1878ae0
%py2_install
1878ae0
mv %{buildroot}%{_bindir}/barbican %{buildroot}%{_bindir}/barbican-%{python2_version}
1878ae0
ln -s ./barbican-%{python2_version} %{buildroot}%{_bindir}/barbican-2
1878ae0
1878ae0
ln -s ./barbican-2 %{buildroot}%{_bindir}/barbican
1878ae0
4c8e63c
dos2unix doc/build/html/_static/jquery.js
4c8e63c
4c8e63c
1878ae0
%files -n python2-%{sname}
4c8e63c
%license LICENSE
4c8e63c
%doc AUTHORS CONTRIBUTING.rst README.rst PKG-INFO ChangeLog
4c8e63c
%{_bindir}/barbican
1878ae0
%{_bindir}/barbican-2*
4c8e63c
%{python2_sitelib}/barbicanclient
8ae42b6
%{python2_sitelib}/python_barbicanclient-%{upstream_version}-py?.?.egg-info
4c8e63c
1878ae0
%if 0%{?with_python3}
1878ae0
%files -n python3-%{sname}
1878ae0
%license LICENSE
1878ae0
%doc AUTHORS CONTRIBUTING.rst README.rst PKG-INFO ChangeLog
1878ae0
%{_bindir}/barbican-3*
1878ae0
%{python3_sitelib}/barbicanclient
1878ae0
%{python3_sitelib}/python_barbicanclient-%{upstream_version}-py?.?.egg-info
1878ae0
%endif
1878ae0
4c8e63c
%files doc
4c8e63c
%doc doc/build/html
4c8e63c
%license LICENSE
4c8e63c
4c8e63c
%changelog
6a558c4
* Mon Sep 12 2016 Haikel Guemar <hguemar@fedoraproject.org> 4.1.0-1
6a558c4
- Update to 4.1.0
e6214ae