Blame python-entrypoints.spec

b66e5d1
%global srcname entrypoints
b66e5d1
%global sum Discover and load entry points from installed packages
b66e5d1
b66e5d1
Name:		python-%{srcname}
b66e5d1
Version:	0.2.2
b66e5d1
Release:	2%{?dist}
b66e5d1
Summary:	%{sum}
b66e5d1
b66e5d1
# license clarification issue opened upstream
b66e5d1
# https://github.com/takluyver/entrypoints/issues/10
b66e5d1
b66e5d1
License:	MIT
b66e5d1
b66e5d1
URL:		https://entrypoints.readthedocs.io/
b66e5d1
Source0:	https://github.com/takluyver/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz
b66e5d1
b66e5d1
BuildArch:	noarch
b66e5d1
BuildRequires:	python2-devel
b66e5d1
BuildRequires:	python3-devel
b66e5d1
BuildRequires:	python-pip
b66e5d1
BuildRequires:	python3-pip
b66e5d1
BuildRequires:	python3-flit
b66e5d1
BuildRequires:	python3-sphinx
b66e5d1
b66e5d1
%description
b66e5d1
Entry points are a way for Python packages to advertise objects with some
b66e5d1
common interface. The most common examples are console_scripts entry points,
b66e5d1
which define shell commands by identifying a Python function to run.
b66e5d1
b66e5d1
The entrypoints module contains functions to find and load entry points.
b66e5d1
b66e5d1
b66e5d1
%package -n python2-%{srcname}
b66e5d1
Summary:	%{sum}
b66e5d1
%{?python_provide:%python_provide python2-%{srcname}}
b66e5d1
b66e5d1
%description -n python2-%{srcname}
b66e5d1
Entry points are a way for Python packages to advertise objects with some
b66e5d1
common interface. The most common examples are console_scripts entry points,
b66e5d1
which define shell commands by identifying a Python function to run.
b66e5d1
b66e5d1
The entrypoints module contains functions to find and load entry points.
b66e5d1
b66e5d1
%package -n python2-%{srcname}-doc
b66e5d1
Summary:	Documentation for python-entrypoints
b66e5d1
b66e5d1
%description -n python2-%{srcname}-doc
b66e5d1
Documentation files for python-entrypoints
b66e5d1
b66e5d1
%package -n python3-%{srcname}
b66e5d1
Summary:	%{sum}
b66e5d1
%{?python_provide:%python_provide python3-%{srcname}}
b66e5d1
b66e5d1
%description -n python3-%{srcname}
b66e5d1
Entry points are a way for Python packages to advertise objects with some
b66e5d1
common interface. The most common examples are console_scripts entry points,
b66e5d1
which define shell commands by identifying a Python function to run.
b66e5d1
b66e5d1
The entrypoints module contains functions to find and load entry points.
b66e5d1
b66e5d1
%package -n python3-%{srcname}-doc
b66e5d1
Summary:	Documentation for python-entrypoints
b66e5d1
b66e5d1
%description -n python3-%{srcname}-doc
b66e5d1
Documentation files for python-entrypoints
b66e5d1
b66e5d1
%prep
b66e5d1
%autosetup -n %{srcname}-%{version}
b66e5d1
b66e5d1
# We don't need to verify PyPI classifiers, because the package is already
b66e5d1
# there. So just make specified classifiers "valid".
b66e5d1
mkdir -p .cache/flit
b66e5d1
%{__python3} -c "with open('flit.ini', 'rb') as inf:
b66e5d1
    with open('.cache/flit/classifiers.lst', 'wb') as outf:
b66e5d1
        enable_output = False
b66e5d1
        for line in inf:
b66e5d1
            if enable_output:
b66e5d1
                if b'=' in line:
b66e5d1
                    break
b66e5d1
                outf.write(line)
b66e5d1
            elif b'classifiers' in line:
b66e5d1
                outf.write(line.split(b'=')[1])
b66e5d1
                enable_output = True
b66e5d1
"
b66e5d1
b66e5d1
b66e5d1
%build
b66e5d1
XDG_CACHE_HOME=$PWD/.cache flit wheel
b66e5d1
b66e5d1
pushd doc
b66e5d1
make html PYTHON="%{__python3}" SPHINXBUILD=sphinx-build-%{python3_version}
b66e5d1
rm _build/html/.buildinfo
b66e5d1
popd
b66e5d1
b66e5d1
b66e5d1
%install
b66e5d1
pip2 install --root %{buildroot} --no-deps \
b66e5d1
	dist/%{srcname}-%{version}-py2.py3-none-any.whl
b66e5d1
pip3 install --root %{buildroot} --no-deps \
b66e5d1
	dist/%{srcname}-%{version}-py2.py3-none-any.whl
b66e5d1
b66e5d1
# Fedora doesn't use this yet.
b66e5d1
rm -r %{buildroot}%{python2_sitelib}/%{srcname}-%{version}.dist-info/
b66e5d1
rm -r %{buildroot}%{python3_sitelib}/%{srcname}-%{version}.dist-info/
b66e5d1
b66e5d1
b66e5d1
%files -n python2-%{srcname}
b66e5d1
%doc doc/_build/html
b66e5d1
%license LICENSE
b66e5d1
%{python2_sitelib}/*
b66e5d1
b66e5d1
%files -n python2-%{srcname}-doc
b66e5d1
%doc doc/_build/html
b66e5d1
%license LICENSE
b66e5d1
b66e5d1
%files -n python3-%{srcname}
b66e5d1
%doc doc/_build/html
b66e5d1
%license LICENSE
b66e5d1
%{python3_sitelib}/*
b66e5d1
b66e5d1
%files -n python3-%{srcname}-doc
b66e5d1
%doc doc/_build/html
b66e5d1
%license LICENSE
b66e5d1
b66e5d1
%changelog
b66e5d1
* Sun Oct 02 2016 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 0.2.2-2
b66e5d1
- Add -doc subpackages
b66e5d1
- Fix source url
b66e5d1
- Add license clarification issue URL for reference
b66e5d1
b66e5d1
* Sat Jul 2 2016 Elliott Sales de Andrade <quantum.analyst@gmail.com> 0.2.2-1
b66e5d1
- Initial RPM release