-
Notifications
You must be signed in to change notification settings - Fork 1
/
devpi
58 lines (48 loc) · 1.49 KB
/
devpi
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
# set up a devpi server (in ~/.devpi/)
name = net.devpi.devpi-server
plist = $(HOME)/Library/LaunchAgents/$(name).plist
dir = $(HOME)/.devpi
setup: devpi = $(dir)/bin/devpi
setup: $(dir)/bin/devpi $(dir)/server/.secret
$(devpi) use http://localhost:3141/
$(devpi) user -c $(LOGNAME) password=
$(devpi) login $(LOGNAME) --password=
$(devpi) index -c dev bases=root/pypi
$(devpi) use $(LOGNAME)/dev
$(dir)/server/.secret: $(dir)/bin/devpi-server $(dir)/server/.serverversion $(plist)
launchctl load -w $(plist)
sleep 5
$(dir)/server/.serverversion: $(dir)/bin/devpi-server
$(dir)/bin/devpi-server --serverdir $(dir)/server --init
$(dir)/bin/devpi: $(dir)/bin/pip
$(dir)/bin/pip install -i https://pypi.python.org/simple/ devpi-client
$(dir)/bin/devpi-server: $(dir)/bin/pip
$(dir)/bin/pip install -i https://pypi.python.org/simple/ devpi-server devpi-web
$(dir)/bin/pip:
virtualenv --clear $(dir)
$(plist):
echo "$$plist_contents" > $@
define plist_contents
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>$(name)</string>
<key>ProgramArguments</key>
<array>
<string>$(dir)/bin/devpi-server</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>$(dir)</string>
<key>StandardErrorPath</key>
<string>$(dir)/log.txt</string>
</dict>
</plist>
endef
export plist_contents
.PHONY: setup