abuild/Makefile

41 lines
1010 B
Makefile
Raw Normal View History

2008-10-18 08:09:24 +00:00
PACKAGE=abuild
VERSION:=$(shell awk -F= '$$1 == "abuild_ver" {print $$2}' abuild)
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"
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)
for i in $(USR_BIN_FILES); do\
install -m 755 $$i $(DESTDIR)/$(prefix)/bin/$$i;\
done
if [ -n "$(DESTDIR)" ] || [ ! -f "/$(sysconfdir)"/abuild.conf ]; then\
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
dist: $(P).tar.bz2
2008-10-18 08:09:24 +00:00
$(P).tar.bz2: $(DISTFILES)
2008-10-18 08:09:24 +00:00
rm -rf $(P)
mkdir -p $(P)
cp $(DISTFILES) $(P)/
tar -cjf $@ $(P)
2008-10-18 08:09:24 +00:00
rm -rf $(P)
.PHONY: install dist