Blob Blame History Raw
%global pypi_name semantic_version
%{!?_licensedir:%global license %%doc}

Name:           python-%{pypi_name}
Version:        2.4.2
Release:        2%{?dist}
Summary:        A library implementing the 'SemVer' scheme

License:        BSD
URL:            https://github.com/rbarrois/python-semanticversion
Source0:        https://pypi.python.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python2-devel
BuildRequires:  python-setuptools >= 0.8

Provides:       python-semantic-version

%description
This small python library provides a few tools to handle semantic versioning
in Python

%package doc
Summary:    Documentation for python-%{pypi_name}

BuildRequires:  python-sphinx

%description doc
Documentation for python-%{pypi_name}


%prep
%setup -q -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
# documentation builds due to broken symlink
# https://github.com/rbarrois/python-semanticversion/issues/20
rm docs/credits.rst


%build
%{__python2} setup.py build

# generate html docs
sphinx-build docs html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}



%install
%{__python2} setup.py install --skip-build --root %{buildroot}


%check
%{__python2} setup.py test


%files
%license LICENSE
%doc README.rst ChangeLog
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%files doc
%license LICENSE
%doc html

%changelog
* Wed Jun 13 2018 David Cantrell <dcantrell@redhat.com> - 2.4.2-2
- Rebuild

* Wed May 30 2018 David Shea <dshea@redhat.com> - 2.4.2-1
- Initial import for Red Hat Enterprise Linux 7
  Resolves: rhbz#1548042