-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
80 lines (63 loc) · 1.61 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
#
# Build our css files
#
NODE = node
MKSUMMARY = $(NODE) mksummary.js
JSSTYLE = tools/jsstyle
LESSC = node_modules/less/bin/lessc
LESSDIR = less
LESSOUTDIR = html/css
LESSOUT = $(LESSOUTDIR)/all.css
LESSSOURCE = $(LESSDIR)/all.less
JS_NODE_FILES = \
pkg_server.js \
pkg_index.js
JS_NODE_CHECK = $(JS_NODE_FILES:%.js=%.js.chk)
JS_WEB_DIR = html/js
JS_WEB_FILES = \
pkg_about.js \
pkg_catlist.js \
pkg_search.js \
index.js \
pkg_cat.js \
pkg_info.js \
pkg_set.js
JS_WEB_CHECK = $(JS_WEB_FILES:%.js=$(JS_WEB_DIR)/%.js.chk)
JS_CHECK_FILES += $(JS_NODE_CHECK) $(JS_WEB_CHECK)
SUMMARY_BASE_URL = http://pkgsrc.smartos.org/packages/SmartOS/
SUMMARY_TRAILER = "/All/pkg_summary.bz2"
DATA_DIR = data
DATA_SUMMARY = \
2020Q4-x86_64.summary \
2021Q4-x86_64.summary \
2022Q4-x86_64.summary \
2023Q4-x86_64.summary \
2024Q4-x86_64.summary \
trunk-x86_64.summary \
trunk-tools.summary
DATA_FILES = $(DATA_SUMMARY:%.summary=$(DATA_DIR)/%.json)
%.summary:
mkdir -p data
curl $(SUMMARY_BASE_URL)/`basename $@ .summary | tr '-' '/'`/$(SUMMARY_TRAILER) \
| bunzip2 - > $@
all: $(LESSOUT) $(DATA_FILES)
$(LESSC):
npm install
$(LESSOUT): $(LESSSOURCE) $(LESSC)
$(LESSC) $(LESSSOURCE) $(LESSOUT)
%.json: %.summary
$(MKSUMMARY) $< > $@
%.js.chk: %.js
$(JSSTYLE) $<
clean:
rm -rf $(LESSOUT) $(DATA_DIR)
check: $(JS_CHECK_FILES)
install: all
[[ -n "$(DESTDIR)" ]]
mkdir -p $(DESTDIR)/out
cp $(JS_NODE_FILES) $(DESTDIR)/out
cp -r html data $(DESTDIR)/out
mkdir -p $(DESTDIR)/out/smf
sed 's|@@PREFIX@@|$(DESTDIR)/out|' < smf/pkg_server.xml.in > \
$(DESTDIR)/out/smf/pkg_server.xml
cp -r node_modules $(DESTDIR)/out/