From 67d77965ba760d695e1bac04500d04ba561f6c5e Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Jul 22 2018 14:51:17 +0000 Subject: Backport patch from upstream to fix build for F29+ (rhbz#1603807) --- diff --git a/0001-Enforce-usage-of-versioned-Python-interpreter-in-Mak.patch b/0001-Enforce-usage-of-versioned-Python-interpreter-in-Mak.patch new file mode 100644 index 0000000..f8e26c2 --- /dev/null +++ b/0001-Enforce-usage-of-versioned-Python-interpreter-in-Mak.patch @@ -0,0 +1,107 @@ +From d0d016304478b467006ea6ddb61e3885f95db70e Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Sun, 22 Jul 2018 10:21:33 -0400 +Subject: [PATCH] Enforce usage of versioned Python interpreter in Makefiles + +The Makefiles for dnfdaemon previously assumed that '/usr/bin/python' +pointed to Python 2. However, as support for Python 2 winds down +over the next two years, this is not guaranteed to remain true. + +Consequently, Fedora has split out '/usr/bin/python' from the 'python2' +package in order to enforce that packages do not use '/usr/bin/python' +by default. Since the assumption was wrong in the Makefiles to begin +with, it is better to go ahead and fix it in the Makefiles. + +Reference: https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package +--- + Makefile | 4 ++-- + python/dnfdaemon/Makefile | 14 +++++++------- + python/dnfdaemon/client/Makefile | 14 +++++++------- + 3 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/Makefile b/Makefile +index 12d1c82..bb96c2b 100644 +--- a/Makefile ++++ b/Makefile +@@ -87,10 +87,10 @@ run-tests-unit: FORCE + @PYTHONPATH=$(TESTLIBS) nosetests-$(PYVER3) -v -s test/test_common.py + + instdeps: +- sudo dnf install python-nose python3-gobject pygobject3 python3-nose ++ sudo dnf install python2-nose python3-gobject pygobject3 python3-nose + + get-builddeps: +- sudo dnf install perl-TimeDate gettext intltool rpmdevtools python-devel python3-devel python3-nose tito ++ sudo dnf install perl-TimeDate gettext intltool rpmdevtools python2-devel python3-devel python3-nose tito + + + build-setup: +diff --git a/python/dnfdaemon/Makefile b/python/dnfdaemon/Makefile +index 2e6b51b..15b22c7 100644 +--- a/python/dnfdaemon/Makefile ++++ b/python/dnfdaemon/Makefile +@@ -1,11 +1,11 @@ +-PYTHON=python ++PYTHON2=python2 + PYTHON3=python3 + PACKAGE = dnfdaemon + PYFILES = $(wildcard *.py) +-PYVER := $(shell $(PYTHON) -c 'import sys; print("%.3s" %(sys.version))') +-PYSYSDIR := $(shell $(PYTHON) -c 'import sys; print(sys.prefix)') +-PYLIBDIR = $(PYSYSDIR)/lib/python$(PYVER) +-PKGDIR = $(PYLIBDIR)/site-packages/$(PACKAGE) ++PYVER2 := $(shell $(PYTHON2) -c 'import sys; print("%.3s" %(sys.version))') ++PYSYSDIR2 := $(shell $(PYTHON2) -c 'import sys; print(sys.prefix)') ++PYLIBDIR2 = $(PYSYSDIR2)/lib/python$(PYVER2) ++PKGDIR2 = $(PYLIBDIR2)/site-packages/$(PACKAGE) + PYVER3 := $(shell $(PYTHON3) -c 'import sys; print("%.3s" %(sys.version))') + PYSYSDIR3 := $(shell $(PYTHON3) -c 'import sys; print(sys.prefix)') + PYLIBDIR3 = $(PYSYSDIR3)/lib/python$(PYVER3) +@@ -19,9 +19,9 @@ clean: + + + install: +- mkdir -p $(DESTDIR)/$(PKGDIR) ++ mkdir -p $(DESTDIR)/$(PKGDIR2) + mkdir -p $(DESTDIR)/$(PKGDIR3) + for p in $(PYFILES) ; do \ +- install -m 644 $$p $(DESTDIR)/$(PKGDIR)/$$p; \ ++ install -m 644 $$p $(DESTDIR)/$(PKGDIR2)/$$p; \ + install -m 644 $$p $(DESTDIR)/$(PKGDIR3)/$$p; \ + done +diff --git a/python/dnfdaemon/client/Makefile b/python/dnfdaemon/client/Makefile +index 5b034d2..7f01919 100644 +--- a/python/dnfdaemon/client/Makefile ++++ b/python/dnfdaemon/client/Makefile +@@ -1,11 +1,11 @@ +-PYTHON=python ++PYTHON2=python2 + PYTHON3=python3 + PACKAGE = dnfdaemon/client + PYFILES = $(wildcard *.py) +-PYVER := $(shell $(PYTHON) -c 'import sys; print("%.3s" %(sys.version))') +-PYSYSDIR := $(shell $(PYTHON) -c 'import sys; print(sys.prefix)') +-PYLIBDIR = $(PYSYSDIR)/lib/python$(PYVER) +-PKGDIR = $(PYLIBDIR)/site-packages/$(PACKAGE) ++PYVER2 := $(shell $(PYTHON2) -c 'import sys; print("%.3s" %(sys.version))') ++PYSYSDIR2 := $(shell $(PYTHON2) -c 'import sys; print(sys.prefix)') ++PYLIBDIR2 = $(PYSYSDIR2)/lib/python$(PYVER2) ++PKGDIR2 = $(PYLIBDIR2)/site-packages/$(PACKAGE) + PYVER3 := $(shell $(PYTHON3) -c 'import sys; print("%.3s" %(sys.version))') + PYSYSDIR3 := $(shell $(PYTHON3) -c 'import sys; print(sys.prefix)') + PYLIBDIR3 = $(PYSYSDIR3)/lib/python$(PYVER3) +@@ -19,9 +19,9 @@ clean: + + + install: +- mkdir -p $(DESTDIR)/$(PKGDIR) ++ mkdir -p $(DESTDIR)/$(PKGDIR2) + mkdir -p $(DESTDIR)/$(PKGDIR3) + for p in $(PYFILES) ; do \ +- install -m 644 $$p $(DESTDIR)/$(PKGDIR)/$$p; \ ++ install -m 644 $$p $(DESTDIR)/$(PKGDIR2)/$$p; \ + install -m 644 $$p $(DESTDIR)/$(PKGDIR3)/$$p; \ + done +-- +2.17.1 + diff --git a/dnfdaemon.spec b/dnfdaemon.spec index 18499f1..763dba5 100644 --- a/dnfdaemon.spec +++ b/dnfdaemon.spec @@ -3,13 +3,16 @@ Name: dnfdaemon Version: 0.3.19 -Release: 2%{?dist} +Release: 3%{?dist} Summary: DBus daemon for dnf package actions License: GPLv2+ URL: https://github.com/manatools/%{name} Source0: %{url}/releases/download/%{name}-%{version}/%{name}-%{version}.tar.xz +# Backports from master +Patch0001: 0001-Enforce-usage-of-versioned-Python-interpreter-in-Mak.patch + BuildArch: noarch BuildRequires: python3-devel @@ -71,7 +74,7 @@ Python 3 api for communicating with the dnf-daemon DBus service %prep -%autosetup -p 1 +%autosetup -p1 %build @@ -126,7 +129,7 @@ fi %files -n python2-%{name} -%{python_sitelib}/%{name} +%{python2_sitelib}/%{name} %files -n python3-%{name} @@ -134,6 +137,9 @@ fi %changelog +* Sun Jul 22 2018 Neal Gompa - 0.3.19-3 +- Backport patch from upstream to fix build for F29+ (rhbz#1603807) + * Thu Jul 12 2018 Fedora Release Engineering - 0.3.19-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild