This one actually took me some time to track it down (details are in a
patch description). To check the result, simply build freeipa on Fedora
17 with "make rpms", install rpms on the machine and check Requires of
freeipa-admintools package:

$ rpm -qR freeipa-admintools

Before the patch, there was a requirement for "/bin/python" which
effectively blocked an update of python package until freeipa packages
were removed.

With this patch, there should be a correct requirement for
"/usr/bin/python" and python updates will work again - yay.

Our newest freeipa package on F-17 (2.2.0-1) is not affected, koji F-17
build root may have a different $PATH which translates "python" to
"/usr/bin/python" and not "/bin/python".

Martin
>From c9219c4bdcc71803811b75ae7c024b0ce4ab4f9b Mon Sep 17 00:00:00 2001
From: Martin Kosek <mko...@redhat.com>
Date: Fri, 4 May 2012 17:18:46 +0200
Subject: [PATCH] Fix python Requires in Fedora 17 build

When python's distutils build process prepares python scripts, it use
current Python interpreter in an updated shebang for python scripts.
Since Makefile did not use absolute path to python interpreter, it
may be translated to "/bin/python" in Fedora 17 which is then taken
by rpmbuild as freeipa-admintools dependency. This can break of F-17
python package which provides just "/usr/bin/python"

This patch updates Makefile to use a correct absolute path to python
interpreter which is then filled to freeipa scripts shebang and rpm
Requires list. The value is taken from RPM __python macro so that
we do not hardcode it.

https://fedorahosted.org/freeipa/ticket/2727
---
 Makefile |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 102559115cbffcf7f0e6e82fb1c004b5d96d2548..32a46cacb24605b23957d8471e577aadcbfe32f1 100644
--- a/Makefile
+++ b/Makefile
@@ -44,6 +44,8 @@ ifneq ($(DEVELOPER_MODE),0)
 LINT_OPTIONS=--no-fail
 endif
 
+PYTHON ?= $(shell rpm -E %__python)
+
 all: bootstrap-autogen server
 	@for subdir in $(SUBDIRS); do \
 		(cd $$subdir && $(MAKE) $@) || exit 1; \
@@ -74,9 +76,9 @@ client-install: client client-dirs
 	done
 	cd install/po && $(MAKE) install || exit 1;
 	if [ "$(DESTDIR)" = "" ]; then \
-		python setup-client.py install; \
+		$(PYTHON) setup-client.py install; \
 	else \
-		python setup-client.py install --root $(DESTDIR); \
+		$(PYTHON) setup-client.py install --root $(DESTDIR); \
 	fi
 
 client-dirs:
@@ -132,13 +134,13 @@ version-update: release-update
 	fi
 
 server: version-update
-	python setup.py build
+	$(PYTHON) setup.py build
 
 server-install: server
 	if [ "$(DESTDIR)" = "" ]; then \
-		python setup.py install; \
+		$(PYTHON) setup.py install; \
 	else \
-		python setup.py install --root $(DESTDIR); \
+		$(PYTHON) setup.py install --root $(DESTDIR); \
 	fi
 
 archive:
-- 
1.7.7.6

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to