Blob Blame History Raw
%global srcname editorconfig
%global sum A Python Based distribution of EditorConfig

Name:           python-%{srcname}
Version:        0.12.0
Release:        9%{?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:  python2-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
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Jan 16 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.12.0-8
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.12.0-5
- Rebuild for Python 3.6

* 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.