1 include ..
/..
/Makefile.omd
5 DIR
= $(NAME
)-$(VERSION
)
6 PYTHON
= $(shell pwd
)/..
/python
/tmp.python27
/bin
/python
10 --with-python
=$(PYTHON
)
12 APACHE_VERSION
= $(shell $(APACHE_BIN
) -v | awk
'/version/ {print $$3}' | awk
-F
/ '{print $$2}')
13 APACHE_VERSION_MAIN
= $(word 1, $(subst .
, ,$(APACHE_VERSION
)))
14 APACHE_VERSION_SUB
= $(word 2, $(subst .
, ,$(APACHE_VERSION
)))
18 set
-e
; for p in patches
/*.dif
; do \
19 echo
"applying $$p..." ; \
20 ( cd
$(DIR
) ; patch
-p1
-b
) < $$p ; \
23 # Apply special patch for apache >= 2.4
24 if
[ $(APACHE_VERSION_MAIN
) -ge
2 -a
$(APACHE_VERSION_SUB
) -ge
4 ]; then \
25 echo
"applying patches/0008-apache24.patch..." ; \
26 ( cd
$(DIR
) ; patch
-p1
-b
) < patches
/0008-apache24.patch
; \
29 export LD_LIBRARY_PATH
=$(shell pwd
)/..
/python
/tmp.python27
/lib
; \
30 export LDFLAGS
="-L$(shell pwd)/../python/tmp.python27/lib -L$(shell pwd)/../python/tmp.python27/lib/python2.7/config" ; \
32 .
/configure
$(CONFIGUREOPTS
) ; \
33 echo
'#define OMD_VERSION "$(OMD_VERSION)"' > src
/omd_version.h
; \
37 @if
[ ! -d ..
/python
/tmp.python27
]; then \
38 echo
"ERROR: You need to build the \"python\" package first" ; \
43 # Use 'make install' of mod_python into a temporary file.
44 # mod_python does not honor --prefix, so we move the stuff over...
45 export LD_LIBRARY_PATH
=$(shell pwd
)/..
/python
/tmp.python27
/lib
; \
46 make DESTDIR
=$$(pwd
)/tmp.root
-C
$(DIR
) install
48 # Installation directories vary much
49 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/lib
/apache
/modules
50 MP
=$$(find tmp.root
-name mod_python.so
) ; \
51 install -m
644 $$MP $(DESTDIR
)$(OMD_ROOT
)/lib
/apache
/modules
53 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/lib
/python
/mod_python
54 PYDIR
=$$(find tmp.root
-name
"*egg*" | sed
's@/mod_python.*@@') ; \
55 if
[ -z
"$$PYDIR" ] ; then PYDIR
=$$(find tmp.root
/ -name __init__.py | sed
's@/mod_python/__init__.*@@') ; fi
; \
56 install $$PYDIR/mod_python
/* $(DESTDIR
)$(OMD_ROOT
)/lib
/python
/mod_python
; \
57 if
[ -e
$$PYDIR/*egg
* ] ; then
install -m
644 $$PYDIR/*egg
* $(DESTDIR
)$(OMD_ROOT
)/lib
/python
; fi
63 rm -rf
$(NAME
)-*.
*.
[0-9] tmp.root