1 include ..
/..
/Makefile.omd
5 VERSION
= $(OMD_VERSION
)
6 DISTRO
= $(shell ..
/..
/distro
)
7 PYTHON
= LD_LIBRARY_PATH
=$(shell pwd
)/..
/python
/tmp.python27
/lib \
8 $(shell pwd
)/..
/python
/tmp.python27
/bin
/python
9 TMP_INSTALL_PATH
= $(shell pwd
)/tmp.python
12 # Modules really needed on all platforms
13 MODULES
+= pysphere-0.1
.7.zip
14 MODULES
+= pyasn1-0.1
.7.
tar.gz
15 MODULES
+= pycrypto-2.6
.1.
tar.gz
16 MODULES
+= pysnmp-4.2
.4.
tar.gz
18 # Modules needed because of own packed python (would be available in OS)
19 MODULES
+= setuptools-22.0
.5.
tar.gz
# needed by rrdtool bindings
22 ifeq ($(DISTRO_CODE
),el5
)
26 ifeq ($(LEGACY_LDAP
), 1)
27 MODULES
+= python-ldap-2.3
.13.
tar.gz
28 SKIP_PATCH
=patches
/0001-python-ldap-2.4
.25-disable-sasl.dif
30 MODULES
+= python-ldap-2.4
.25.
tar.gz
31 SKIP_PATCH
=patches
/0001-python-ldap-2.3
.13-disable-sasl.dif
37 for M in
$(MODULES
); do \
38 echo
"Unpacking $$M..." ; \
39 if echo
$$M | grep .
tar.gz
; then \
40 tar xvzf ..
/src
/$$M ; \
42 unzip
-o ..
/src
/$$M ; \
46 set
-e
; for p in patches
/*.dif
; do \
47 if
[ $$p != $(SKIP_PATCH
) ]; then \
48 echo
"applying $$p..." ; \
49 ( cd dest
; patch
-p1
-b
) < $$p ; \
53 mkdir
-p
$(TMP_INSTALL_PATH
)/lib || true
; \
54 export PYTHONPATH
=$$PYTHONPATH:$(TMP_INSTALL_PATH
)/lib
; \
55 export PYTHONPATH
=$$PYTHONPATH:$(DESTDIR
)$(OMD_ROOT
)/lib
/python
; \
56 export PYTHONPATH
=$$PYTHONPATH:$(shell pwd
)/..
/python
/tmp.python27
/lib
/python2.7
; \
57 export LDFLAGS
="-L$(shell pwd)/../python/tmp.python27/lib -L$(shell pwd)/../python/tmp.python27/lib/python2.7/config" ; \
58 for M in
$(MODULES
); do \
59 echo
"Building $$M..." ; \
60 PKG
=$${M
//.
tar.gz
/} ; \
61 PKG
=$${PKG
//.zip
/} ; \
62 if
[ $$PKG = pysnmp-git
]; then \
66 $(PYTHON
) setup.py build
; \
67 $(PYTHON
) setup.py
install --home
=$(TMP_INSTALL_PATH
) \
69 --install-platlib
=$(TMP_INSTALL_PATH
)/lib \
70 --install-purelib
=$(TMP_INSTALL_PATH
)/lib
; \
75 @if
[ ! -d ..
/python
/tmp.python27
]; then \
76 echo
"ERROR: You need to build the \"python\" package first" ; \
81 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/lib
/python
83 export PYTHONPATH
=$$PYTHONPATH:$(TMP_INSTALL_PATH
)/lib
; \
84 export PYTHONPATH
=$$PYTHONPATH:$(DESTDIR
)$(OMD_ROOT
)/lib
/python
; \
85 export PYTHONPATH
=$$PYTHONPATH:$(shell pwd
)/..
/python
/tmp.python27
/lib
/python2.7
; \
87 echo
"Installing $$M..." ; \
89 $(PYTHON
) setup.py
install --home
=$(DESTDIR
)$(OMD_ROOT
) \
91 --install-platlib
=$(DESTDIR
)$(OMD_ROOT
)/lib
/python \
92 --install-purelib
=$(DESTDIR
)$(OMD_ROOT
)/lib
/python
; \
96 # Cleanup some unwanted files (example scripts)
97 rm -f
$(DESTDIR
)$(OMD_ROOT
)/bin
/*.py || true
99 # Fix python interpreter for kept scripts
100 for F in
$(DESTDIR
)$(OMD_ROOT
)/bin
/easy_install \
101 $(DESTDIR
)$(OMD_ROOT
)/bin
/easy_install-2.7 \
102 $(DESTDIR
)$(OMD_ROOT
)/bin
/libsmi2pysnmp \
103 $(DESTDIR
)$(OMD_ROOT
)/bin
/pip \
105 if
[ -f
$$F ]; then \
106 sed
-i
"1s|^#!.*python|#!/usr/bin/env python|" $$F; \
110 # Cleanup build time paths in easy-install.pth
111 sed
-i
's|^/.*/\(.*\.egg\)$$|./\1|g' $(DESTDIR
)$(OMD_ROOT
)/lib
/python
/easy-install.pth
116 rm -rf dest tmp.python