[omd-commits] OMD Git: omd: python-modules: Fixed python-ldap build on old platforms

git version control git at mathias-kettner.de
Sun Jun 5 19:53:36 CEST 2016


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

Author:   Lars Michelsen <lm at larsmichelsen.com>
Date:     Sun Jun  5 19:53:33 2016 +0200
Commiter: Lars Michelsen <lm at larsmichelsen.com>
Date:     Sun Jun  5 19:53:33 2016 +0200

python-modules: Fixed python-ldap build on old platforms

---

 packages/python-modules/Makefile                   |   24 ++++++++++++++++----
 .../0001-python-ldap-2.3.13-disable-sasl.dif       |   11 +++++++++
 ...if => 0001-python-ldap-2.4.25-disable-sasl.dif} |    0
 .../python-modules/src/python-ldap-2.3.13.tar.gz   |  Bin 0 -> 112397 bytes
 .../python-modules/src/setuptools-22.0.5.tar.gz    |  Bin 676083 -> 0 bytes
 5 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/packages/python-modules/Makefile b/packages/python-modules/Makefile
index 755bc5a..724c972 100644
--- a/packages/python-modules/Makefile
+++ b/packages/python-modules/Makefile
@@ -3,7 +3,8 @@ include ../../Makefile.omd
 NAME     = python-modules
 VERSION  = $(OMD_VERSION)
 DISTRO   = $(shell ../../distro)
-PYTHON   = $(shell pwd)/../python/tmp.python27/bin/python
+PYTHON   = LD_LIBRARY_PATH=$(shell pwd)/../python/tmp.python27/lib \
+	   $(shell pwd)/../python/tmp.python27/bin/python
 
 MODULES =
 # Modules really needed on all platforms
@@ -14,7 +15,19 @@ MODULES += pysnmp-4.2.4.tar.gz
 
 # Modules needed because of own packed python (would be available in OS)
 MODULES += setuptools-22.0.5.tar.gz  # needed by rrdtool bindings
-MODULES += python-ldap-2.4.25.tar.gz # used for cmk ldap sync
+
+LEGACY_LDAP=0
+ifeq ($(DISTRO_CODE),el5)
+    LEGACY_LDAP=1
+endif
+
+ifeq ($(LEGACY_LDAP), 1)
+    MODULES += python-ldap-2.3.13.tar.gz
+    SKIP_PATCH=patches/0001-python-ldap-2.4.25-disable-sasl.dif
+else
+    MODULES += python-ldap-2.4.25.tar.gz
+    SKIP_PATCH=patches/0001-python-ldap-2.3.13-disable-sasl.dif
+endif
 
 build: check-python
 	mkdir -p dest
@@ -29,12 +42,15 @@ build: check-python
 	    done
 	
 	set -e ; for p in patches/*.dif ; do \
-	    echo "applying $$p..." ; \
-	    ( cd dest ; patch -p1 -b ) < $$p ; \
+	    if [ $$p != $(SKIP_PATCH) ]; then \
+	        echo "applying $$p..." ; \
+	        ( cd dest ; patch -p1 -b ) < $$p ; \
+	    fi ; \
 	done
 	set -e ; cd dest && \
 	    export PYTHONPATH=$$PYTHONPATH:$(DESTDIR)$(OMD_ROOT)/lib/python ; \
 	    export PYTHONPATH=$$PYTHONPATH:$(shell pwd)/../python/tmp.python27/lib/python2.7 ; \
+	    export LDFLAGS="-L$(shell pwd)/../python/tmp.python27/lib -L$(shell pwd)/../python/tmp.python27/lib/python2.7/config" ; \
 	    for M in $$(ls); do \
 		echo "Building $$M..." ; \
 		cd $$M ; \
diff --git a/packages/python-modules/patches/0001-python-ldap-2.3.13-disable-sasl.dif b/packages/python-modules/patches/0001-python-ldap-2.3.13-disable-sasl.dif
new file mode 100644
index 0000000..f80003a
--- /dev/null
+++ b/packages/python-modules/patches/0001-python-ldap-2.3.13-disable-sasl.dif
@@ -0,0 +1,11 @@
+--- dest/python-ldap-2.3.13/setup.cfg.sav	2016-06-03 23:20:32.520383426 +0200
++++ dest/python-ldap-2.3.13/setup.cfg	2016-06-03 23:20:39.948681659 +0200
+@@ -1,7 +1,7 @@
+ [_ldap]
+ library_dirs = /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64
+ include_dirs = /usr/include /usr/include/sasl /usr/local/include /usr/local/include/sasl
+-defines = HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
++defines = HAVE_TLS HAVE_LIBLDAP_R
+ extra_compile_args = 
+ extra_objects = 
+ libs = ldap_r
diff --git a/packages/python-modules/patches/0001-python-ldap-disable-sasl.dif b/packages/python-modules/patches/0001-python-ldap-2.4.25-disable-sasl.dif
similarity index 100%
rename from packages/python-modules/patches/0001-python-ldap-disable-sasl.dif
rename to packages/python-modules/patches/0001-python-ldap-2.4.25-disable-sasl.dif
diff --git a/packages/python-modules/src/python-ldap-2.3.13.tar.gz b/packages/python-modules/src/python-ldap-2.3.13.tar.gz
new file mode 100644
index 0000000..2097d0c
Binary files /dev/null and b/packages/python-modules/src/python-ldap-2.3.13.tar.gz differ
diff --git a/packages/python-modules/src/setuptools-22.0.5.tar.gz b/packages/python-modules/src/setuptools-22.0.5.tar.gz
deleted file mode 100644
index 8aea28d..0000000
Binary files a/packages/python-modules/src/setuptools-22.0.5.tar.gz and /dev/null differ



More information about the omd-commits mailing list