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".

>From c9219c4bdcc71803811b75ae7c024b0ce4ab4f9b Mon Sep 17 00:00:00 2001
From: Martin Kosek <>
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.
 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)
+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
 	cd install/po && $(MAKE) install || exit 1;
 	if [ "$(DESTDIR)" = "" ]; then \
-		python install; \
+		$(PYTHON) install; \
 	else \
-		python install --root $(DESTDIR); \
+		$(PYTHON) install --root $(DESTDIR); \
@@ -132,13 +134,13 @@ version-update: release-update
 server: version-update
-	python build
+	$(PYTHON) build
 server-install: server
 	if [ "$(DESTDIR)" = "" ]; then \
-		python install; \
+		$(PYTHON) install; \
 	else \
-		python install --root $(DESTDIR); \
+		$(PYTHON) install --root $(DESTDIR); \

Freeipa-devel mailing list

Reply via email to