diff --git a/Mk/tree.mk b/Mk/tree.mk new file mode 100644 index 000000000..11f83e909 --- /dev/null +++ b/Mk/tree.mk @@ -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 diff --git a/contrib/Makefile b/contrib/Makefile index 0db5ba2f2..e7aa3d349 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -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" diff --git a/pkg/Makefile b/pkg/Makefile index a14de366e..a111503e0 100644 --- a/pkg/Makefile +++ b/pkg/Makefile @@ -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"