%global srcname editorconfig
%global sum A Python Based distribution of EditorConfig
Name: python-%{srcname}
Version: 0.12.0
Release: 4%{?dist}
Summary: %{sum}
License: Python and BSD
URL: http://editorconfig.org
Source0: https://github.com/editorconfig/editorconfig-core-py/archive/v0.12.0.tar.gz#/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python-sphinx
BuildRequires: python2-devel
BuildRequires: python3-devel
%description
EditorConfig Python Core provides the same functionality as the EditorConfig C
Core. EditorConfig Python core can be used as a an importable library.
%package -n python2-%{srcname}
Summary: %{sum}
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname}
EditorConfig Python Core provides the same functionality as the EditorConfig C
Core. EditorConfig Python core can be used as a an importable library.
%package -n python3-%{srcname}
Summary: %{sum}
%{?python_provide:%python_provide python3-%{srcname}}
%description -n python3-%{srcname}
EditorConfig Python Core provides the same functionality as the EditorConfig C
Core. EditorConfig Python core can be used as a an importable library.
%prep
%setup -qc
mv %{srcname}-core-py-%{version} python2
cp -a python2 python3
%build
pushd python2
%{py2_build}
cd docs
make text
popd
pushd python3
%{py3_build}
cd docs
make text
popd
%install
pushd python3
%{py3_install}
mkdir -p $RPM_BUILD_ROOT%{_defaultdocdir}/python3-%{srcname}
cp docs/_build/text/* $RPM_BUILD_ROOT%{_defaultdocdir}/python3-%{srcname}/
popd
pushd python2
%{py2_install}
mkdir -p $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}
cp docs/_build/text/* $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}/
popd
# EditorConfig C already places the official binary into /usr/bin.
rm $RPM_BUILD_ROOT%{_bindir}/%{srcname}
%files -n python2-%{srcname}
%doc python2/README.rst
%license python2/LICENSE.txt
%{python2_sitelib}/*
%{_defaultdocdir}/%{name}/*
%files -n python3-%{srcname}
%doc python3/README.rst
%license python3/LICENSE.txt
%{python3_sitelib}/*
%{_defaultdocdir}/python3-%{srcname}/*
%changelog
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.0-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Tue Feb 23 2016 Dennis Chen <barracks510@gmail.com> - 0.12.0-2
- Simplify python package.
* Thu Jan 21 2016 Dennis Chen <barracks510@gmail.com> - 0.12.0-2
- Remove misleading comments and macros.
* Sun Jan 17 2016 Dennis Chen <barracks510@gmail.com> - 0.12.0-1
- First Fedora Packaging.