From 4ebeb1c6cf7b0745fd29fa8835a5fc3c50c60e90 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Aug 20 2019 06:39:39 +0000 Subject: F-31+: disable python2 binding, use python3 explicitly --- diff --git a/cairo-dock-plug-ins.spec b/cairo-dock-plug-ins.spec index cde5c3c..2b6101e 100644 --- a/cairo-dock-plug-ins.spec +++ b/cairo-dock-plug-ins.spec @@ -18,11 +18,13 @@ %endif %undefine _strict_symbol_defs_build +%if 0%{?fedora} < 31 %undefine __brp_mangle_shebangs +%endif Name: cairo-dock-plug-ins Version: %{mainver} -Release: 27%{?dist} +Release: 29%{?dist} Summary: Plug-ins files for Cairo-Dock License: GPLv3+ @@ -84,7 +86,9 @@ BuildRequires: libetpan-devel BuildRequires: lm_sensors-devel # Bindings +%if 0%{?fedora} < 31 BuildRequires: python2-devel +%endif BuildRequires: python3-devel BuildRequires: ruby-devel BuildRequires: vala @@ -94,7 +98,12 @@ Requires: %{name}-base%{?_isa} = %{version}-%{release} Requires: %{name}-dbus%{?_isa} = %{version}-%{release} # cairo-dock-launcher-API-daemon is written in python, # so for now make this depending on python +%if 0%{?fedora} < 31 Requires: cairo-dock-python2 = %{version}-%{release} +%else +Requires: cairo-dock-python3 = %{version}-%{release} +Obsoletes: cairo-dock-python2 < 3.4.1-28 +%endif # Require xdg-utils for logout by default Requires: xdg-utils @@ -162,6 +171,7 @@ Requires: %{name}-common = %{version}-%{release} This package contains unstable and experimental plug-ins not installed by default. +%if 0%{?fedora} < 31 %package -n cairo-dock-python2 Summary: Python2 binding for Cairo-Dock Requires: cairo-dock-core >= %{core_least_ver} @@ -174,6 +184,7 @@ BuildArch: noarch %description -n cairo-dock-python2 This package contains Python2 binding files for Cairo-Dock +%endif %package -n cairo-dock-python3 Summary: Python3 binding for Cairo-Dock @@ -261,6 +272,14 @@ sed -i.installdir \ -e '\@set.*RUBY_LIB_DIR.*CMAKE_INSTALL_PREFIX.*RUBY_LIB_DIR_INSTALL@d' \ CMakeLists.txt +%if 0%{?fedora} >= 31 +# Kill python2 explicitly +sed -i.py2 CMakeLists.txt -e 's|python2)|python2-nono)|' +# ... and explicitly use python3 +env LANG=C grep -rl /usr/bin/env . | \ + xargs sed -i -e 's|/usr/bin/env[ \t]*python$|/usr/bin/python3|' +%endif + %build rm -f CMakeCache.txt %cmake \ @@ -398,11 +417,13 @@ popd %{_libdir}/cairo-dock/*weblet* %{_datadir}/cairo-dock/plug-ins/*weblet* +%if 0%{?fedora} < 31 %files -n cairo-dock-python2 %{python2_sitelib}/CairoDock.py* %{python2_sitelib}/CDApplet.py* %{python2_sitelib}/CDBashApplet.py* %{python2_sitelib}/*.egg-info +%endif %files -n cairo-dock-python3 %{python3_sitelib}/CairoDock.py* @@ -424,6 +445,9 @@ popd %{_datadir}/cairo-dock/plug-ins/Dbus/CDApplet.h %changelog +* Tue Aug 20 2019 Mamoru TASAKA - 3.4.1-29 +- F-31+: disable python2 binding, use python3 explicitly + * Mon Aug 19 2019 Miro HronĨok - 3.4.1-27 - Rebuilt for Python 3.8