Module: check_mk
Branch: master
Commit: 52be1ca13168ad0d773ef591608740244245b981
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=52be1ca13168ad…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Jan 16 15:24:06 2018 +0100
Cleaned up Python modules build a bit.
Change-Id: I9caf8beefc187bc8abeda16905bceeac1d1476b2
---
omd/Makefile.omd | 9 +++++++++
omd/packages/python-modules/Makefile | 11 +++++------
omd/packages/rrdtool/Makefile | 8 ++------
3 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/omd/Makefile.omd b/omd/Makefile.omd
index 14cd4d7..b6d5fa1 100644
--- a/omd/Makefile.omd
+++ b/omd/Makefile.omd
@@ -67,3 +67,12 @@ check-freetds:
echo "ERROR: You need to build the \"freetds\" package first" ;
\
exit 1 ; \
fi
+
+PACKAGE_PYTHON_MODULES_DESTDIR := $(REPO_PATH)/omd/packages/python-modules/destdir
+PACKAGE_PYTHON_MODULES_PYTHONPATH := $(PACKAGE_PYTHON_MODULES_DESTDIR)/lib
+
+check-python-modules:
+ @if [ ! -d $(PACKAGE_PYTHON_MODULES_DESTDIR) ]; then \
+ echo "ERROR: You need to build the \"python-modules\" package
first" ; \
+ exit 1 ; \
+ fi
diff --git a/omd/packages/python-modules/Makefile b/omd/packages/python-modules/Makefile
index 98718d1..d1e74f7 100644
--- a/omd/packages/python-modules/Makefile
+++ b/omd/packages/python-modules/Makefile
@@ -4,7 +4,6 @@ NAME = python-modules
SHELL = /bin/bash
VERSION = $(OMD_VERSION)
DISTRO = $(shell ../../distro)
-TMP_INSTALL_PATH = $(shell pwd)/tmp.python
PATCHES := $(wildcard patches/*.dif)
@@ -118,8 +117,8 @@ MODULES+=paramiko-2.1.2.tar.gz
build: check-python check-freetds unpack
set -e ; cd dest && \
- mkdir -p $(TMP_INSTALL_PATH)/lib || true; \
- export PYTHONPATH="$$PYTHONPATH:$(TMP_INSTALL_PATH)/lib" ; \
+ mkdir -p $(PACKAGE_PYTHON_MODULES_PYTHONPATH) || true; \
+ export PYTHONPATH="$$PYTHONPATH:$(PACKAGE_PYTHON_MODULES_PYTHONPATH)" ; \
export PYTHONPATH="$$PYTHONPATH:$(PACKAGE_PYTHON_PYTHONPATH)" ; \
export CPATH="$(PACKAGE_FREETDS_DESTDIR)/include" ; \
export LDFLAGS="$(PACKAGE_PYTHON_LDFLAGS) $(PACKAGE_FREETDS_LDFLAGS)" ; \
@@ -134,7 +133,7 @@ build: check-python check-freetds unpack
cd $$PKG ; \
$(PACKAGE_PYTHON_EXECUTABLE) setup.py build ; \
$(PACKAGE_PYTHON_EXECUTABLE) setup.py install \
- --root=$(TMP_INSTALL_PATH) \
+ --root=$(PACKAGE_PYTHON_MODULES_DESTDIR) \
--prefix='' \
--install-platlib=/lib \
--install-purelib=/lib ; \
@@ -160,7 +159,7 @@ unpack:
install:
mkdir -p $(DESTDIR)$(OMD_ROOT)/lib/python
set -e ; cd dest && \
- export PYTHONPATH=$$PYTHONPATH:"$(TMP_INSTALL_PATH)/lib" ; \
+ export PYTHONPATH=$$PYTHONPATH:"$(PACKAGE_PYTHON_MODULES_PYTHONPATH)" ; \
export PYTHONPATH=$$PYTHONPATH:"$(PACKAGE_PYTHON_PYTHONPATH)" ; \
export CPATH="$(PACKAGE_FREETDS_DESTDIR)/include" ; \
export LDFLAGS="$(PACKAGE_PYTHON_LDFLAGS) $(PACKAGE_FREETDS_LDFLAGS)" ; \
@@ -191,4 +190,4 @@ install:
skel:
clean:
- rm -rf dest $(TMP_INSTALL_PATH)
+ rm -rf dest $(PACKAGE_PYTHON_MODULES_DESTDIR)
diff --git a/omd/packages/rrdtool/Makefile b/omd/packages/rrdtool/Makefile
index 9ff1d6e..d248e93 100644
--- a/omd/packages/rrdtool/Makefile
+++ b/omd/packages/rrdtool/Makefile
@@ -27,6 +27,7 @@ build: check-python check-python-modules
CentOS\ 5.*) MS_ASYNC=broken ;; \
*) MS_ASYNC=ok ;; \
esac ; \
+ export PYTHONPATH=$$PYTHONPATH:$(PACKAGE_PYTHON_MODULES_PYTHONPATH) ; \
export PYTHONPATH=$$PYTHONPATH:$(PACKAGE_PYTHON_PYTHONPATH) ; \
export LD_LIBRARY_PATH=$(PACKAGE_PYTHON_LD_LIBRARY_PATH) ; \
export PATH="$(PACKAGE_PYTHON_BIN):$$PATH" ; \
@@ -42,13 +43,8 @@ build: check-python check-python-modules
./configure $(CONFIGUREOPTS) && \
$(MAKE) all
-check-python-modules:
- @if [ ! -d $(PACKAGE_PYTHON_DESTDIR) ]; then \
- echo "ERROR: You need to build the \"python-modules\" package
first" ; \
- exit 1 ; \
- fi
-
install:
+ export PYTHONPATH=$$PYTHONPATH:$(PACKAGE_PYTHON_MODULES_PYTHONPATH) ; \
export PYTHONPATH=$$PYTHONPATH:$(PACKAGE_PYTHON_PYTHONPATH) ; \
export LDFLAGS="$(PACKAGE_PYTHON_LDFLAGS)" ; \
export LD_LIBRARY_PATH=$(PACKAGE_PYTHON_LD_LIBRARY_PATH) ; \