File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed
Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ PACKAGE = fluent
2+ VERSION != git describe --tags --all --abbrev=7 | sed 's/-/-r/'
3+ SEMVER != git describe --tags | sed 's/^v//;s/-.*//'
4+ ROCKREV = 0
5+ TAG = v$(SEMVER )
6+
7+ LUAROCKS_ARGS ?= --local --tree lua_modules
8+
9+ SCM_ROCK = $(PACKAGE ) -scm-0.rockspec
10+ REL_ROCK = rockspecs/$(PACKAGE ) -$(SEMVER ) -$(ROCKREV ) .rockspec
11+ SCM_SRC = $(PACKAGE ) -scm-0.src.rock
12+ REL_SRC = $(PACKAGE ) -$(SEMVER ) -$(ROCKREV ) .src.rock
13+
14+ .PHONY : all
15+ all : $(SCM_ROCK ) $(SCM_SRC )
16+
17+ .PHONY : dist
18+ dist : $(REL_ROCK ) $(REL_SRC )
19+
20+ .PHONY : install
21+ install :
22+ luarocks $(LUAROCKS_ARGS ) make $(SCM_ROCK )
23+
24+ define rockpec_template =
25+ sed -e "s/@SEMVER@/$(SEMVER ) /g" \
26+ -e "s/@ROCKREV@/$(ROCKREV ) /g" \
27+ -e "s/@TAG@/$(TAG ) /g" \
28+ $< > $@
29+ endef
30+
31+ $(SCM_ROCK ) : SEMVER = scm
32+ $(SCM_ROCK ) : TAG = master
33+ $(SCM_ROCK ) : $(PACKAGE ) .rockspec.in
34+ $(rockpec_template )
35+
36+ rockspecs/$(PACKAGE ) -% -0.rockspec : SEMVER = $*
37+ rockspecs/$(PACKAGE ) -% -0.rockspec : TAG = v$*
38+ rockspecs/$(PACKAGE ) -% -0.rockspec : $(PACKAGE ) .rockspec.in
39+ $(rockpec_template )
40+
41+ $(PACKAGE ) -scm-0.src.rock : $(SCM_ROCK )
42+ luarocks $(LUAROCKS_ARGS ) pack $<
43+
44+ $(PACKAGE ) -% .src.rock : rockspecs/$(PACKAGE ) -% .rockspec
45+ luarocks $(LUAROCKS_ARGS ) pack $<
46+
47+ .PHONY : check
48+ check :
49+ luacheck .
50+
51+ .PHONY : test
52+ test :
53+ busted
You can’t perform that action at this time.
0 commit comments