[Midnightbsd-cvs] mports: bsd.mport.mk: Added COPYTREE_* macros from FreeBSD.

ctriv at midnightbsd.org ctriv at midnightbsd.org
Sat Sep 1 01:14:06 EDT 2007


Log Message:
-----------
Added COPYTREE_* macros from FreeBSD.
CPIO is now set to /usr/bin/cpio by default, and to /usr/local/bin/gcpio if
USE_GCPIO is defined.

Modified Files:
--------------
    mports/Mk:
        bsd.mport.mk (r1.59 -> r1.60)

-------------- next part --------------
Index: bsd.mport.mk
===================================================================
RCS file: /home/cvs/mports/Mk/bsd.mport.mk,v
retrieving revision 1.59
retrieving revision 1.60
diff -LMk/bsd.mport.mk -LMk/bsd.mport.mk -u -r1.59 -r1.60
--- Mk/bsd.mport.mk
+++ Mk/bsd.mport.mk
@@ -316,7 +316,7 @@
 #				  files under ${WRKSRC} with one of these names the ^Ms.
 # USE_GCC		- If set, this port requires this version of gcc, either in
 #				  the system or installed from a port.
-# USE_GCPIO		- if set, uses GNU cpio.  Required for ${CPIO} usage.
+# USE_GCPIO		- if set, uses GNU cpio.  Changes the value of ${CPIO}.
 # USE_GMAKE		- If set, this port uses gmake.
 # GMAKE			- Set to path of GNU make if not in $PATH.
 #				  Default: gmake
@@ -1084,7 +1084,11 @@
 CHROOT?=	/usr/sbin/chroot
 COMM?=		/usr/bin/comm
 CP?=		/bin/cp
+.if defined(USE_GCPIO)
 CPIO?=		${LOCALBASE}/bin/gcpio
+.else
+CPIO?=		/usr/bin/cpio
+.endif
 CUT?=		/usr/bin/cut
 DC?=		/usr/bin/dc
 DIALOG?=	/usr/bin/dialog
@@ -2139,6 +2143,32 @@
 MAKE_ENV+=	${INSTALL_MACROS}
 SCRIPTS_ENV+=	${INSTALL_MACROS}
 
+
+
+# Macro for coping entire directory tree with correct permissions
+.if ${UID} == 0
+COPYTREE_BIN=	${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
+					2>&1) && \
+					${CHOWN} -R ${BINOWN}:${BINGRP} $$1 && \
+					${FIND} $$1 -type d -exec chmod 755 {} \; && \
+					${FIND} $$1 -type f -exec chmod ${BINMODE} {} \;' --
+COPYTREE_SHARE=	${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
+					2>&1) && \
+					${CHOWN} -R ${SHAREOWN}:${SHAREGRP} $$1 && \
+					${FIND} $$1/ -type d -exec chmod 755 {} \; && \
+					${FIND} $$1/ -type f -exec chmod ${SHAREMODE} {} \;' --
+.else
+COPYTREE_BIN=	${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
+					2>&1) && \
+					${FIND} $$1 -type d -exec chmod 755 {} \; && \
+					${FIND} $$1 -type f -exec chmod ${BINMODE} {} \;' --
+COPYTREE_SHARE=	${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
+					2>&1) && \
+					${FIND} $$1/ -type d -exec chmod 755 {} \; && \
+					${FIND} $$1/ -type f -exec chmod ${SHAREMODE} {} \;' --
+.endif
+
+
 # The user can override the NO_PACKAGE by specifying this from
 # the make command line
 .if defined(FORCE_PACKAGE)


More information about the Midnightbsd-cvs mailing list