Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jun 2007 13:58:40 GMT
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 122148 for review
Message-ID:  <200706221358.l5MDweMS070469@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=122148

Change 122148 by gabor@gabor_server on 2007/06/22 13:58:32

	- Add DESTDIR_ENV wo hook commonly overridden variable into the
	  chrooted environment.  In this way we can set PREFIX, LOCALBASE,
	  etc. from outside.
	- Move some default variable assignments, this is needed for the
	  former change.

Affected files ...

.. //depot/projects/soc2006/gabor_destdir/Mk/bsd.port.mk#22 edit

Differences ...

==== //depot/projects/soc2006/gabor_destdir/Mk/bsd.port.mk#22 (text+ko) ====

@@ -1089,11 +1089,48 @@
 
 .include "${PORTSDIR}/Mk/bsd.commands.mk"
 
+# These need to be absolute since we don't know how deep in the ports
+# tree we are and thus can't go relative.  They can, of course, be overridden
+# by individual Makefiles or local system make configuration.
+PORTSDIR?=	/usr/ports
+LOCALBASE?=	/usr/local
+X11BASE?=	${LOCALBASE}
+LINUXBASE?=	/compat/linux
+DISTDIR?=	${PORTSDIR}/distfiles
+_DISTDIR?=	${DISTDIR}/${DIST_SUBDIR}
+INDEXDIR?=	${PORTSDIR}
+INDEXFILE?=	INDEX-${OSVERSION:C/([0-9]).*/\1/}
+
+PACKAGES?=	${PORTSDIR}/packages
+TEMPLATES?=	${PORTSDIR}/Templates
+
+.if defined(USE_X_PREFIX)
+PREFIX?=	${X11BASE}
+.elif defined(USE_LINUX_PREFIX)
+PREFIX?=	${LINUXBASE}
+NO_MTREE=	yes
+.else
+PREFIX?=	${LOCALBASE}
+.endif
+
+# where pkg_add records its dirty deeds.
+PKG_DBDIR?=	/var/db/pkg
+
+# where 'make config' records user configuration options
+PORT_DBDIR?=    /var/db/ports
+
 #
 # DESTDIR section to start a chrooted process if invoked with DESTDIR set
 #
 
 .if defined(DESTDIR) && !empty(DESTDIR) && !defined(CHROOTED)
+
+DESTDIR_ENV=	LOCALBASE=${LOCALBASE} LINUXBASE=${LINUXBASE} \
+		X11BASE=${X11BASE} PREFIX=${PREFIX} PORTSDIR=${PORTSDIR} \
+		DISTDIR=${DISTDIR} PACKAGES=${PACKAGES} TEMPLATES=${TEMPLATES} \
+		WRKDIRPREFIX=${WRKDIRPREFIX} PKG_DBDIR=${PKG_DBDIR} \
+		PORT_DBDIR=${PORT_DBDIR} DESTDIR= CHROOTED=YES
+
 .BEGIN:
 	${MKDIR} ${DESTDIR}${PORTSDIR}
 .if !exists(${DESTDIR}${PORTSDIR}/Makefile)
@@ -1103,7 +1140,7 @@
 	${MOUNT} -t devfs devfs ${DESTDIR}/dev
 .endif
 	${ECHO_CMD} "===> Starting chrooted make in ${DESTDIR}..."; \
-	${CHROOT} ${DESTDIR} ${SH} -c "(cd ${.CURDIR}; ${MAKE} DESTDIR= CHROOTED=YES ${.TARGETS})"
+	${CHROOT} ${DESTDIR} ${SH} -c "(cd ${.CURDIR}; ${MAKE} ${DESTDIR_ENV} ${.TARGETS})"
 .else
 
 # Look for ${WRKSRC}/.../*.orig files, and (re-)create
@@ -1229,9 +1266,6 @@
 USE_SUBMAKE=	yes
 .endif
 
-# where 'make config' records user configuration options
-PORT_DBDIR?=	/var/db/ports
-
 LDCONFIG_DIR=	libdata/ldconfig
 LDCONFIG32_DIR=	libdata/ldconfig32
 
@@ -1321,18 +1355,6 @@
 PKGNAME=	${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PKGVERSION}
 DISTNAME?=	${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX}
 
-# These need to be absolute since we don't know how deep in the ports
-# tree we are and thus can't go relative.  They can, of course, be overridden
-# by individual Makefiles or local system make configuration.
-PORTSDIR?=		/usr/ports
-LOCALBASE?=		/usr/local
-X11BASE?=		${LOCALBASE}
-LINUXBASE?=		/compat/linux
-DISTDIR?=		${PORTSDIR}/distfiles
-_DISTDIR?=		${DISTDIR}/${DIST_SUBDIR}
-INDEXDIR?=		${PORTSDIR}
-INDEXFILE?=		INDEX-${OSVERSION:C/([0-9]).*/\1/}
-
 DOCSDIR?=		${PREFIX}/share/doc/${PORTNAME}
 EXAMPLESDIR?=		${PREFIX}/share/examples/${PORTNAME}
 DATADIR?=		${PREFIX}/share/${PORTNAME}
@@ -1373,8 +1395,6 @@
 .else
 EXTRACT_SUFX?=			.tar.gz
 .endif
-PACKAGES?=		${PORTSDIR}/packages
-TEMPLATES?=		${PORTSDIR}/Templates
 
 PATCHDIR?=		${MASTERDIR}/files
 FILESDIR?=		${MASTERDIR}/files
@@ -1390,14 +1410,6 @@
 .if defined(USE_X_PREFIX)
 USE_XLIB=		yes
 .endif
-.if defined(USE_X_PREFIX)
-PREFIX?=		${X11BASE}
-.elif defined(USE_LINUX_PREFIX)
-PREFIX?=		${LINUXBASE}
-NO_MTREE=		yes
-.else
-PREFIX?=		${LOCALBASE}
-.endif
 
 .if defined(USE_LINUX_PREFIX)
 LDCONFIG_CMD?=			${LINUXBASE}/sbin/ldconfig -r ${LINUXBASE}
@@ -2337,8 +2349,6 @@
 .else
 PKG_SUFX?=		.tbz
 .endif
-# where pkg_add records its dirty deeds.
-PKG_DBDIR?=		/var/db/pkg
 
 MOTIFLIB?=	-L${X11BASE}/lib -lXm -lXp
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706221358.l5MDweMS070469>