Preliminar Jenkinsfile and Dockerfile; not working with agreed debian repo structure
[osm/openvim.git] / Makefile
1 #!/usr/bin/env bash
2 SHELL := /bin/bash
3
4 all: clean build pip install
5 lite: clean build_lite pip_lite install_lite
6
7 clean_deb:
8 rm -rf .build
9 clean:
10 rm -rf build
11 find osm_openvim -name '*.pyc' -delete
12 find osm_openvim -name '*.pyo' -delete
13
14 prepare_lite:
15 pip install --upgrade setuptools
16 mkdir -p build
17 VER1=$(shell git describe | sed -e 's/^v//' |cut -d- -f1); \
18 VER2=$(shell git describe | cut -d- -f2); \
19 VER3=$(shell git describe | cut -d- -f3); \
20 echo "$$VER1.dev$$VER2+$$VER3" > build/OVIM_VERSION
21 cp MANIFEST.in build/
22 sed -i "s/include OPENVIM_VERSION/include OVIM_VERSION/g" build/MANIFEST.in
23 sed -i "s/recursive-include osm_openvim/recursive-include lib_osm_openvim/g" build/MANIFEST.in
24 sed -i "s/include openflow/include openflow-lib/g" build/MANIFEST.in
25 sed -i '/include openvimd/d' build/MANIFEST.in
26 sed -i '/include openvim/d' build/MANIFEST.in
27 cp README_lite.rst build/README.rst
28 cp setup_lite.py build/setup.py
29 cp stdeb_lite.cfg build/stdeb.cfg
30 cp -r osm_openvim/ build/lib_osm_openvim
31 rm build/lib_osm_openvim/httpserver.py
32 rm build/lib_osm_openvim/openvimd.cfg
33 cp -r database_utils build/lib_osm_openvim/
34 cp -r scripts build/lib_osm_openvim/
35 cp openflow build/openflow-lib
36 sed -i "s/from osm_openvim/from lib_osm_openvim/g" build/openflow-lib
37 sed -i "s/import osm_openvim/import lib_osm_openvim/g" build/openflow-lib
38 sed -i "s/import osm_openvim; print osm_openvim\.__path__\[0\]/import lib_osm_openvim; print lib_osm_openvim\.__path__\[0\]/g" build/lib_osm_openvim/database_utils/migrate_vim_db.sh
39
40 prepare:
41 pip install --upgrade setuptools
42 mkdir -p build
43 VER1=$(shell git describe | sed -e 's/^v//' |cut -d- -f1); \
44 VER2=$(shell git describe | cut -d- -f2); \
45 VER3=$(shell git describe | cut -d- -f3); \
46 echo "$$VER1.dev$$VER2+$$VER3" > build/OPENVIM_VERSION
47 cp MANIFEST.in build/
48 cp README.rst build/
49 cp setup.py build/
50 cp stdeb.cfg build/
51 cp -r osm_openvim/ build/
52 cp -r scripts build/osm_openvim/
53 cp -r database_utils build/osm_openvim/
54 cp -r templates build/osm_openvim/
55 cp -r test build/osm_openvim/
56 cp -r charm build/osm_openvim/
57 cp openflow build/
58 cp openvim build/
59 cp openvimd build/
60
61 build: prepare
62 python -m py_compile build/osm_openvim/*.py
63
64 build_lite: prepare_lite
65 python -m py_compile build/lib_osm_openvim/*.py
66
67 pip: clean build
68 cd build && ./setup.py sdist
69
70 pip_lite: clean build_lite
71 cd build && ./setup.py sdist
72
73 package_openvim: clean prepare
74 #apt-get install -y python-stdeb
75 cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True
76 cd build && cp osm_openvim/scripts/python-osm-openvim.postinst deb_dist/osm-openvim*/debian/
77 cd build/deb_dist/osm-openvim* && dpkg-buildpackage -rfakeroot -uc -us
78 mkdir -p .build
79 cp build/deb_dist/python-*.deb ./build/
80
81 package_lib: clean prepare_lite
82 #apt-get install -y python-stdeb
83 cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True
84 cd build/deb_dist/lib-osm-openvim* && dpkg-buildpackage -rfakeroot -uc -us
85 mkdir -p .build
86 cp build/deb_dist/python-*.deb ./build/
87
88 package: clean_deb package_openvim package_lib
89
90 snap:
91 echo "Nothing to be done yet"
92
93 install: clean build
94 cd build/dist; pip install osm_openvim*
95
96 install_lite: clean build_lite
97 cd build/dist; pip install lib_osm_openvim-*
98
99
100
101
102
103
104
105