Blob Blame History Raw
%global srcname plaster
%global sum Application configuration settings abstraction layer
%global desc plaster is a loader interface around multiple \
configuration file formats. It exists to define a common API for \
applications to use when they wish to load configuration. The library \
itself does not aim to handle anything except a basic API that \
applications may use to find and load configuration settings. Any \
specific constraints should be implemented in a loader which can be \
registered via an entry point.

Name: python-%{srcname}
Version: 0.5
Release: 1%{?dist}
BuildArch: noarch

License: MIT
Summary: %{sum}
Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz

BuildRequires: python2-devel
BuildRequires: python2-pytest
BuildRequires: python2-setuptools
BuildRequires: python2-sphinx
BuildRequires: python3-devel
BuildRequires: python3-pytest
BuildRequires: python3-setuptools


%package doc
Summary: Documentation for %{name}

%description doc
Contains the documentation for %{name}.

%package -n python2-%{srcname}
Summary: %{sum}

Requires: python2-setuptools

%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{srcname}

%package -n python3-%{srcname}
Summary: %{sum}

Requires: python3-setuptools

%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}

%autosetup -n %{srcname}-%{version}

# The plaster docs upstream only build if plaster is installed. Since we are building plaster docs
# from a source checkout, let's insert plaster into the path.
sed -i "s:import plaster:sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))\nimport plaster:" docs/

# Related to the above, upstream plaster gets the version for the docs by using pkg_resources which
# can only work if plaster is installed. Let's just substitute the version in since we know what it
# is.
sed -i "s/version = pkg_resources.*/version = '%{version}'/" docs/

# Upstream docs use pylons_sphinx_themes, which isn't packaged for Fedora yet. Let's just convert it
# to use the standard sphinx theme for now.
sed -i "/import pylons_sphinx_themes/d" docs/
sed -i "/html_theme_path =.*/d" docs/
sed -i "/html_theme =.*/d" docs/
sed -i "/.*github_url.*/d" docs/

make %{?_smp_mflags} -C docs html
rm -rf docs/_build/html/.buildinfo



PYTHONPATH="./src" py.test-2
PYTHONPATH="./src" py.test-3

%files doc
%license LICENSE.txt
%doc docs/_build/html
%doc CHANGES.rst
%doc README.rst

%files -n python2-%{srcname}
%license LICENSE.txt
%doc README.rst

%files -n python3-%{srcname}
%license LICENSE.txt
%doc README.rst

* Mon Jul 03 2017 Randy Barlow <> - 0.5-1
- Initial release.