From 6883bdfb10b5bd3d85cdc19b10600a93c6da6324 Mon Sep 17 00:00:00 2001 From: Raphael Groner Date: Mar 02 2016 09:15:11 +0000 Subject: v2.2.3 with python3 as default --- diff --git a/python-qutepart.spec b/python-qutepart.spec index 191dde0..5e39ac2 100644 --- a/python-qutepart.spec +++ b/python-qutepart.spec @@ -1,3 +1,6 @@ +%global commit0 fdc29c79eb6f3228897cfb713e047bf1d9a48198 +%global date0 20160229 + %global srcname qutepart %global sum Code editor widget %global desc_common \ @@ -13,28 +16,25 @@ Qutepart is a code editor widget for PyQt. Features: \ - Rectangular selection and copy-paste. \ - Linter marks support. - +# python3 is default in Fedoras, python2 still for EPEL %if 0%{?fedora} %bcond_without python3 +%bcond_with python2 +%else +%bcond_with python3 +%bcond_without python2 %endif -%global py3_commit0 b4368fd3c0cee1c885fac9382608e1283801064b -%global py3_date 20151124 - - Name: python-%{srcname} Version: 2.2.3 -Release: 1%{?dist} +Release: 1.%{date0}git%(c=%{commit0}; echo ${c:0:7})%{?dist} Summary: %{sum} License: LGPLv2+ URL: https://github.com/hlamer/%{srcname} -Source0: %{url}/archive/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz -# experimental python3 from upstream py3 branch as a subpackage -# https://github.com/hlamer/qutepart/issues/30 -# important: before downloading a new diff because new py3_commit0, delete the old file! -Patch0: %{url}/compare/v%{version}...%{py3_commit0}.patch#/%{srcname}-py3-%{py3_commit0}.patch +Source0: %{url}/archive/%{commit0}.tar.gz#/%{srcname}-%{commit0}.tar.gz +#v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz BuildRequires: pcre-devel Requires: pcre @@ -70,42 +70,53 @@ Summary: %{sum} %package -n python3-%{srcname} -Release: 6.%{py3_date}git%(c=%{py3_commit0}; echo ${c:0:1%{?dist}}) Summary: %{sum} %{?python_provide:%python_provide python3-%{srcname}} +%if 0%{?fedora} >= 24 +Obsoletes: python2-%{srcname} +%endif %description -n python3-%{srcname} %{desc_common} %prep -%setup -q -n %{srcname}-%{version} +%setup -q -n %{srcname}-%{commit0} %if 0%{with python3} -mkdir python3 -find -mindepth 1 -maxdepth 1 -not -name python3 |xargs cp -pr -tpython3 -pushd python3 -%patch0 -p1 +mkdir py3 +find -mindepth 1 -maxdepth 1 -not -name py3 |xargs cp -pr -tpy3 +pushd py3 + # FIXME dirty hacks to prevent gcc errors cause of c-api change in python3 -sed -i /ob_type/d %{srcname}/syntax/cParser.c -sed -i -r 's,PyString_AsString\((.*)\).*;,\1;,' %{srcname}/syntax/cParser.c +#sed -i /ob_type/d %{srcname}/syntax/cParser.c +#sed -i -r 's,PyString_AsString\((.*)\).*;,\1;,' %{srcname}/syntax/cParser.c # disable PyQt5 mocking for sphinx sed -i -r 's,(MOCK_MODULES = \[).*\],\1],' doc/source/conf.py + # disable sloppy tests -rm tests/test_bookmarks.py tests/test_bracket_hlighter.py tests/test_completion.py tests/test_edit.py +pushd tests +#rm test_bookmarks.py +#rm test_bracket_hlighter.py +#rm test_completion.py +#rm test_edit.py popd + +popd # py3 %endif %build +%if %{with python2} # we need CFLAGS for internal gcc call, py2_build sets them %py2_build pushd doc sphinx-build source html popd +%endif %if 0%{with python3} -pushd python3 +pushd py3 %py3_build pushd doc sphinx-build-3 source html @@ -120,11 +131,14 @@ find -name html -exec rm -r '{}'/.buildinfo '{}'/.doctrees \; %install +%if %{with python2} %py2_install +%endif %if 0%{with python3} -pushd python3 +pushd py3 %py3_install +popd %endif @@ -132,37 +146,45 @@ pushd python3 # ignore those really weird "fatal warnings" from dbus to not confuse tests export DBUS_FATAL_WARNINGS=0 -# python2 +%if %{with python2} pushd tests # do some fake X xvfb-run %{__python2} run_all.py popd +%endif %if 0%{with python3} -pushd python3/tests +pushd py3/tests xvfb-run -a %{__python3} run_all.py %endif +%if %{with python2} %files -n python2-%{srcname} %license LICENSE %doc README.md ChangeLog todo.txt %doc doc/html/ %{python2_sitearch}/%{srcname}* +%endif %if 0%{with python3} %files -n python3-%{srcname} %license LICENSE %doc README.md ChangeLog todo.txt -%doc python3/doc/html/ +%doc py3/doc/html/ %{python3_sitearch}/%{srcname}* %endif %changelog +* Wed Mar 02 2016 Raphael Groner - 2.2.3-1.20160229gitfdc29c7 +- use upstream master as post-release + * Sun Feb 28 2016 Raphael Groner - 2.2.3-1 - new version +- use main version for python3, get rid of py3 patches +- obsolete python2 package in Fedora 24+ * Sat Feb 27 2016 Raphael Groner - 2.2.2-6 - rebuild to validate dependencies (bug with librsvg-2.so.2)