2008-10-18 08:09:24 +00:00
|
|
|
|
|
|
|
PACKAGE=abuild
|
2009-01-06 15:40:21 +00:00
|
|
|
VERSION:=$(shell awk -F= '$$1 == "abuild_ver" {print $$2}' abuild)
|
2009-01-15 15:48:16 +00:00
|
|
|
USR_BIN_FILES=abuild devbuild mkalpine buildrepo
|
|
|
|
DISTFILES=$(USR_BIN_FILES) Makefile abuild.conf APKBUILD.proto
|
|
|
|
|
2008-10-18 08:09:24 +00:00
|
|
|
|
|
|
|
prefix ?= /usr
|
|
|
|
sysconfdir ?= /etc
|
2009-01-03 10:05:12 +00:00
|
|
|
datadir ?= $(prefix)/share/$(PACKAGE)
|
2008-10-18 08:09:24 +00:00
|
|
|
|
|
|
|
P=$(PACKAGE)-$(VERSION)
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "$(P) makefile"
|
|
|
|
@echo "usage: make install [ DESTDIR=<path> ]"
|
|
|
|
@echo " make dist"
|
|
|
|
|
2009-01-15 15:48:16 +00:00
|
|
|
install: $(USR_BIN_FILES) abuild.conf APKBUILD.proto functions.sh
|
2008-10-30 15:55:25 +00:00
|
|
|
mkdir -p $(DESTDIR)/$(prefix)/bin $(DESTDIR)/$(sysconfdir) \
|
2009-01-03 10:05:12 +00:00
|
|
|
$(DESTDIR)/$(datadir)
|
2009-01-15 15:48:16 +00:00
|
|
|
for i in $(USR_BIN_FILES); do\
|
|
|
|
install -m 755 $$i $(DESTDIR)/$(prefix)/bin/$$i;\
|
|
|
|
done
|
2009-01-19 09:19:20 +00:00
|
|
|
if [ -n "$(DESTDIR)" ] || [ ! -f "/$(sysconfdir)"/abuild.conf ]; then\
|
2009-01-07 18:29:19 +00:00
|
|
|
cp abuild.conf $(DESTDIR)/$(sysconfdir)/; \
|
|
|
|
fi
|
2008-10-30 15:55:25 +00:00
|
|
|
cp APKBUILD.proto $(DESTDIR)/$(prefix)/share/abuild
|
2009-01-03 10:05:12 +00:00
|
|
|
cp functions.sh $(DESTDIR)/$(datadir)/
|
2008-10-18 08:09:24 +00:00
|
|
|
|
2009-01-15 15:48:16 +00:00
|
|
|
dist: $(P).tar.bz2
|
2008-10-18 08:09:24 +00:00
|
|
|
|
2009-01-15 15:48:16 +00:00
|
|
|
$(P).tar.bz2: $(DISTFILES)
|
2008-10-18 08:09:24 +00:00
|
|
|
rm -rf $(P)
|
|
|
|
mkdir -p $(P)
|
|
|
|
cp $(DISTFILES) $(P)/
|
2009-01-15 15:48:16 +00:00
|
|
|
tar -cjf $@ $(P)
|
2008-10-18 08:09:24 +00:00
|
|
|
rm -rf $(P)
|
|
|
|
|
|
|
|
.PHONY: install dist
|