forked from akanda/akanda-appliance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.deprecated
136 lines (112 loc) · 3.2 KB
/
Makefile.deprecated
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
LIB = akanda
UNAME := $(shell uname)
DEV_DIR = ~/lab/DreamHost/dhc
PYPF_DIR = $(DEV_DIR)/pypf
TXROUTES_DIR = $(DEV_DIR)/txroutes
AKANDA_DIR = $(DEV_DIR)/akanda
PYPF_INSTALL = /usr/local/lib/python2.7/site-packages/pypf
PYPF_URL = git@github.com:dreamhost/pypf.git
TXROUTES_URL = git@github.com:dreamhost/txroutes.git
AKANDA_URL = git@github.com:dreamhost/akanda.git
USER ?= oubiwann
REQUIREMENTS = requirements.txt
PYTHON = python2.7
EASYINSTALL = easy_install-2.7
WHICH_PIP = $(shell which pip)
PIP = pip-2.7
GIT = git
#PF_HOST ?= 10.0.4.186
PF_HOST_UNAME ?= OpenBSD
# XXX To work around a bug in nosetests -- which DOESN't point to python2.7,
# only to /usr/bin/python -- we need to use a full path here and call Python
# explicitly.
NOSE = $(PYTHON) $(shell which nosetests-2.7)
VENV = .venv
clean:
rm -rfv dist/ build/ MANIFEST *.egg-info $(REQUIREMENTS)
rm -rfv _trial_temp/ CHECK_THIS_BEFORE_UPLOAD.txt twistd.log
find ./ -name "*~" -exec rm -v {} \;
find ./ -name "*.py[co]" -exec rm -v {} \;
find . -name "*.sw[op]" -exec rm -v {} \;
system-setup:
pw user mod $(USER) -G wheel
install-ports:
portsnap fetch
portsnap extract
update-ports:
portsnap fetch
portsnap update
$(PYTHON):
ifeq ($(UNAME), FreeBSD)
cd /usr/ports/lang/python && make install clean
endif
ifeq ($(UNAME), OpenBSD)
pkg_add -i python
endif
$(GIT):
ifeq ($(UNAME), FreeBSD)
cd /usr/ports/devel/git && make install clean
endif
ifeq ($(UNAME), OpenBSD)
pkg_add -i git
endif
$(DEV_DIR):
mkdir -p $(DEV_DIR)
$(REQUIREMENTS):
$(PYTHON) -c "from akanda import meta;meta.generate_requirements('$(REQUIREMENTS)');"
$(WHICH_PIP):
$(EASYINSTALL) pip
python-deps: $(REQUIREMENTS) $(WHICH_PIP)
$(PIP) install -r $(REQUIREMENTS)
install-dev: $(PYTHON) $(GIT) python-deps
ifeq ($(UNAME), FreeBSD)
@echo "Be sure you have pf enabled on your system:"
@echo " * edit your /etc/rc.conf"
@echo " * add rules to /etc/pf.conf"
@echo " * start pf: sudo /etc/rc.d/pf start"
@echo
@echo "To use the dev targets, you will need to edit your"
@echo "/etc/ssh/sshd_config to allow remote login for root"
@echo "and then you'll need to restart ssh:"
@echo " /etc/rc.d/sshd restart"
@echo
endif
local-dev-deps:
ifeq ($(PF_HOST_UNAME), FreeBSD)
ssh root@$(PF_HOST) "cd /usr/ports/net/rsync && make install clean"
endif
ifeq ($(PF_HOST_UNAME), OpenBSD)
ssh root@$(PF_HOST) "pkg_add -i rsync"
endif
clone-dev:
git push
-ssh root@$(PF_HOST) \
"git clone $(AKANDA_URL) $(AKANDA_DIR)"
push-dev: clone-dev
git push
ssh root@$(PF_HOST) \
"cd $(AKANDA_DIR) && git pull && python setup.py install"
rsync-push-dev: local-dev-deps
rsync -az -e "ssh . root@$(PF_HOST):$(AKANDA_DIR)/"
scp-push-dev:
scp -r . root@$(PF_HOST):$(AKANDA_DIR)/
ssh root@$(PF_HOST) \
"cd $(AKANDA_DIR) && python setup.py install"
check: python-deps
$(PYTHON) $(LIB)/testing/runner.py
check-cover: python-deps
$(NOSE) -v --with-coverage --cover-package=$(LIB) --cover-branches
check-dev:
-make check-cover
-pep8 $(LIB)
-pyflakes $(LIB)
venv: easy_install
virtualenv -p $(shell which $(PYTHON)) $(VENV)
check-venv: setup-venv
. $(VENV)/bin/activate && make check-dev
iso:
"./scripts/create-akanda-livecd.sh"
run-dev:
$(PYTHON) akanda/routerapi/devserver.py
install: python-deps
$(PIP) install .