Blob Blame History Raw
%global srcname cssutils
%global sum CSS Cascading Style Sheets library for Python

Summary: %{sum}
Name: python-%{srcname}
Version: 1.0.1
Release: 4%{?dist}
License: LGPLv3+
Group: Development/Libraries
URL: http://cthedot.de/cssutils/
Source0: https://pypi.python.org/packages/source/c/cssutils/cssutils-1.0.1.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
# Required at runtime for the css* executables
Requires: python-setuptools
BuildRequires: python2-devel python3-devel
BuildRequires: python2-setuptools python3-setuptools
BuildRequires: dos2unix
BuildArch: noarch

%description
A Python package to parse and build CSS Cascading Style Sheets. DOM only, not
any rendering facilities.

%package doc
Summary: Documentation for the CSS Cascading Style Sheets library for Python
Group: Documentation

%description doc
This is the documentation for python-cssutils, a Python package to parse and
build CSS Cascading Style Sheets.

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

%description -n python2-%{srcname}
A Python package to parse and build CSS Cascading Style Sheets. DOM only, not
any rendering facilities.

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

%description -n python3-%{srcname}
A Python package to parse and build CSS Cascading Style Sheets. DOM only, not
any rendering facilities.

%prep
%setup -qc
# Convert all CRLF files, keeping original timestamps
find . -type f -exec dos2unix -k {} \;
cp -pr %{srcname}-%{version}/examples .
cp -pr %{srcname}-%{version}/README.txt .
cp -pr %{srcname}-%{version}/COPYING .
mv %{srcname}-%{version} python2
cp -a python2 python3
find python3 -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|'
find python2 -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python2}|'

%build
pushd python2
%py2_build
popd

pushd python3
%py3_build
popd

%install
pushd python2
%py2_install
popd

pushd python3
%py3_install
popd

# tests currently require python-pbr < 1.7.0 which we don't have
#check
#pushd python2
#%{__python2} setup.py test
#popd
#
#pushd python3
#%{__python3} setup.py test
#popd

%files -n python2-%{srcname}
%license COPYING
%doc README.txt
%{python2_sitelib}/*

%files -n python3-%{srcname}
%license COPYING
%doc README.txt
%{python3_sitelib}/*
%{_bindir}/csscapture
%{_bindir}/csscombine
%{_bindir}/cssparse

%files doc
%doc examples/

%changelog
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Sun Mar 06 2016 Kevin Fenzi <kevin@scrye.com> - 1.0.1-3
- Create python2 and python3 subpackages. Fixes bug #1310629

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sat Dec 26 2015 Kevin Fenzi <kevin@scrye.com> - 1.0.1-1
- Update to 1.0.1

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.9-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.9-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.9-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri May 04 2012 Kevin Fenzi <kevin@scrye.com> - 0.9.9-1
- Update to 0.9.9

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Jan 12 2011 Kevin Fenzi <kevin@tummy.com> - 0.9.7-1
- Update to final 0.9.7

* Sun Sep 12 2010 Kevin Fenzi <kevin@tummy.com> - 0.9.7-0.0.b3
- Update to 0.9.7 beta 3

* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.9.6-2
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Thu Feb 25 2010 Matthias Saou <http://freshrpms.net/> 0.9.6-1
- Update to 0.9.6.

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.9.5.1-4
- Rebuild for Python 2.6

* Fri Oct 10 2008 Matthias Saou <http://freshrpms.net/> 0.9.5.1-3
- Add missing python-setuptools BR, split off doc sub-package (mschwendt).

* Thu Oct  9 2008 Matthias Saou <http://freshrpms.net/> 0.9.5.1-2
- Update license, group, add python-setuptools requirement (mschwendt).

* Tue Aug 19 2008 Matthias Saou <http://freshrpms.net/> 0.9.5.1-1
- Update to 0.9.5.1.

* Fri Aug  8 2008 Matthias Saou <http://freshrpms.net/> 0.9.5-1
- Update to 0.9.5 final.

* Tue Jul 15 2008 Matthias Saou <http://freshrpms.net/> 0.9.5b2-0.2.rc2
- Convert CRLF end of lines.
- Patch out #!/... magic from python files meant to be included and not run.

* Tue Jul 15 2008 Matthias Saou <http://freshrpms.net/> 0.9.5b2-0.1.rc2
- Initial RPM release.