projects/aports·blob v1.8 · refs

41 lines · 1.0 KiB

1
2PACKAGE=abuild
3VERSION:=$(shell awk -F= '$$1 == "abuild_ver" {print $$2}' abuild)
4USR_BIN_FILES=abuild devbuild mkalpine buildrepo
5SAMPLES=sample.APKBUILD sample.initd sample.confd sample.install
6DISTFILES=$(USR_BIN_FILES) $(SAMPLES) Makefile abuild.conf \
7
8
9prefix ?= /usr
10sysconfdir ?= /etc
11datadir ?= $(prefix)/share/$(PACKAGE)
12
13P=$(PACKAGE)-$(VERSION)
14
15help:
16 @echo "$(P) makefile"
17 @echo "usage: make install [ DESTDIR=<path> ]"
18 @echo " make dist"
19
20install: $(USR_BIN_FILES) $(SAMPLES) abuild.conf functions.sh
21 mkdir -p $(DESTDIR)/$(prefix)/bin $(DESTDIR)/$(sysconfdir) \
22 $(DESTDIR)/$(datadir)
23 for i in $(USR_BIN_FILES); do\
24 install -m 755 $$i $(DESTDIR)/$(prefix)/bin/$$i;\
25 done
26 if [ -n "$(DESTDIR)" ] || [ ! -f "/$(sysconfdir)"/abuild.conf ]; then\
27 cp abuild.conf $(DESTDIR)/$(sysconfdir)/; \
28 fi
29 cp $(SAMPLES) $(DESTDIR)/$(prefix)/share/abuild
30 cp functions.sh $(DESTDIR)/$(datadir)/
31
32dist: $(P).tar.bz2
33
34$(P).tar.bz2: $(DISTFILES)
35 rm -rf $(P)
36 mkdir -p $(P)
37 cp $(DISTFILES) $(P)/
38 tar -cjf $@ $(P)
39 rm -rf $(P)
40
41.PHONY: install dist