Nejc Saje a650e78
%global pypi_name oslo.serialization
9c8249b
%global pkg_name oslo-serialization
d10f64e
9c8249b
%if 0%{?fedora} >= 24
d10f64e
%global with_python3 1
d10f64e
%endif
Nejc Saje a650e78
Alan Pevec 674f60e
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
Alan Pevec 674f60e
9c8249b
Name:           python-%{pkg_name}
9c8249b
Version:        2.4.0
9c8249b
Release:        1%{?dist}
Nejc Saje a650e78
Summary:        OpenStack oslo.serialization library
Nejc Saje a650e78
Nejc Saje a650e78
License:        ASL 2.0
Nejc Saje a650e78
URL:            https://launchpad.net/oslo
Nejc Saje a650e78
Source0:        https://pypi.python.org/packages/source/o/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
Nejc Saje a650e78
BuildArch:      noarch
Nejc Saje a650e78
d10f64e
%description
d10f64e
An OpenStack library for representing objects in transmittable and
d10f64e
storable formats.
d10f64e
9c8249b
%package -n python2-%{pkg_name}
d10f64e
Summary:        OpenStack oslo.serialization library
9c8249b
%{?python_provide:%python_provide python2-%{pkg_name}}
d10f64e
Nejc Saje a650e78
BuildRequires:  python2-devel
Nejc Saje a650e78
BuildRequires:  python-pbr
9c8249b
# test requirements
9c8249b
BuildRequires:  python-hacking
986555e
BuildRequires:  python-mock
9c8249b
BuildRequires:  python-netaddr
986555e
BuildRequires:  python-oslotest
986555e
BuildRequires:  python-simplejson
9c8249b
BuildRequires:  python-oslo-i18n
9c8249b
BuildRequires:  python-coverage
d10f64e
Nejc Saje a650e78
Requires:       python-babel
Nejc Saje a650e78
Requires:       python-iso8601
Nejc Saje a650e78
Requires:       python-oslo-utils
Nejc Saje a650e78
Requires:       python-six
Alan Pevec f1c7463
Requires:       python-msgpack
Nejc Saje a650e78
9c8249b
%description -n python2-%{pkg_name}
Nejc Saje a650e78
An OpenStack library for representing objects in transmittable and
Nejc Saje a650e78
storable formats.
Nejc Saje a650e78
Nejc Saje a650e78
9c8249b
%package -n python-%{pkg_name}-tests
9c8249b
Summary:   Tests for OpenStack Oslo serialization library
Nejc Saje a650e78
9c8249b
Requires:  python-%{pkg_name} = %{version}-%{release}
9c8249b
Requires:  python-hacking
9c8249b
Requires:  python-mock
9c8249b
Requires:  python-netaddr
9c8249b
Requires:  python-oslotest
9c8249b
Requires:  python-simplejson
9c8249b
Requires:  python-oslo-i18n
9c8249b
Requires:  python-coverage
9c8249b
9c8249b
%description -n python-%{pkg_name}-tests
9c8249b
Tests for OpenStack Oslo serialization library
Nejc Saje a650e78
d10f64e
%if 0%{?with_python3}
9c8249b
%package -n python3-%{pkg_name}
d10f64e
Summary:        OpenStack oslo.serialization library
9c8249b
%{?python_provide:%python_provide python3-%{pkg_name}}
d10f64e
d10f64e
BuildRequires:  python3-devel
d10f64e
BuildRequires:  python3-pbr
9c8249b
# test requirements
9c8249b
BuildRequires:  python3-hacking
986555e
BuildRequires:  python3-mock
9c8249b
BuildRequires:  python3-netaddr
986555e
BuildRequires:  python3-oslotest
986555e
BuildRequires:  python3-simplejson
9c8249b
BuildRequires:  python3-oslo-i18n
9c8249b
BuildRequires:  python3-coverage
d10f64e
d10f64e
Requires:       python3-babel
d10f64e
Requires:       python3-iso8601
d10f64e
Requires:       python3-oslo-utils
d10f64e
Requires:       python3-six
d10f64e
Requires:       python3-msgpack
d10f64e
9c8249b
%description -n python3-%{pkg_name}
d10f64e
An OpenStack library for representing objects in transmittable and
d10f64e
storable formats.
d10f64e
%endif
d10f64e
9c8249b
%package -n python-%{pkg_name}-doc
9c8249b
Summary:    Documentation for the Oslo serialization library
9c8249b
9c8249b
BuildRequires:  python-sphinx
9c8249b
BuildRequires:  python-oslo-sphinx
9c8249b
BuildRequires:  python-oslo-utils
9c8249b
BuildRequires:  python-msgpack
9c8249b
9c8249b
Requires:  python-%{pkg_name} = %{version}-%{release}
9c8249b
9c8249b
%description -n python-%{pkg_name}-doc
9c8249b
Documentation for the Oslo serialization library.
9c8249b
Nejc Saje a650e78
%prep
Alan Pevec 674f60e
%setup -q -n %{pypi_name}-%{upstream_version}
d10f64e
# Let RPM handle the dependencies
9c8249b
rm -f requirements.txt
Nejc Saje a650e78
Nejc Saje a650e78
%build
9c8249b
%py2_build
9c8249b
9c8249b
# doc
9c8249b
export PYTHONPATH="$( pwd ):$PYTHONPATH"
9c8249b
pushd doc
9c8249b
sphinx-build -b html -d build/doctrees   source build/html
9c8249b
popd
9c8249b
# Fix hidden-file-or-dir warnings
9c8249b
rm -fr doc/build/html/.buildinfo
9c8249b
d10f64e
%if 0%{?with_python3}
9c8249b
%py3_build
d10f64e
%endif
Nejc Saje a650e78
Nejc Saje a650e78
%install
9c8249b
%py2_install
9c8249b
d10f64e
%if 0%{?with_python3}
9c8249b
%py3_install
d10f64e
%endif
d10f64e
d10f64e
%check
d10f64e
%{__python2} setup.py test
d10f64e
%if 0%{?with_python3}
9c8249b
rm -rf .testrepository
d10f64e
%{__python3} setup.py test
d10f64e
%endif
d10f64e
9c8249b
%files -n python2-%{pkg_name}
d10f64e
%doc README.rst
d10f64e
%license LICENSE
Alan Pevec 0db1099
%{python2_sitelib}/oslo_serialization
Nejc Saje a650e78
%{python2_sitelib}/*.egg-info
9c8249b
%exclude %{python2_sitelib}/oslo_serialization/tests
9c8249b
Nejc Saje a650e78
d10f64e
%if 0%{?with_python3}
9c8249b
%files -n python3-%{pkg_name}
d10f64e
%doc README.rst
d10f64e
%license LICENSE
d10f64e
%{python3_sitelib}/oslo_serialization
d10f64e
%{python3_sitelib}/*.egg-info
9c8249b
%exclude %{python3_sitelib}/oslo_serialization/tests
d10f64e
%endif
d10f64e
9c8249b
%files -n python-%{pkg_name}-doc
9c8249b
%doc doc/build/html
d10f64e
%license LICENSE
Nejc Saje a650e78
9c8249b
%files -n python-%{pkg_name}-tests
9c8249b
%{python2_sitelib}/oslo_serialization/tests
Nejc Saje a650e78
Alan Pevec 417851e
9c8249b
%changelog
9c8249b
* Tue Mar 22 2016 Haikel Guemar <hguemar@fedoraproject.org> 2.4.0-
9c8249b
- Update to 2.4.0
Alan Pevec c36300b