1 include ..
/..
/Makefile.omd
5 SHINKEN_FILE
=$(SHINKEN
).
tar.gz
6 SHINKEN_URL
=http
://shinken-monitoring.org
/pub
/$(SHINKEN
).
tar.gz
8 # Python Remote Objects
9 ifeq ($(DISTRO_NAME
),CENTOS
)
10 ifeq ($(DISTRO_VERSION
),$(filter $(DISTRO_VERSION
),5.4 5.5 5.6 5.7 5.8 5.9 5.10))
12 PYRO_FILE
=$(PYRO
).
tar.gz
13 PYRO_URL
=https
://pypi.python.org
/packages
/source
/P
/Pyro
/$(PYRO_FILE
)
16 PYRO_FILE
=$(PYRO
).
tar.gz
17 PYRO_URL
=https
://pypi.python.org
/packages
/source
/P
/Pyro4
/$(PYRO_FILE
)
21 PYRO_FILE
=$(PYRO
).
tar.gz
22 PYRO_URL
=https
://pypi.python.org
/packages
/source
/P
/Pyro4
/$(PYRO_FILE
)
25 # Python Multiprocessing
26 MP
=multiprocessing-2.6
.2.1
28 MP_URL
=http
://pypi.python.org
/packages
/source
/m
/multiprocessing
/$(MP_FILE
)
30 # Simple JSON (not included in CentOS' python2.4)
31 ifeq ($(DISTRO_NAME
),CENTOS
)
32 ifeq ($(DISTRO_VERSION
),$(filter $(DISTRO_VERSION
),5.4 5.5 5.6 5.7 5.8 5.9 5.10))
33 SJSON
=simplejson-2.1
.2
35 SJSON
=simplejson-3.3
.0
38 SJSON
=simplejson-3.3
.0
40 SJSON_FILE
=$(SJSON
).
tar.gz
41 SJSON_URL
=http
://pypi.python.org
/packages
/source
/s
/simplejson
/$(SJSON_FILE
)
43 # Setup-Tools (needed to install Pyro on CentOS)
44 STOOLS
=setuptools-0.6c11
45 STOOLS_FILE
=$(STOOLS
).
tar.gz
46 STOOLS_URL
=http
://pypi.python.org
/packages
/source
/s
/setuptools
/$(STOOLS_FILE
)
48 # ctypes is only needed for CentOS and it's Python 2.4
50 CTYPES_FILE
=$(CTYPES
).
tar.gz
51 CTYPES_URL
=http
://downloads.sourceforge.net
/project
/ctypes
/ctypes
/1.0.2/$(CTYPES_FILE
)
53 # Hopefully this is never needed
55 SQLITE_FILE
=$(SQLITE
).
tar.gz
56 SQLITE_URL
=http
://pysqlite.googlecode.com
/files
/$(SQLITE_FILE
)
59 MONGODB
=mongodb-linux-i686-2.4
.1
60 ifeq ($(shell uname
-m
),x86_64
)
61 MONGODB
=mongodb-linux-x86_64-2.4
.1
63 MONGODB_FILE
=$(MONGODB
).tgz
64 MONGODB_URL
=http
://fastdl.mongodb.org
/linux
/$(MONGODB_FILE
)
66 # Python bindings for MongoDB
67 ifeq ($(DISTRO_NAME
),CENTOS
)
68 ifeq ($(DISTRO_VERSION
),$(filter $(DISTRO_VERSION
),5.4 5.5 5.6 5.7 5.8 5.9 5.10))
76 PYMONGO_FILE
=$(PYMONGO
).
tar.gz
77 PYMONGO_URL
=http
://pypi.python.org
/packages
/source
/p
/pymongo
/$(PYMONGO_FILE
)
79 # Hashlib (for Python 2.4)
80 HASHLIB
=hashlib-20081119
81 HASHLIB_FILE
=$(HASHLIB
).
tar.gz
82 HASHLIB_URL
=http
://code.krypto.org
/python
/hashlib
/$(HASHLIB_FILE
)
84 # This is where the python modules are going to be installed to
85 LOCALPYTHONDIR
=$(DESTDIR
)$(OMD_ROOT
)/lib
/python
87 # Find the directory where python distutils are located
90 RM_DISTU
=$(shell rm -rf
/tmp
/temp_distutils
)
91 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]")
92 # This is where the distutils module is temporary copied to
93 TMP_DISTU
=/tmp
/temp_distutils
94 PYTHONPATH
=$(TMP_DISTU
):$(LOCALPYTHONDIR
)
98 test -f
${SHINKEN_FILE} || wget
$(SHINKEN_URL
)
99 tar xzf
$(SHINKEN_FILE
)
100 #set -e ; for p in patches/*.patch ; do \
101 # echo "applying $$p..." ; \
102 # ( cd $(SHINKEN) ; patch -p1 -b ) < $$p ; \
104 test -f
$(PYRO_FILE
) || wget
$(PYRO_URL
)
106 test -f
$(MP_FILE
) || wget
$(MP_URL
)
108 test -f
$(SJSON_FILE
) || wget
$(SJSON_URL
)
109 tar xzf
$(SJSON_FILE
)
110 test -f
$(STOOLS_FILE
) || wget
$(STOOLS_URL
)
111 tar xzf
$(STOOLS_FILE
)
112 test -f
$(CTYPES_FILE
) || wget
$(CTYPES_URL
)
113 tar xzf
$(CTYPES_FILE
)
114 test -f
$(PYMONGO_FILE
) || wget
$(PYMONGO_URL
)
115 tar xzf
$(PYMONGO_FILE
)
116 test -f
$(MONGODB_FILE
) || wget
$(MONGODB_URL
)
117 tar xzf
$(MONGODB_FILE
)
118 test -f
$(HASHLIB_FILE
) || wget
$(HASHLIB_URL
)
119 tar xzf
$(HASHLIB_FILE
)
120 #test -f $(SQLITE_FILE) || wget $(SQLITE_URL)
121 #tar xzf $(SQLITE_FILE)
122 if
[ $(DISTRO_NAME
) = "CENTOS" ] && [ \
123 $(DISTRO_VERSION
) = "5.4" -o \
124 $(DISTRO_VERSION
) = "5.5" -o \
125 $(DISTRO_VERSION
) = "5.6" -o\
126 $(DISTRO_VERSION
) = "5.7" -o \
127 $(DISTRO_VERSION
) = "5.8" -o \
128 $(DISTRO_VERSION
) = "5.9" -o \
129 $(DISTRO_VERSION
) = "5.10" ]; then \
130 echo it is a centos
5; \
131 echo which has python
2.4; \
132 echo we need to remove the shinken webui
; \
133 rm -f
$(SHINKEN
)/shinken
/modules
/active_directory_ui.py
; \
139 mkdir
-p
$(LOCALPYTHONDIR
)
140 $(MAKE
) installshinken
141 $(MAKE
) repairdistutils
142 $(MAKE
) installstools
146 $(MAKE
) installpymongo
147 $(MAKE
) installmongodb
148 echo
"distro is " $(DISTRO_NAME
)
149 if
[ $(DISTRO_NAME
) = "CENTOS" ]; then \
150 $(MAKE
) installctypes
; \
151 $(MAKE
) installhashlib
; \
153 #$(MAKE) installsqlite
155 # cleanup the tmp directory
156 for tmpfile in
$(DESTDIR
)$(OMD_ROOT
)/tmp
/easy_install
* ; do \
159 for tmpfile in
$(DESTDIR
)$(OMD_ROOT
)/tmp
/pyro-
* ; do \
165 # bin/shinken-* startfiles
166 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/bin
167 install -m
755 $(SHINKEN
)/bin
/shinken-arbiter
$(DESTDIR
)$(OMD_ROOT
)/bin
168 install -m
755 $(SHINKEN
)/bin
/shinken-broker
$(DESTDIR
)$(OMD_ROOT
)/bin
169 install -m
755 $(SHINKEN
)/bin
/shinken-scheduler
$(DESTDIR
)$(OMD_ROOT
)/bin
170 install -m
755 $(SHINKEN
)/bin
/shinken-poller
$(DESTDIR
)$(OMD_ROOT
)/bin
171 install -m
755 $(SHINKEN
)/bin
/shinken-reactionner
$(DESTDIR
)$(OMD_ROOT
)/bin
172 install -m
755 $(SHINKEN
)/bin
/shinken-admin
$(DESTDIR
)$(OMD_ROOT
)/bin
173 install -m
755 $(SHINKEN
)/bin
/shinken-receiver
$(DESTDIR
)$(OMD_ROOT
)/bin
176 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/lib
/shinken
177 cp
-r
$(SHINKEN
)/shinken
$(DESTDIR
)$(OMD_ROOT
)/lib
/shinken
179 install -m
755 $(SHINKEN
)/bin
/shinken-discovery
$(DESTDIR
)$(OMD_ROOT
)/bin
180 cp
-r
$(SHINKEN
)/libexec
$(DESTDIR
)$(OMD_ROOT
)/lib
/shinken
182 install -m
755 merge-shinken-config
$(DESTDIR
)$(OMD_ROOT
)/bin
183 install -m
755 merge-shinken-specific-config
$(DESTDIR
)$(OMD_ROOT
)/bin
188 cp
-r
$(DISTUTILS
) $(TMP_DISTU
)
189 # SuSE prevents installation of modules to private locations
190 rm -f
/tmp
/temp_distutils
/distutils
/distutils.cfg
195 ( cd
$(STOOLS
) ; python setup.py
install \
196 --home
=$(DESTDIR
)$(OMD_ROOT
) \
197 --install-platlib
=$(LOCALPYTHONDIR
) \
198 --install-purelib
=$(LOCALPYTHONDIR
) \
199 --install-scripts
=$(DESTDIR
)$(OMD_ROOT
)/tmp \
200 --install-data
=$(DESTDIR
)$(OMD_ROOT
)/tmp
)
204 ( cd
$(PYRO
) ; python setup.py
install \
205 --home
=$(DESTDIR
)$(OMD_ROOT
) \
206 --install-platlib
=$(LOCALPYTHONDIR
) \
207 --install-purelib
=$(LOCALPYTHONDIR
) \
208 --install-scripts
=$(DESTDIR
)$(OMD_ROOT
)/tmp \
209 --install-data
=$(DESTDIR
)$(OMD_ROOT
)/tmp
)
213 ( cd
$(MP
) ; python setup.py
install \
214 --home
=$(DESTDIR
)$(OMD_ROOT
) \
215 --install-platlib
=$(LOCALPYTHONDIR
) \
216 --install-scripts
=$(DESTDIR
)$(OMD_ROOT
)/tmp \
217 --install-data
=$(DESTDIR
)$(OMD_ROOT
)/tmp
)
221 ( cd
$(SQLITE
) ; python setup.py
install \
222 --home
=$(DESTDIR
)$(OMD_ROOT
) \
223 --install-platlib
=$(LOCALPYTHONDIR
) \
224 --install-scripts
=$(DESTDIR
)$(OMD_ROOT
)/tmp \
225 --install-data
=$(DESTDIR
)$(OMD_ROOT
)/tmp
)
229 ( cd
$(SJSON
) ; python setup.py
install \
230 --home
=$(DESTDIR
)$(OMD_ROOT
) \
231 --install-platlib
=$(LOCALPYTHONDIR
) \
232 --install-scripts
=$(DESTDIR
)$(OMD_ROOT
)/tmp \
233 --install-data
=$(DESTDIR
)$(OMD_ROOT
)/tmp
)
237 ( cd
$(CTYPES
) ; python setup.py
install \
238 --home
=$(DESTDIR
)$(OMD_ROOT
) \
239 --install-platlib
=$(LOCALPYTHONDIR
) \
240 --install-scripts
=$(DESTDIR
)$(OMD_ROOT
)/tmp \
241 --install-data
=$(DESTDIR
)$(OMD_ROOT
)/tmp
)
244 ( cd
$(PYMONGO
) ; python setup.py
install \
245 --home
=$(DESTDIR
)$(OMD_ROOT
) \
246 --install-platlib
=$(LOCALPYTHONDIR
) \
247 --install-scripts
=$(DESTDIR
)$(OMD_ROOT
)/tmp \
248 --install-data
=$(DESTDIR
)$(OMD_ROOT
)/tmp
)
251 ( cd
$(HASHLIB
) ; python setup.py
install \
252 --home
=$(DESTDIR
)$(OMD_ROOT
) \
253 --install-platlib
=$(LOCALPYTHONDIR
) \
254 --install-scripts
=$(DESTDIR
)$(OMD_ROOT
)/tmp \
255 --install-data
=$(DESTDIR
)$(OMD_ROOT
)/tmp
)
258 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/bin
259 install -m
755 $(MONGODB
)/bin
/mongod
$(DESTDIR
)$(OMD_ROOT
)/bin
260 install -m
755 $(MONGODB
)/bin
/mongo
$(DESTDIR
)$(OMD_ROOT
)/bin