Mk: refactor install/plist code a wee bit

This commit is contained in:
Franco Fichtner 2015-07-26 16:42:23 +02:00
parent 9890172c6e
commit bd23c117f5
3 changed files with 21 additions and 28 deletions

15
Mk/tree.mk Normal file
View File

@ -0,0 +1,15 @@
all:
install:
.for TREE in ${TREES}
@mkdir -p ${DESTDIR}${ROOT}
@cp -vr ${TREE} ${DESTDIR}${ROOT}
.endfor
plist:
.for TREE in ${TREES}
@(cd ${TREE}; find * -type f) | \
xargs -n1 printf "${ROOT}/${TREE}/%s\n"
.endfor
.PHONY: install plist

View File

@ -1,16 +1,4 @@
all:
ROOT= /usr/local/share
TREES= openvpn mobile-broadband-provider-info
install:
@mkdir -p ${DESTDIR}/usr/local/share
@cp -vr ${.CURDIR}/openvpn ${DESTDIR}/usr/local/share/
@cp -vr ${.CURDIR}/mobile-broadband-provider-info \
${DESTDIR}/usr/local/share/
plist:
@(cd ${.CURDIR}/openvpn; find * -type f) | \
xargs -n1 printf "/usr/local/share/openvpn/%s\n"
@(cd ${.CURDIR}/mobile-broadband-provider-info; find * -type f) | \
xargs -n1 printf \
"/usr/local/share/mobile-broadband-provider-info/%s\n"
.PHONY: install plist
.include "../Mk/tree.mk"

View File

@ -1,14 +1,4 @@
all:
ROOT= /usr/local/etc/pkg
TREES= repos fingerprints
install:
@mkdir -p ${DESTDIR}/usr/local/etc/pkg
@cp -vr ${.CURDIR}/repos ${DESTDIR}/usr/local/etc/pkg/
@cp -vr ${.CURDIR}/fingerprints ${DESTDIR}/usr/local/etc/pkg/
plist:
@(cd ${.CURDIR}/repos; find * -type f) | \
xargs -n1 printf "/usr/local/etc/pkg/repos/%s\n"
@(cd ${.CURDIR}/fingerprints; find * -type f) | \
xargs -n1 printf "/usr/local/etc/pkg/fingerprints/%s\n"
.PHONY: install plist
.include "../Mk/tree.mk"