summaryrefslogtreecommitdiff
path: root/mk/install
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2007-08-20 10:59:05 +0000
committerjoerg <joerg@pkgsrc.org>2007-08-20 10:59:05 +0000
commit651f00f91ea2c0c8607d225b0e5306a6ed9368c7 (patch)
tree1794af425c78f534852acc142cd4d776f78e84bd /mk/install
parentf7d0875e6eb636acb8947535bdb71d0c60ee8f01 (diff)
downloadpkgsrc-651f00f91ea2c0c8607d225b0e5306a6ed9368c7.tar.gz
Add cross-compiling support for bin-install and deinstall targets.
Diffstat (limited to 'mk/install')
-rw-r--r--mk/install/bin-install.mk27
-rw-r--r--mk/install/deinstall.mk11
2 files changed, 35 insertions, 3 deletions
diff --git a/mk/install/bin-install.mk b/mk/install/bin-install.mk
index 83eb54a58a5..ab57a9329d7 100644
--- a/mk/install/bin-install.mk
+++ b/mk/install/bin-install.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bin-install.mk,v 1.10 2007/08/02 18:19:32 joerg Exp $
+# $NetBSD: bin-install.mk,v 1.11 2007/08/20 10:59:05 joerg Exp $
#
# This file provides the following targets:
@@ -55,6 +55,30 @@ release-bin-install-lock: \
release-localbase-lock
locked-su-do-bin-install:
+.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+ ${RUN} \
+ found=`${PKG_BEST_EXISTS} "${PKGWILDCARD}" || ${TRUE}`; \
+ if [ "$$found" != "" ]; then \
+ ${ERROR_MSG} "$$found is already installed - perhaps an older version?"; \
+ ${ERROR_MSG} "If so, you may wish to \`\`pkg_delete $$found'' and install"; \
+ ${ERROR_MSG} "this package again by \`\`${MAKE} bin-install'' to upgrade it properly."; \
+ exit 1; \
+ fi
+ ${RUN} \
+ rel=${_SHORT_UNAME_R:Q}; \
+ arch=${MACHINE_ARCH:Q}; \
+ pkgpath=${PKGREPOSITORY:Q}; \
+ for i in ${BINPKG_SITES}; do \
+ pkgpath="$$pkgpath;$$i/All"; \
+ done; \
+ ${STEP_MSG} "Installing ${PKGNAME} from $$pkgpath"; \
+ if ${SETENV} PKG_PATH="$$pkgpath" ${PKG_ADD} -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${_BIN_INSTALL_FLAGS} ${PKGNAME_REQD:U${PKGNAME}:Q}${PKG_SUFX}; then \
+ ${ECHO} "Fixing recorded cwd..."; \
+ ${SED} -e 's|@cwd ${_CROSS_DESTDIR}|@cwd |' ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS > ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp; \
+ ${MV} ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS; \
+ ${ECHO} "`${PKG_INFO} -e ${PKGNAME_REQD:U${PKGNAME}:Q}` successfully installed."; \
+ fi
+.else
${RUN} \
found=`${PKG_BEST_EXISTS} "${PKGWILDCARD}" || ${TRUE}`; \
if [ "$$found" != "" ]; then \
@@ -74,6 +98,7 @@ locked-su-do-bin-install:
if ${SETENV} PKG_PATH="$$pkgpath" ${PKG_ADD} ${_BIN_INSTALL_FLAGS} ${PKGNAME_REQD:U${PKGNAME}:Q}${PKG_SUFX}; then \
${ECHO} "`${PKG_INFO} -e ${PKGNAME_REQD:U${PKGNAME}:Q}` successfully installed."; \
fi
+.endif
do-bin-install-from-source:
${RUN} ${PKG_INFO} -qe ${PKGNAME} || { \
diff --git a/mk/install/deinstall.mk b/mk/install/deinstall.mk
index a51b1daab6d..b98913efd53 100644
--- a/mk/install/deinstall.mk
+++ b/mk/install/deinstall.mk
@@ -1,4 +1,4 @@
-# $NetBSD: deinstall.mk,v 1.8 2007/03/09 00:39:55 rillig Exp $
+# $NetBSD: deinstall.mk,v 1.9 2007/08/20 10:59:05 joerg Exp $
# DEINSTALLDEPENDS controls whether dependencies and dependents are also
# removed when a package is de-installed. The valid values are:
@@ -16,9 +16,16 @@ DEINSTALLDEPENDS?= no
### It will acquire elevated privileges just-in-time.
###
.PHONY: deinstall su-deinstall
-.if !target(deinstall)
+.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+. if !target(deinstall)
+deinstall: su-deinstall
+ @${PHASE_MSG} "Deinstalling for ${PKGNAME}"
+. endif
+.else
+. if !target(deinstall)
deinstall: su-target
@${PHASE_MSG} "Deinstalling for ${PKGNAME}"
+. endif
.endif
_SU_DEINSTALL_TARGETS= acquire-deinstall-lock