[omd-commits] OMD Git: omd: added check to python dependent packages that python has already been built

git version control git at mathias-kettner.de
Sun Jun 5 08:17:22 CEST 2016


Module:   omd
Branch:   master
Commit:   77f4fd2d0b5e88b88e1366b6a068d7d5130fd99b
URL:      http://omdistro.org/projects/omd/repository/revisions/77f4fd2d0b5e88b88e1366b6a068d7d5130fd99b

Author:   Lars Michelsen <lm at larsmichelsen.com>
Date:     Sun Jun  5 07:55:47 2016 +0200
Commiter: Lars Michelsen <lm at larsmichelsen.com>
Date:     Sun Jun  5 08:05:03 2016 +0200

added check to python dependent packages that python has already been built

---

 packages/mod_python/Makefile     |    9 +++++++--
 packages/python-modules/Makefile |   13 ++++++++++---
 packages/rrdtool/Makefile        |   10 ++++++++--
 3 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/packages/mod_python/Makefile b/packages/mod_python/Makefile
index 4c54aed..f5b842d 100644
--- a/packages/mod_python/Makefile
+++ b/packages/mod_python/Makefile
@@ -13,8 +13,7 @@ APACHE_VERSION      = $(shell $(APACHE_BIN) -v | awk '/version/ {print $$3}' | a
 APACHE_VERSION_MAIN = $(word 1, $(subst ., ,$(APACHE_VERSION)))
 APACHE_VERSION_SUB  = $(word 2, $(subst ., ,$(APACHE_VERSION)))
 
-
-build:
+build: check-python
 	tar xzf $(DIR).tar.gz
 	set -e ; for p in patches/*.dif ; do \
 	    echo "applying $$p..." ; \
@@ -31,6 +30,12 @@ build:
 	echo '#define OMD_VERSION "$(OMD_VERSION)"' > $(DIR)/src/omd_version.h
 	$(MAKE) -C $(DIR) all
 
+check-python:
+	@if [ ! -d ../python/tmp.python27 ]; then \
+	    echo "ERROR: You need to build the \"python\" package first" ; \
+	    exit 1 ; \
+	fi
+
 install:
 	# Use 'make install' of mod_python into a temporary file.
 	# mod_python does not honor --prefix, so we move the stuff over...
diff --git a/packages/python-modules/Makefile b/packages/python-modules/Makefile
index bf495fa..5ee5d30 100644
--- a/packages/python-modules/Makefile
+++ b/packages/python-modules/Makefile
@@ -16,10 +16,11 @@ MODULES += pysnmp-4.2.4.tar.gz
 MODULES += setuptools-22.0.5.tar.gz  # needed by rrdtool bindings
 MODULES += python-ldap-2.4.25.tar.gz # used for cmk ldap sync
 
-build:
+build: check-python
 	mkdir -p dest
 	cd dest && \
 	    for M in $(MODULES); do \
+		echo "Unpacking $$M..." ; \
 		if echo $$M | grep .tar.gz; then \
 		    tar xvzf ../src/$$M ; \
 		else \
@@ -31,21 +32,27 @@ build:
 	    echo "applying $$p..." ; \
 	    ( cd dest ; patch -p1 -b ) < $$p ; \
 	done
-	
 	set -e ; cd dest && \
 	    export PYTHONPATH=$$PYTHONPATH:$(DESTDIR)$(OMD_ROOT)/lib/python:$(shell realpath $$(pwd)/../python/tmp.python27/lib/python2.7) ; \
-	    env ; \
 	    for M in $$(ls); do \
+		echo "Building $$M..." ; \
 		cd $$M ; \
 	        $(PYTHON) setup.py build ; \
 	        cd .. ; \
 	    done
 
+check-python:
+	@if [ ! -d ../python/tmp.python27 ]; then \
+	    echo "ERROR: You need to build the \"python\" package first" ; \
+	    exit 1 ; \
+	fi
+
 install:
 	mkdir -p $(DESTDIR)$(OMD_ROOT)/lib/python
 	cd dest && \
 	    export PYTHONPATH=$$PYTHONPATH:$(DESTDIR)$(OMD_ROOT)/lib/python ; \
 	    for M in $$(ls); do \
+		echo "Installing $$M..." ; \
 		cd $$M ; \
 	        $(PYTHON) setup.py install --home=$(DESTDIR)$(OMD_ROOT) \
 	            --prefix='' \
diff --git a/packages/rrdtool/Makefile b/packages/rrdtool/Makefile
index 33d717e..81a8697 100644
--- a/packages/rrdtool/Makefile
+++ b/packages/rrdtool/Makefile
@@ -3,7 +3,7 @@ include ../../Makefile.omd
 NAME = rrdtool
 VERSION = 1.5.4
 DIR = $(NAME)-$(VERSION)
-PYTHON = $(shell pwd)/../python/tmp.python27/bin/python
+PYTHON = $(shell realpath $$(pwd)/../python/tmp.python27/bin/python)
 
 CONFIGUREOPTS = \
 	--prefix=$(OMD_ROOT) \
@@ -15,7 +15,7 @@ CONFIGUREOPTS = \
 	--disable-rrdcgi \
 	--with-perl-options="LIB=$(DESTDIR)$(OMD_ROOT)/lib/perl5/lib/perl5"
 
-build:
+build: check-python
 	if [ -d $(DIR) ]; then rm -rf $(DIR); fi
 	tar xzf $(DIR).tar.gz
 	for p in patches/*.diff ; do \
@@ -36,6 +36,12 @@ build:
 	# Python binding
 	cd $(DIR)/bindings/python && $(PYTHON) setup.py build
 
+check-python:
+	@if [ ! -d ../python/tmp.python27 ]; then \
+	    echo "ERROR: You need to build the \"python\" package first" ; \
+	    exit 1 ; \
+	fi
+
 install:
 	export PERL5LIB=$(P5TMPDIST)/dest/lib/perl5; \
 	$(MAKE) DESTDIR=$(DESTDIR) -C $(DIR) install



More information about the omd-commits mailing list