-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
48 lines (41 loc) · 1.23 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
tmp := /tmp/deimos
prefix := usr/local
PKG_REL := 0.1.$(shell date -u +'%Y%m%d%H%M%S')
.PHONY: proto
proto: proto/mesos.proto
protoc --proto_path=proto/ --python_out=deimos/ proto/*.proto
.PHONY: pep8
pep8:
pep8 --exclude=*_pb2.py --ignore E127 deimos | tee pep8.txt | head -n8
.PHONY: deb
deb: clean freeze
fpm -C toor -t deb -s dir \
-n deimos -v `cat deimos/VERSION` --iteration $(PKG_REL) .
.PHONY: rpm
rpm: clean freeze
fpm -C toor -t rpm -s dir \
-n deimos -v `cat deimos/VERSION` --iteration $(PKG_REL) .
# You will have to install bbfreeze to create a package `pip install bbfreeze`
# Prep:
# - sudo python setup.py develop
.PHONY: freeze
freeze:
mkdir -p toor/$(prefix)/bin
mkdir -p toor/opt/mesosphere/deimos
cp bin/run toor/$(prefix)/bin/deimos
cp -R . $(tmp)
cd $(tmp) && sudo python setup.py bdist_bbfreeze
# Fix for ubuntu using directories for eggs instead of zips
sudo chmod a+r $(tmp)/dist/*/protobuf*/EGG-INFO/* || :
sudo cp -R $(tmp)/dist/*/* toor/opt/mesosphere/deimos
.PHONY: clean
clean:
rm -rf toor
rm -rf dist
rm -rf build
sudo rm -rf $(tmp)
.PHONY: prep-ubuntu
prep-ubuntu:
sudo apt-get install ruby-dev python-pip python-dev libz-dev protobuf-compiler
sudo gem install fpm
sudo pip install bbfreeze