Blob Blame History Raw
Name:           python-css-parser
Version:        1.0.4
Release:        2%{?dist}
Summary:        Parse and build Cascading Style Sheets

License:        LGPLv3
URL:            https://github.com/ebook-utils/css-parser
Source0:        https://github.com/ebook-utils/css-parser/archive/v%{version}/%{name}-%{version}.tar.gz

# https://github.com/ebook-utils/css-parser/pull/5
Patch1:         0001-Handle-test-failure-when-no-network-connection.patch
Patch2:         0002-Merge-branch-catch-urlerror-of-https-github.com-kesz.patch

BuildArch:      noarch
BuildRequires:  python3-devel
# for tests
BuildRequires:  python3-chardet

%global _description %{expand:
A fork of the cssutils project based on version 1.0.2. This fork includes
general bug fixes and extensions specific to editing and working with ebooks.}

%description %_description

%package -n python2-css-parser
Summary:        %{summary}
BuildRequires:  python2-devel
# for tests
BuildRequires:  python2-chardet
%{?python_provide:%python_provide python2-css-parser}

%description -n python2-css-parser %_description

%package -n python3-css-parser
Summary:        %{summary}
%{?python_provide:%python_provide python3-css-parser}

%description -n python3-css-parser %_description

%prep
%autosetup -n css-parser-%{version} -p1

%build
sed -r -i '1{/.usr.bin.env python/d;}' src/css_parser/*py src/css_parser/*/*py

%py2_build
%py3_build

%install
%py2_install
%py3_install

%check
%{__python2} run_tests.py
%{__python3} run_tests.py

%files -n python2-css-parser
%{python2_sitelib}/css_parser/
%{python2_sitelib}/css_parser-%{version}-py%{python2_version}.egg-info/
%doc README.md
%license COPYING COPYING.LESSER

%files -n python3-css-parser
%{python3_sitelib}/css_parser/
%{python3_sitelib}/css_parser-%{version}-py%{python3_version}.egg-info/
%doc README.md
%license COPYING COPYING.LESSER

%changelog
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Tue Jun 11 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.0.4-1
- Initial packaging