/
Makefile
149 lines (113 loc) · 3.01 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
PROJ := carapace
LIB := carapace
GITHUB_REPO := github.com:oubiwann/$(PROJ).git
PKG_NAME := $(PROJ)
TMP_FILE ?= /tmp/MSG
VIRT_DIR ?= .venv
keygen:
@python -c "from carapace import app;from carapace.sdk import scripts;scripts.KeyGen()"
run:
twistd -n carapace
daemon:
twistd carapace
shell:
@python -c "from carapace import app;from carapace.sdk import scripts;scripts.ConnectToShell()"
stop:
@python -c "from carapace import app;from carapace.sdk import scripts;scripts.StopDaemon()"
generate-config:
@echo "Generating config..."
@python -c "from carapace import app;from carapace.sdk import scripts;scripts.GenerateConfig();"
import-keys: GAME_USER ?=
import-keys: LP_USER ?=
import-keys:
python -c "from carapace import app;from carapace.sdk import scripts;\
scripts.ImportKeys('$(GAME_USER)', '$(LP_USER)');"
run-test:
make daemon && make shell && make stop
banner:
python -c "from $(LIB) import config; print config.ssh.banner;"
log-concise:
git log --oneline
log-verbose:
git log --format=fuller
log-authors:
git log --format='%aN %aE' --date=short
log-authors-date:
git log --format='%ad %aN %aE' --date=short
log-changes:
git log --format='%ad %n* %B %N%n' --date=short
clean:
sudo rm -rfv dist/ build/ MANIFEST *.egg-info
rm -rfv _trial_temp/ CHECK_THIS_BEFORE_UPLOAD.txt twistd.log
find ./ -name "*~" -exec rm -v {} \;
sudo find ./ -name "*.py[co]" -exec rm -v {} \;
find . -name "*.sw[op]" -exec rm -v {} \;
push:
git push --all git@$(GITHUB_REPO)
push-tags:
git push --tags git@$(GITHUB_REPO)
push-all: push push-tags
.PHONY: push-all
stat:
@echo
@echo "### Git info ###"
@echo
git info
echo
@echo "### Git working branch status ###"
@echo
@git status -s
@echo
@echo "### Git branches ###"
@echo
@git branch
@echo
status: stat
.PHONY: status
todo:
git grep -n -i -2 XXX
git grep -n -i -2 TODO
.PHONY: todo
build-docs:
cd docs/sphinx; make html
check-docs: files = "README.rst"
check-docs:
@echo "noop"
check-examples: files = "examples/*.py"
check-examples:
@echo "noop"
check-dist:
@echo "Need to fill this in ..."
check: build check-docs check-examples
trial $(LIB)
check-integration:
# placeholder for integration tests
.PHONY: check-integration
version:
@echo $(VERSION)
virtual-build: SUB_DIR ?= test-build
virtual-build: DIR ?= $(VIRT_DIR)/$(SUB_DIR)
virtual-build: clean build
mkdir -p $(VIRT_DIR)
-test -d $(DIR) || virtualenv $(DIR)
@. $(DIR)/bin/activate
-test -e $(DIR)/bin/twistd || $(DIR)/bin/pip install twisted
-test -e $(DIR)/bin/rst2html.py || $(DIR)/bin/pip install docutils
$(DIR)/bin/pip uninstall -vy $(PKG_NAME)
rm -rf $(DIR)/lib/python2.7/site-packages/$(PKG_NAME)*
$(DIR)/bin/easy_install-2.7 ./dist/$(PKG_NAME)*
clean-virt: clean
rm -rf $(VIRT_DIR)
virtual-build-clean: clean-virt build virtual-build
.PHONY: virtual-build-clean
build:
python setup.py build
python setup.py sdist
install:
sudo pip install .
uninstall:
sudo pip uninstall carapace
register: clean
python setup.py register
upload: clean check
python setup.py sdist upload --show-response