summaryrefslogtreecommitdiff
path: root/devel/gnustep-make
diff options
context:
space:
mode:
authorrh <rh>2009-04-18 23:50:13 +0000
committerrh <rh>2009-04-18 23:50:13 +0000
commit316e5ba55c1a082d68c93a040edb733b35a39a4d (patch)
treea496f45ef165002ddb1f7d90ff942498cdd5d937 /devel/gnustep-make
parent022761c861cc5022423324338ad7b11537137e3b (diff)
downloadpkgsrc-316e5ba55c1a082d68c93a040edb733b35a39a4d.tar.gz
Allow unprivileged builds of projects that do a 'make install' into a work
subdir during the build phase. This fixes PR pkg/36326.
Diffstat (limited to 'devel/gnustep-make')
-rw-r--r--devel/gnustep-make/gnustep.mk37
1 files changed, 33 insertions, 4 deletions
diff --git a/devel/gnustep-make/gnustep.mk b/devel/gnustep-make/gnustep.mk
index 4af2a3f4e66..cb94ef4d272 100644
--- a/devel/gnustep-make/gnustep.mk
+++ b/devel/gnustep-make/gnustep.mk
@@ -1,4 +1,4 @@
-# $NetBSD: gnustep.mk,v 1.12 2009/04/18 03:32:17 rh Exp $
+# $NetBSD: gnustep.mk,v 1.13 2009/04/18 23:50:13 rh Exp $
.if !defined(GNUSTEP_MK)
GNUSTEP_MK= #defined
@@ -48,12 +48,41 @@ SUBST_SED.gnustep_installation_dir+= -e 's|\$$(GNUSTEP_INSTALLATION_DIR)/Librari
SUBST_SED.gnustep_installation_dir+= -e 's|INSTALL_ROOT_DIR|DESTDIR|g'
.endif
+GNUSTEP_FAKE_PRIVILEGED_BUILD?= YES
+
+.if !empty(GNUSTEP_FAKE_PRIVILEGED_BUILD:M[yY][eE][sS])
+post-wrapper: create-gnustep-chown-links
+
+create-gnustep-chown-links:
+ ${ECHO} > ${BUILDLINK_BINDIR}/chown '#!${SH:Q}'
+ ${ECHO} >> ${BUILDLINK_BINDIR}/chown '${CHOWN:Q} "$$@" 2>/dev/null || \'
+ ${ECHO} >> ${BUILDLINK_BINDIR}/chown '${TRUE}'
+ ${ECHO} > ${BUILDLINK_BINDIR}/chgrp '#!${SH:Q}'
+ ${ECHO} >> ${BUILDLINK_BINDIR}/chgrp '${CHGRP:Q} "$$@" 2>/dev/null || \'
+ ${ECHO} >> ${BUILDLINK_BINDIR}/chgrp '${TRUE}'
+ ${ECHO} > ${BUILDLINK_BINDIR}/install '#!${SH:Q}'
+ ${ECHO} >> ${BUILDLINK_BINDIR}/install '${INSTALL:Q} "$$@" 2>/dev/null || \'
+ ${ECHO} >> ${BUILDLINK_BINDIR}/install '${INSTALL:Q} `${ECHO} "$$@" | \
+ ${SED} -e "s/-[og][ ]*[^ ]*//g"`'
+ ${CHMOD} +x ${BUILDLINK_BINDIR}/chown
+ ${CHMOD} +x ${BUILDLINK_BINDIR}/chgrp
+ ${CHMOD} +x ${BUILDLINK_BINDIR}/install
+
+GNUSTEP_INSTALL= ${BUILDLINK_BINDIR}/install
+GNUSTEP_INSTALL_DATA= ${INSTALL_DATA:S/${INSTALL}/${GNUSTEP_INSTALL}/}
+GNUSTEP_INSTALL_PROGRAM=${INSTALL_PROGRAM:S/${INSTALL}/${GNUSTEP_INSTALL}/}
+.else
+GNUSTEP_INSTALL= ${INSTALL}
+GNUSTEP_INSTALL_DATA= ${INSTALL_DATA}
+GNUSTEP_INSTALL_PROGRAM=${INSTALL_PROGRAM}
+.endif
+
GNUSTEP_OVERRIDE_INSTALL?= YES
.if !empty(GNUSTEP_OVERRIDE_INSTALL:M[yY][eE][sS])
-MAKE_ENV+= INSTALL=${INSTALL:Q}
-MAKE_ENV+= INSTALL_PROGRAM=${INSTALL_PROGRAM:Q}
-MAKE_ENV+= INSTALL_DATA=${INSTALL_DATA:Q}
+MAKE_ENV+= INSTALL=${GNUSTEP_INSTALL:Q}
+MAKE_ENV+= INSTALL_DATA=${GNUSTEP_INSTALL_DATA:Q}
+MAKE_ENV+= INSTALL_PROGRAM=${GNUSTEP_INSTALL_PROGRAM:Q}
.endif
.if !defined(NO_GNUSTEP_ENV)