summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: f64e7b1cfb8cb740362f0f0fbd02640f3e0cff8c (plain) (blame)
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

VERSION = 1.0.1
LUA_VERSION = 5.2
prefix ?= /usr
sharedir ?= $(prefix)/share
luasharedir ?= $(sharedir)/lua/$(LUA_VERSION)
bindir ?= $(prefix)/bin

aportsfiles = \
	abuild.lua \
	apkrepo.lua \
	db.lua \
	dump.lua \
	pkg.lua

binfiles = buildrepo.lua ap.lua

all:
	@echo "To install run:"
	@echo "  make install DESTDIR=<targetroot>"

install: $(addprefix bin/,$(binfiles)) $(addprefix aports/,$(aportsfiles))
	install -d $(DESTDIR)$(luasharedir)/aports \
		$(DESTDIR)$(bindir)
	install -m644 $(addprefix aports/,$(aportsfiles)) \
		$(DESTDIR)$(luasharedir)/aports/
	for file in $(binfiles); do \
		install -m755 bin/$$file $(DESTDIR)$(bindir)/$${file%.lua} || exit 1; \
	done

check: lint

lint:
	luacheck aports bin