%global pypi_name tosca-parser %if 0%{?fedora} %global with_python3 1 %endif Name: python-%{pypi_name} Version: 0.1.0 Release: 3%{?dist} Summary: Parser for TOSCA Simple Profile in YAML License: ASL 2.0 URL: https://github.com/openstack/tosca-parser Source0: https://pypi.python.org/packages/source/t/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch %description The TOSCA Parser is an OpenStack project and licensed under Apache 2. It is developed to parse TOSCA Simple Profile in YAML. It reads the TOSCA templates and creates an in-memory graph of TOSCA nodes and their relationship. %package -n python2-%{pypi_name} Summary: Parser for TOSCA Simple Profile in YAML %{?python_provide:%python_provide python2-%{pypi_name}} BuildRequires: python2-devel BuildRequires: python-pbr >= 1.3 BuildRequires: python-sphinx BuildRequires: python-oslo-sphinx BuildRequires: python-babel BuildRequires: PyYAML BuildRequires: python-setuptools # Required for testing BuildRequires: python-six BuildRequires: python-dateutil BuildRequires: python-cliff BuildRequires: python-coverage BuildRequires: python-fixtures BuildRequires: python-hacking BuildRequires: python-testrepository BuildRequires: python-testtools BuildRequires: python-testscenarios BuildRequires: python-oslotest BuildRequires: python-subunit Requires: PyYAML Requires: python-six Requires: python-dateutil %description -n python2-%{pypi_name} The TOSCA Parser is an OpenStack project and licensed under Apache 2. It is developed to parse TOSCA Simple Profile in YAML. It reads the TOSCA templates and creates an in-memory graph of TOSCA nodes and their relationship. %package -n python2-%{pypi_name}-doc Summary: Parser for TOSCA Simple Profile in YAML - documentation %{?python_provide:%python_provide python2-%{pypi_name}-doc} BuildRequires: python-sphinx BuildRequires: python-oslo-sphinx Requires: python2-%{pypi_name} = %{version}-%{release} %description -n python2-%{pypi_name}-doc The TOSCA Parser is an OpenStack project and licensed under Apache 2. This package contains its documentation %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: Parser for TOSCA Simple Profile in YAML %{?python_provide:%python_provide python3-%{pypi_name}} BuildRequires: python3-devel BuildRequires: python3-pbr >= 1.3 BuildRequires: python3-sphinx BuildRequires: python3-oslo-sphinx BuildRequires: python3-babel BuildRequires: python3-PyYAML BuildRequires: python3-setuptools # Required for testing BuildRequires: python3-six BuildRequires: python3-dateutil BuildRequires: python3-cliff BuildRequires: python3-coverage BuildRequires: python3-fixtures BuildRequires: python3-hacking BuildRequires: python3-testrepository BuildRequires: python3-testtools BuildRequires: python3-testscenarios BuildRequires: python3-oslotest BuildRequires: python3-subunit Requires: python3-PyYAML Requires: python3-six Requires: python3-dateutil %description -n python3-%{pypi_name} The TOSCA Parser is an OpenStack project and licensed under Apache 2. It is developed to parse TOSCA Simple Profile in YAML. It reads the TOSCA templates and creates an in-memory graph of TOSCA nodes and their relationship. %package -n python3-%{pypi_name}-doc Summary: Parser for TOSCA Simple Profile in YAML - documentation %{?python_provide:%python_provide python3-%{pypi_name}-doc} BuildRequires: python3-sphinx BuildRequires: python3-oslo-sphinx Requires: python3-%{pypi_name} = %{version}-%{release} %description -n python3-%{pypi_name}-doc The TOSCA Parser is an OpenStack project and licensed under Apache 2. This package contains its documentation %endif %prep %setup -q -n %{pypi_name}-%{version} %build %{__python2} setup.py build %if 0%{?with_python3} %{__python3} setup.py build %endif %check %{__python2} setup.py test %if 0%{?with_python3} # Cleanup test repository rm -rf .testrepository %{__python3} setup.py test %endif %install %{py2_install} # generate html docs sphinx-build doc/source html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} # Set executable permission on test scripts find %{buildroot}/%{python2_sitelib}/toscaparser/tests -name '*.sh' -execdir chmod +x '{}' \; %if 0%{?with_python3} %{py3_install} sphinx-build-3 doc/source html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} # Set executable permission on test scripts find %{buildroot}/%{python3_sitelib}/toscaparser/tests -name '*.sh' -execdir chmod +x '{}' \; %endif %files -n python2-%{pypi_name} %doc README.rst %license LICENSE %{python2_sitelib}/toscaparser %{python2_sitelib}/tosca_parser-%{version}-py?.?.egg-info %files -n python2-%{pypi_name}-doc %doc html README.rst %license LICENSE %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc README.rst %license LICENSE %{python3_sitelib}/toscaparser %{python3_sitelib}/tosca_parser-%{version}-py?.?.egg-info %files -n python3-%{pypi_name}-doc %doc html README.rst %license LICENSE %endif %changelog * Wed Sep 09 2015 jpena - 0.1.0-3 - Fix file permissions for test scripts * Wed Sep 09 2015 jpena - 0.1.0-2 - Created docs subpackages - Added tests - Fixes for python3 subpkg * Tue Sep 08 2015 jpena - 0.1.0-1 - Initial package.