diff --git a/python-scss.spec b/python-scss.spec index 5b2b60a..9859f39 100644 --- a/python-scss.spec +++ b/python-scss.spec @@ -12,7 +12,7 @@ Name: python-scss Version: 1.3.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Scss compiler for Python License: MIT @@ -58,13 +58,22 @@ A Scss compiler for Python %endif %prep -%setup -q -n %{pypi_name}-%{version} +%autosetup -n %{pypi_name}-%{version} +# Change shebang according to Python version +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python3}=' %{py3dir}/%{pname}/tool.py +%endif +sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python2}=' %{pname}/tool.py %build %py2_build %if 0%{?with_python3} +pushd %{py3dir} %py3_build +popd %endif # build documentationx cd docs @@ -81,6 +90,7 @@ mv %{buildroot}%{_bindir}/less2scss %{buildroot}%{_bindir}/less2scss-%{python2_v ln -s ./less2scss-%{python2_version} %{buildroot}%{_bindir}/less2scss-2 %if 0%{?with_python3} +pushd %{py3dir} %py3_install chmod +x %{buildroot}%{python3_sitearch}/scss/tool.py for bin in pyscss less2scss ; do @@ -88,11 +98,13 @@ for bin in pyscss less2scss ; do ln -s ./$bin-%{python3_version} %{buildroot}%{_bindir}/$bin-3 ln -s ./$bin-%{python3_version} %{buildroot}%{_bindir}/$bin done +popd %endif # Manage EL7 case %if !0%{?with_python3} -ln -s ./pyscss-%{python3_version} %{buildroot}%{_bindir}/pyscss +ln -s ./pyscss-%{python2_version} %{buildroot}%{_bindir}/pyscss +ln -s ./less2scss-%{python2_version} %{buildroot}%{_bindir}/less2scss %endif # install man page @@ -110,6 +122,7 @@ cp -ar docs/_build/man/pyscss.1 %{buildroot}%{_mandir}/man1/pyscss.1 %{_bindir}/less2scss-%{python2_version} %if !0%{?with_python3} %{_bindir}/pyscss +%{_bindir}/less2scss %{_mandir}/man1/pyscss.1.gz %endif @@ -129,6 +142,9 @@ cp -ar docs/_build/man/pyscss.1 %{buildroot}%{_mandir}/man1/pyscss.1 %changelog +* Mon Mar 19 2018 Jan Beran - 1.3.5-1 - update to 1.3.5 - add gcc to buildrequires