blob: af9afa7e682290213b10da28d0354390e38a63cc [file] [log] [blame]
prithiv897fb362017-09-15 14:59:44 +01001# Copyright 2017 Intel Research and Development Ireland Limited
2# *************************************************************
3
4# This file is part of OSM Monitoring module
5# All Rights Reserved to Intel Corporation
6
7# Licensed under the Apache License, Version 2.0 (the "License"); you may
8# not use this file except in compliance with the License. You may obtain
9# a copy of the License at
10
11# http://www.apache.org/licenses/LICENSE-2.0
12
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16# License for the specific language governing permissions and limitations
17# under the License.
18
19# For those usages not covered by the Apache License, Version 2.0 please
20# contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
21
22#__author__ = "Prithiv Mohan"
23#__date__ = "14/Sep/2017"
24
25SHELL := /bin/bash
26all: package install
27
28clean_deb:
prithiv063fe7c2017-09-29 11:24:41 +010029 rm -rf .build
prithiv897fb362017-09-15 14:59:44 +010030
31clean:
prithiv063fe7c2017-09-29 11:24:41 +010032 rm -rf build
prithiv897fb362017-09-15 14:59:44 +010033
34prepare:
prithiv063fe7c2017-09-29 11:24:41 +010035 pip install --upgrade setuptools
36 mkdir -p build/
37 VER1=$(shell git describe | sed -e 's/^v//' |cut -d- -f1); \
38 VER2=$(shell git describe | cut -d- -f2); \
39 VER3=$(shell git describe | cut -d- -f3); \
40 cp MANIFEST.in build/
41 cp requirements.txt build/
42 cp README.rst build/
43 cp stdeb.cfg build/
44 cp kafkad build/
45 cp -r core build/
46 cp -r plugins build/
47 cp -r devops_stages build/
48 cp -r test build/
49 cp setup.py build/
prithiv897fb362017-09-15 14:59:44 +010050
51build: clean openstack_plugins prepare
prithiv063fe7c2017-09-29 11:24:41 +010052 python -m py_compile build/plugins/OpenStack/*.py
prithiv897fb362017-09-15 14:59:44 +010053
54build: clean vrops_plugins prepare
prithiv063fe7c2017-09-29 11:24:41 +010055 python -m py_compile build/plugins/vRealiseOps/*.py
prithiv897fb362017-09-15 14:59:44 +010056
prithiv063fe7c2017-09-29 11:24:41 +010057build: clean cloudwatch_plugins prepare
58 python -m py_compile build/plugins/CloudWatch/*.py
prithiv897fb362017-09-15 14:59:44 +010059
prithiv063fe7c2017-09-29 11:24:41 +010060build: clean core prepare
61 python -m py_compile build/core/message_bus/*.py
prithiv897fb362017-09-15 14:59:44 +010062
63pip: prepare
prithiv063fe7c2017-09-29 11:24:41 +010064 cd build ./setup.py sdist
65 cd build ./plugin_setup.py sdist
prithiv897fb362017-09-15 14:59:44 +010066
67package: clean clean_deb prepare
prithiv063fe7c2017-09-29 11:24:41 +010068 apt-get --yes install python-software-properties \
69 python-pip \
70 python-stdeb \
71 libmysqlclient-dev \
72 libxml2 \
73 python-dev
74 cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True
75 cd build/deb_dist/* && dpkg-buildpackage -rfakeroot -uc -us
76 mkdir -p .build
77 cp build/deb_dist/python-*.deb .build/
78 pip install -r build/requirements.txt
prithiv897fb362017-09-15 14:59:44 +010079
80install:
81 DEBIAN_FRONTEND=noninteractive apt-get update && \
prithiv063fe7c2017-09-29 11:24:41 +010082 DEBIAN_FRONTEND=noninteractive apt-get install --yes python-pip && \
83 pip install --upgrade pip
84 #dpkg -i build/deb_dist/*.deb
prithiv897fb362017-09-15 14:59:44 +010085
86develop: prepare
prithiv063fe7c2017-09-29 11:24:41 +010087 pip install -r requirements.txt
88 cd build && ./setup.py develop