Blob Blame History Raw
# Filter the _speedups.so provides that otherwise comes into the provides
%global __provides_exclude_from ^(%{python_sitearch}/.*\\.so)$

%global pypi_name pyScss
%global sname pyscss
# the package name is still python-scss
%global pname scss

%if 0%{?fedora}
%global with_python3 1
%endif

Name:           python-scss
Version:        1.3.4
Release:        10%{?dist}
Summary:        A Scss compiler for Python

License:        MIT
URL:            https://github.com/Kronuz/pyScss
#Source0:        https://github.com/Kronuz/pyScss/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
# get source file with spectool -g python-scss.spec
Source0:        https://github.com/Kronuz/pyScss/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz


%description
A Scss compiler for Python

%package -n python2-%{pname}
Summary:        A Scss compiler for Python
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  python-six
BuildRequires:  python-sphinx
BuildRequires:  pcre-devel
Requires:       python-six
Requires:       python-setuptools
Requires:       python-pathlib

%{?python_provide:%python_provide python2-%{pname}}

%description -n python2-%{pname}
A Scss compiler for Python

%if 0%{?with_python3}
%package -n python3-%{pname}
Summary:        A Scss compiler for Python
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-six
Requires:       python3-six
Requires:       python3-setuptools

%{?python_provide:%python_provide python3-%{pname}}

%description -n python3-%{pname}
A Scss compiler for Python
%endif

%prep
%setup -q -n %{pypi_name}-%{version}


%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
# build documentationx
cd docs
make SPHINXBUILD=sphinx-build man


%install
%py2_install
chmod +x %{buildroot}%{python2_sitearch}/scss/tool.py
mv %{buildroot}%{_bindir}/pyscss %{buildroot}%{_bindir}/pyscss-%{python2_version}
ln -s ./pyscss-%{python2_version} %{buildroot}%{_bindir}/pyscss-2

%if 0%{?with_python3}
%py3_install
chmod +x %{buildroot}%{python3_sitearch}/scss/tool.py
mv %{buildroot}%{_bindir}/pyscss %{buildroot}%{_bindir}/pyscss-%{python3_version}
ln -s ./pyscss-%{python3_version} %{buildroot}%{_bindir}/pyscss-3
ln -s ./pyscss-%{python3_version} %{buildroot}%{_bindir}/pyscss
%endif

# Manage EL7 case
%if !0%{?with_python3}
ln -s ./pyscss-%{python3_version} %{buildroot}%{_bindir}/pyscss
%endif

# install man page
mkdir -p %{buildroot}%{_mandir}/man1/
cp -ar docs/_build/man/pyscss.1 %{buildroot}%{_mandir}/man1/pyscss.1


%files -n python2-%{pname}
%doc DESCRIPTION README.rst
%license LICENSE
%{python2_sitearch}/*
%{_bindir}/pyscss-2
%{_bindir}/pyscss-%{python2_version}
%if !0%{?with_python3}
%{_bindir}/pyscss
%{_mandir}/man1/pyscss.1.gz
%endif

%if 0%{?with_python3}
%files -n python3-%{pname}
%doc DESCRIPTION README.rst
%license LICENSE
%{python3_sitearch}/*
%{_bindir}/pyscss
%{_bindir}/pyscss-3
%{_bindir}/pyscss-%{python3_version}
%{_mandir}/man1/pyscss.1.gz
%endif


%changelog
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.4-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

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

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

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.3.4-7
- Rebuild for Python 3.6

* Fri Nov 25 2016 Matthias Runge <mrunge@redhat.com> - 1.3.4-6
- add requires: python-pathlib (rhbz#1299228)

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

* Fri Jul  1 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 1.3.4-4
- Drop incorrect provides

* Fri Jul 01 2016 Matthias Runge <mrunge@redhat.com> - 1.3.4-3
- fix provides/package names

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

* Mon Jul 13 2015 Matthias Runge <mrunge@redhat.com> - 1.3.4-1
- update to 1.3.4, requirement for fix FTBFS for python-django-pyscss
  (rhbz#1239832)

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

* Tue Oct 07 2014 Matthias Runge <mrunge@redhat.com> - 1.2.1-1
- update to 1.2.1 (rhbz#1148966)

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

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

* Tue Feb 25 2014 Patrick Uiterwijk <puiterwijk@redhat.com> - 1.2.0-3
- Require python-setuptools as thats needed for the binary to work

* Wed Nov 06 2013 Patrick Uiterwijk <puiterwijk@gmail.com> - 1.2.0-2
- Buildrequire set to python2-devel
- Added buildrequire pcre-devel
- Changed URL to Source
- Added -a to cp to retain timestamp

* Thu Oct 17 2013 Patrick Uiterwijk <puiterwijk@gmail.com> - 1.2.0-1
- Initial packaging