1 include ..
/..
/Makefile.omd
3 PYTHON
= LD_LIBRARY_PATH
=$(shell pwd
)/..
/python
/tmp.python27
/lib \
4 $(shell pwd
)/..
/python
/tmp.python27
/bin
/python
7 SHINKEN_FILE
=$(SHINKEN
).
tar.gz
8 SHINKEN_URL
=http
://shinken-monitoring.org
/pub
/$(SHINKEN
).
tar.gz
10 # Python Remote Objects
12 PYRO_FILE
=$(PYRO
).
tar.gz
13 PYRO_URL
=https
://pypi.python.org
/packages
/source
/P
/Pyro4
/$(PYRO_FILE
)
15 # Simple JSON (not included in CentOS' python2.4)
16 SJSON
=simplejson-3.3
.0
17 SJSON_FILE
=$(SJSON
).
tar.gz
18 SJSON_URL
=http
://pypi.python.org
/packages
/source
/s
/simplejson
/$(SJSON_FILE
)
21 ifeq ($(shell uname
-m
),x86_64
)
22 MONGODB
=mongodb-linux-x86_64-2.4
.1
23 else ifeq ($(shell uname
-m
),$(filter $(shell uname
-m
),i386 i486 i586 i686
))
24 MONGODB
=mongodb-linux-i686-2.4
.1
25 else ifeq ($(shell uname
-m
),armv7l
)
26 # http://andyfelong.com/2015/02/mongodb-on-the-raspberry-pi-2/
27 MONGODB
=mongodb-linux-armv7l-2.6
.3
28 else ifeq ($(shell uname
-m
),armv6l
)
29 MONGODB
=mongodb-linux-armv6l-2012-09-16
31 MONGODB_FILE
=$(MONGODB
).tgz
32 MONGODB_URL
=http
://fastdl.mongodb.org
/linux
/$(MONGODB_FILE
)
34 # Python bindings for MongoDB
36 PYMONGO_FILE
=$(PYMONGO
).
tar.gz
37 PYMONGO_URL
=http
://pypi.python.org
/packages
/source
/p
/pymongo
/$(PYMONGO_FILE
)
39 # This is where the python modules are going to be installed to
40 LOCALPYTHONDIR
=$(DESTDIR
)$(OMD_ROOT
)/lib
/python
42 # Find the directory where python distutils are located
45 DISTUTILS
=$(shell $(PYTHON
) -c
"import sys; import os; print [os.path.join(p, 'distutils') for p in sys.path if os.path.exists(os.path.join(p, 'distutils'))][0]")
46 # This is where the distutils module is temporary copied to
47 TMP_DISTU
=$(shell pwd
)/temp_distutils
48 PYTHONPATH
=$(TMP_DISTU
):$(LOCALPYTHONDIR
)
52 test -f
${SHINKEN_FILE} || wget
$(SHINKEN_URL
)
53 tar xzf
$(SHINKEN_FILE
)
54 #set -e ; for p in patches/*.patch ; do \
55 # echo "applying $$p..." ; \
56 # ( cd $(SHINKEN) ; patch -p1 -b ) < $$p ; \
58 test -f
$(PYRO_FILE
) || wget
$(PYRO_URL
)
60 test -f
$(SJSON_FILE
) || wget
$(SJSON_URL
)
62 test -f
$(PYMONGO_FILE
) || wget
$(PYMONGO_URL
)
63 tar xzf
$(PYMONGO_FILE
)
64 test -f
$(MONGODB_FILE
) || wget
$(MONGODB_URL
)
65 tar xzf
$(MONGODB_FILE
)
68 @if
[ ! -d ..
/python
/tmp.python27
]; then \
69 echo
"ERROR: You need to build the \"python\" package first" ; \
75 mkdir
-p
$(LOCALPYTHONDIR
)
76 $(MAKE
) installshinken
77 $(MAKE
) repairdistutils
78 $(MAKE
) PKG
=$(PYRO
) installmodule
79 $(MAKE
) PKG
=$(SJSON
) installmodule
80 $(MAKE
) PKG
=$(PYMONGO
) installmodule
81 $(MAKE
) installmongodb
83 # cleanup the tmp directory
84 for tmpfile in
$(DESTDIR
)$(OMD_ROOT
)/tmp
/easy_install
* ; do \
87 for tmpfile in
$(DESTDIR
)$(OMD_ROOT
)/tmp
/pyro-
* ; do \
93 # bin/shinken-* startfiles
94 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/bin
95 install -m
755 $(SHINKEN
)/bin
/shinken-arbiter
$(DESTDIR
)$(OMD_ROOT
)/bin
96 install -m
755 $(SHINKEN
)/bin
/shinken-broker
$(DESTDIR
)$(OMD_ROOT
)/bin
97 install -m
755 $(SHINKEN
)/bin
/shinken-scheduler
$(DESTDIR
)$(OMD_ROOT
)/bin
98 install -m
755 $(SHINKEN
)/bin
/shinken-poller
$(DESTDIR
)$(OMD_ROOT
)/bin
99 install -m
755 $(SHINKEN
)/bin
/shinken-reactionner
$(DESTDIR
)$(OMD_ROOT
)/bin
100 install -m
755 $(SHINKEN
)/bin
/shinken-admin
$(DESTDIR
)$(OMD_ROOT
)/bin
101 install -m
755 $(SHINKEN
)/bin
/shinken-receiver
$(DESTDIR
)$(OMD_ROOT
)/bin
104 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/lib
/shinken
105 cp
-r
$(SHINKEN
)/shinken
$(DESTDIR
)$(OMD_ROOT
)/lib
/shinken
107 install -m
755 $(SHINKEN
)/bin
/shinken-discovery
$(DESTDIR
)$(OMD_ROOT
)/bin
108 cp
-r
$(SHINKEN
)/libexec
$(DESTDIR
)$(OMD_ROOT
)/lib
/shinken
110 install -m
755 merge-shinken-config
$(DESTDIR
)$(OMD_ROOT
)/bin
111 install -m
755 merge-shinken-specific-config
$(DESTDIR
)$(OMD_ROOT
)/bin
115 mkdir
-p
$(TMP_DISTU
)
116 cp
-r
$(DISTUTILS
) $(TMP_DISTU
)
117 # SuSE prevents installation of modules to private locations
118 rm -f
/tmp
/temp_distutils
/distutils
/distutils.cfg
124 export PYTHONPATH
=$$PYTHONPATH:$(DESTDIR
)$(OMD_ROOT
)/lib
/python
; \
125 export PYTHONPATH
=$$PYTHONPATH:$(shell pwd
)/..
/python
/tmp.python27
/lib
/python2.7
; \
126 export PYTHONPATH
=$$PYTHONPATH:$(shell pwd
)/..
/python-modules
/tmp.python
/lib
/python2.7
; \
127 export LDFLAGS
="-L$(shell pwd)/../python/tmp.python27/lib -L$(shell pwd)/../python/tmp.python27/lib/python2.7/config" ; \
128 $(PYTHON
) setup.py
install \
130 --home
=$(DESTDIR
)$(OMD_ROOT
) \
131 --install-platlib
=$(LOCALPYTHONDIR
) \
132 --install-purelib
=$(LOCALPYTHONDIR
) \
133 --install-scripts
=$(DESTDIR
)$(OMD_ROOT
)/tmp \
134 --install-data
=$(DESTDIR
)$(OMD_ROOT
)/tmp
)
138 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/bin
139 install -m
755 $(MONGODB
)/bin
/mongod
$(DESTDIR
)$(OMD_ROOT
)/bin
140 install -m
755 $(MONGODB
)/bin
/mongo
$(DESTDIR
)$(OMD_ROOT
)/bin