-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
159 lines (129 loc) · 6.04 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
150
151
152
153
154
155
156
157
158
159
VERSION ?= 2021-10-21
CLIENT_VERSION ?= 2021-02-13
HTTP_SERVER_ORIGIN ?= (src\.quicklisp\.org\|beta\.quicklisp\.org)
HTTP_SERVER ?= localhost:8000
ROSWELL ?= ros
GH_OWNER ?= roswell
GH_REPO ?= quicklisp
include .env
export $(shell sed 's/=.*//' .env)
all: download-archives root/dist/quicklisp-versions.txt setversion
httpd:
cd root;python3 -m http.server &
latest-version:
$(eval VERSION := $(shell curl -L -f -s https://github.com/$(GH_OWNER)/$(GH_REPO)/releases/download/dist/quicklisp.txt |grep "^version:" |sed -E "s/^[^ ]* //g"))
@echo "set version $(VERSION)"
setversion: root/dist/quicklisp/$(VERSION)
cp root/dist/quicklisp/$(VERSION)/distinfo.txt root/dist/quicklisp.txt
size: root/dist/quicklisp/$(VERSION)/releases.tx show
@echo -n "archives(byte)="
@cat $< | grep -v '^#' | awk -v 'OFS= ' '{sum += $$3} END { print sum }'
versions: root/dist/quicklisp-versions.txt
cat $< | sed -E 's#^([^ ]*) .*#\1#g'
quicklisp:
curl -f -L https://github.com/quicklisp/quicklisp-client/archive/refs/tags/version-$(CLIENT_VERSION).tar.gz > qlclient.tgz
tar xf qlclient.tgz
rm qlclient.tgz
mv quicklisp-client-version-$(CLIENT_VERSION) $@
quicklisp/local-init/initial-dist.lisp: quicklisp
mkdir quicklisp/local-init
echo '(defparameter quicklisp:*initial-dist-url* "http://$(HTTP_SERVER)/dist/quicklisp.txt")' > $@
# for test setup client
quicklisp/dist: quicklisp/local-init/initial-dist.lisp
$(ROSWELL) +Q -l quicklisp/setup.lisp
clean:
rm -rf root quicklisp upload
root/dist/quicklisp/$(VERSION):
VERSION=$(VERSION) make \
root/dist/quicklisp/$(VERSION)/systems.txt \
root/dist/quicklisp/$(VERSION)/releases.txt \
root/dist/quicklisp/$(VERSION)/distinfo.txt \
|| rm -rf root/dist/quicklisp/$(VERSION)
update-server-info:
rm -f \
root/dist/quicklisp/$(VERSION)/distinfo.txt \
root/dist/quicklisp-versions.txt
HTTP_SERVER=$(HTTP_SERVER) VERSION=$(VERSION) make \
root/dist/quicklisp/$(VERSION)/distinfo.txt \
root/dist/quicklisp-versions.txt
%.txt: %.tx
cat $< | sed -E "s|$(HTTP_SERVER_ORIGIN)|$(HTTP_SERVER)|g" >$@
root/dist/quicklisp-versions.tx:
curl -f -L -s --create-dirs --output $@ https://github.com/$(GH_OWNER)/$(GH_REPO)/releases/download/dist/quicklisp-versions.tx
root/dist/quicklisp/$(VERSION)/distinfo.tx:
curl -f -L -s --create-dirs --output $@ https://github.com/$(GH_OWNER)/$(GH_REPO)/releases/download/$(VERSION)/distinfo.tx
root/dist/quicklisp/$(VERSION)/systems.txt: root/dist/quicklisp/$(VERSION)/distinfo.tx
curl -f -L -s --create-dirs --output $@ https://github.com/$(GH_OWNER)/$(GH_REPO)/releases/download/$(VERSION)/systems.txt
root/dist/quicklisp/$(VERSION)/releases.tx: root/dist/quicklisp/$(VERSION)/distinfo.tx
curl -f -L -s --create-dirs --output $@ https://github.com/$(GH_OWNER)/$(GH_REPO)/releases/download/$(VERSION)/releases.tx
download-archives: root/dist/quicklisp/$(VERSION)
cat $</releases.tx | \
grep -v '^#' | \
awk -v 'OFS= ' '{print $$2}'| \
sed -E "s#(^http://[^/]+/)(.+)\$$#root/\2#g" | \
xargs -I {} echo "VERSION=$(VERSION) make -s {}"|sh
%.tgz:
@echo $@ | sed -E "s#root/archive/[^/]+/(.+)\$$#curl -f -L -s --create-dirs --output $@ https://github.com/$(GH_OWNER)/$(GH_REPO)/releases/download/\1#g" | sh
@echo $@ | sed -E "s#root/archive/[^/]+/(.+)\$$#cat root/dist/quicklisp/$(VERSION)/releases.tx|grep \1#g"|sh| \
awk -v OFS=' ' '{print $$4}'| \
sed -E "s#(.+)#\1 $@#g"| md5sum -c
check-md5: root/dist/quicklisp/$(VERSION)
@cat $</releases.tx | \
grep -v '^#' | \
awk -v OFS=' ' '{print $$2,$$4}'| \
sed -E "s#(^http://[^/]+/)([^ ]+) ([^ ]+)#\\3 root/\\2#g" | \
md5sum -c | \
grep -v "OK$$"
download-all:
@make -s versions | \
sed -E "s/ .*\$$//g"| \
xargs -I {} echo "VERSION={} make all"|sh
# for CI
upload:
ros install snmsts/sn.github roswell/sbcl_bin
ros build upload.ros
fetch-upload: upload
@echo fetch-upload $(FILE)
@rm -f $(FILE)
@#fetch
@echo $(FILE) | sed -E "s#root/archive/(.+)\$$#curl -f -L -s --create-dirs --output $(FILE) http://beta.quicklisp.org/archive/\1#g"|sh
@#upload
@echo $(FILE) | sed -E "s#root/archive/([^/]+)/([^/]+)/.*\$$#./upload upload $(GH_OWNER) $(GH_REPO) \2 $(FILE) #g"|sh
check-md5-all:
@make -s versions | \
sed -E "s/ .*\$$//g"| \
xargs -I {} echo "VERSION={} make -s check-md5"|sh
download-tx:
curl -f -L -s --create-dirs --output root/quicklisp/$(VERSION)/releases.tx http://beta.quicklisp.org/dist/quicklisp/$(VERSION)/releases.txt
curl -f -L -s --create-dirs --output root/dist/quicklisp/$(VERSION)/systems.txt http://beta.quicklisp.org/dist/quicklisp/$(VERSION)/systems.txt
curl -f -L -s --create-dirs --output root/dist/quicklisp/$(VERSION)/distinfo.tx http://beta.quicklisp.org/dist/quicklisp/$(VERSION)/distinfo.txt
upload-tx:
./upload upload $(GH_OWNER) $(GH_REPO) $(VERSION) root/dist/quicklisp/$(VERSION)/distinfo.tx
./upload upload $(GH_OWNER) $(GH_REPO) $(VERSION) root/dist/quicklisp/$(VERSION)/releases.tx
./upload upload $(GH_OWNER) $(GH_REPO) $(VERSION) root/dist/quicklisp/$(VERSION)/systems.txt
mirror-tx:
echo mirror $(VERSION)
VERSION=$(VERSION) make root/dist/quicklisp/$(VERSION) \
|| VERSION=$(VERSION) make download-tx upload-tx
mirror-all-tx:
@make -s versions | \
sed -E "s/ .*\$$//g"| \
xargs -I {} echo "VERSION={} make -s mirror-tx"|sh
mirror-versions: root/dist/quicklisp-versions.tx
mv root/dist/quicklisp-versions.tx root/dist/quicklisp-versions.tx.bak
curl -f -L -s --create-dirs --output root/dist/quicklisp-versions.tx http://beta.quicklisp.org/dist/quicklisp-versions.txt
diff -u root/dist/quicklisp-versions.tx root/dist/quicklisp-versions.tx.bak \
|| ./upload upload $(GH_OWNER) $(GH_REPO) dist root/dist/quicklisp-versions.tx
rm -f root/dist/quicklisp-versions.tx.bak
mirror-quicklisp: setversion
./upload upload $(GH_OWNER) $(GH_REPO) dist root/dist/quicklisp.txt
mirror-archives: download-archives
@make -s check-md5 | \
sed -E "s/^(.*):[^:]*\$$/\1/g" | \
xargs -I {} echo "FILE={} make fetch-upload"|sh
master-version:
$(eval VERSION := $(shell curl -f -s http://beta.quicklisp.org/dist/quicklisp.txt |grep "^version:" |sed -E "s/^[^ ]* //g"))
@echo "set version $(VERSION)"
show:
@echo version=$(VERSION)
@echo pwd=$(shell pwd)