4085f30
%global srcname plaster
4085f30
%global sum Application configuration settings abstraction layer
4085f30
%global desc plaster is a loader interface around multiple \
4085f30
configuration file formats. It exists to define a common API for \
4085f30
applications to use when they wish to load configuration. The library \
4085f30
itself does not aim to handle anything except a basic API that \
4085f30
applications may use to find and load configuration settings. Any \
4085f30
specific constraints should be implemented in a loader which can be \
4085f30
registered via an entry point.
4085f30
4085f30
4085f30
Name: python-%{srcname}
4085f30
Version: 0.5
4085f30
Release: 1%{?dist}
4085f30
BuildArch: noarch
4085f30
4085f30
License: MIT
4085f30
Summary: %{sum}
4085f30
URL:     https://github.com/Pylons/%{srcname}
4085f30
Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
4085f30
4085f30
BuildRequires: python2-devel
4085f30
BuildRequires: python2-pytest
51ece74
BuildRequires: python2-setuptools
4085f30
BuildRequires: python2-sphinx
4085f30
BuildRequires: python3-devel
4085f30
BuildRequires: python3-pytest
51ece74
BuildRequires: python3-setuptools
4085f30
4085f30
4085f30
%description
4085f30
%{desc}
4085f30
4085f30
4085f30
%package doc
4085f30
Summary: Documentation for %{name}
4085f30
4085f30
4085f30
%description doc
4085f30
Contains the documentation for %{name}.
4085f30
4085f30
4085f30
%package -n python2-%{srcname}
4085f30
Summary: %{sum}
4085f30
4085f30
Requires: python2-setuptools
4085f30
4085f30
%{?python_provide:%python_provide python2-%{srcname}}
4085f30
4085f30
4085f30
%description -n python2-%{srcname}
4085f30
%{desc}
4085f30
4085f30
4085f30
%package -n python3-%{srcname}
4085f30
Summary: %{sum}
4085f30
4085f30
Requires: python3-setuptools
4085f30
4085f30
%{?python_provide:%python_provide python3-%{srcname}}
4085f30
4085f30
4085f30
%description -n python3-%{srcname}
4085f30
%{desc}
4085f30
4085f30
4085f30
%prep
4085f30
%autosetup -n %{srcname}-%{version}
4085f30
51ece74
# The plaster docs upstream only build if plaster is installed. Since we are building plaster docs
51ece74
# from a source checkout, let's insert plaster into the path.
4085f30
sed -i "s:import plaster:sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))\nimport plaster:" docs/conf.py
51ece74
51ece74
# Related to the above, upstream plaster gets the version for the docs by using pkg_resources which
51ece74
# can only work if plaster is installed. Let's just substitute the version in since we know what it
51ece74
# is.
51ece74
sed -i "s/version = pkg_resources.*/version = '%{version}'/" docs/conf.py
51ece74
51ece74
# Upstream docs use pylons_sphinx_themes, which isn't packaged for Fedora yet. Let's just convert it
51ece74
# to use the standard sphinx theme for now.
4085f30
sed -i "/import pylons_sphinx_themes/d" docs/conf.py
4085f30
sed -i "/html_theme_path =.*/d" docs/conf.py
4085f30
sed -i "/html_theme =.*/d" docs/conf.py
4085f30
sed -i "/.*github_url.*/d" docs/conf.py
4085f30
4085f30
4085f30
%build
4085f30
make %{?_smp_mflags} -C docs html
4085f30
rm -rf docs/_build/html/.buildinfo
4085f30
4085f30
%py2_build
4085f30
%py3_build
4085f30
4085f30
4085f30
%install
4085f30
%py2_install
4085f30
%py3_install
4085f30
4085f30
4085f30
%check
4085f30
PYTHONPATH="./src" py.test-2
4085f30
PYTHONPATH="./src" py.test-3
4085f30
4085f30
4085f30
%files doc
4085f30
%license LICENSE.txt
4085f30
%doc docs/_build/html
4085f30
%doc CHANGES.rst
4085f30
%doc README.rst
4085f30
4085f30
4085f30
%files -n python2-%{srcname}
4085f30
%license LICENSE.txt
4085f30
%doc README.rst
4085f30
%{python2_sitelib}/%{srcname}
4085f30
%{python2_sitelib}/*.egg-info
4085f30
4085f30
4085f30
%files -n python3-%{srcname}
4085f30
%license LICENSE.txt
4085f30
%doc README.rst
4085f30
%{python3_sitelib}/%{srcname}
4085f30
%{python3_sitelib}/*.egg-info
4085f30
4085f30
4085f30
%changelog
4085f30
* Mon Jul 03 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 0.5-1
4085f30
- Initial release.