summaryrefslogtreecommitdiff
path: root/mk/plist
diff options
context:
space:
mode:
authorjoerg <joerg>2006-10-09 12:25:44 +0000
committerjoerg <joerg>2006-10-09 12:25:44 +0000
commit70ea314088a4fe4c4bbcc3ccab10c4a1e47a18a5 (patch)
tree9814d8b785561d4625d3535aa344ea9c5b84ef85 /mk/plist
parent425c7ce9c7743b6870d601017456d062add968cb (diff)
downloadpkgsrc-70ea314088a4fe4c4bbcc3ccab10c4a1e47a18a5.tar.gz
Main infrastructure for DESTDIR support.
Packages may set PKG_DESTDIR_SUPPORT to either "destdir" or "user-destdir" to flag support for this, following the same rules as PKG_INSTALLATION_TYPES (e.g. define before first include of bsd.prefs.mk). The user activates it via USE_DESTDIR. When set to "yes", packages with "user-destdir" are handled as "destdir". The installation of the package will not go to ${LOCALBASE}, but a subdirectory of ${WRKDIR} instead. pre/post install scripts are not run and the package is not registered either. A binary package can be created instead to be installed normally with pkg_add. For "user-destdir" packages, everything is run as normal user and ownership is supposed to be correctled by pkg_create later. Since the current pkg_install code uses pax and it doesn't allow overwriting owners, this does not work yet. For "destdir" packages, installation, packaging and cleaning is run as root. This commit does not change the handling of DEPENDS_TARGET or bin-install to allow recursive usage.
Diffstat (limited to 'mk/plist')
-rw-r--r--mk/plist/plist.mk12
-rw-r--r--mk/plist/print-plist.mk14
2 files changed, 13 insertions, 13 deletions
diff --git a/mk/plist/plist.mk b/mk/plist/plist.mk
index 3b0e3101140..ed9948c4b40 100644
--- a/mk/plist/plist.mk
+++ b/mk/plist/plist.mk
@@ -1,4 +1,4 @@
-# $NetBSD: plist.mk,v 1.15 2006/07/21 13:40:27 jlam Exp $
+# $NetBSD: plist.mk,v 1.16 2006/10/09 12:25:44 joerg Exp $
#
# This Makefile fragment handles the creation of PLISTs for use by
# pkg_create(8).
@@ -102,7 +102,7 @@ _PLIST_AWK_ENV+= LS=${TOOLS_LS:Q}
_PLIST_AWK_ENV+= MANINSTALL=${MANINSTALL:Q}
_PLIST_AWK_ENV+= MANZ=${_MANZ:Q}
_PLIST_AWK_ENV+= PKGMANDIR=${PKGMANDIR:Q}
-_PLIST_AWK_ENV+= PREFIX=${PREFIX:Q}
+_PLIST_AWK_ENV+= PREFIX=${DESTDIR:Q}${PREFIX:Q}
_PLIST_AWK_ENV+= TEST=${TOOLS_TEST:Q}
# PLIST_SUBST contains package-settable "${variable}" to "value"
@@ -205,13 +205,13 @@ _PLIST_IGNORE_CMD= \
[ "$$ignore" = "yes" ] || ${ECHO} "$$i"; \
done )
_GENERATE_PLIST= \
- ${FIND} ${PREFIX} \! -type d -print | ${SORT} | \
- ${SED} -e "s|^${PREFIX}/||" | \
+ ${FIND} ${DESTDIR}${PREFIX} \! -type d -print | ${SORT} | \
+ ${SED} -e "s|^${DESTDIR}${PREFIX}/||" | \
${_PLIST_IGNORE_CMD}; \
- ${FIND} ${PREFIX} -type d -print | ${SORT} -r | \
+ ${FIND} ${DESTDIR}${PREFIX} -type d -print | ${SORT} -r | \
${GREP} -v "^${PREFIX}$$" | \
${_PLIST_IGNORE_CMD} | \
- ${SED} -e "s|^${PREFIX}/|@unexec ${RMDIR} -p %D/|" \
+ ${SED} -e "s|^${DESTDIR}${PREFIX}/|@unexec ${RMDIR} -p %D/|" \
-e "s,$$, 2>/dev/null || ${TRUE},";
.else
_GENERATE_PLIST= ${CAT} ${PLIST_SRC}; \
diff --git a/mk/plist/print-plist.mk b/mk/plist/print-plist.mk
index 1fb2ae6d22e..332c3f170c5 100644
--- a/mk/plist/print-plist.mk
+++ b/mk/plist/print-plist.mk
@@ -1,4 +1,4 @@
-# $NetBSD: print-plist.mk,v 1.9 2006/07/07 21:24:29 jlam Exp $
+# $NetBSD: print-plist.mk,v 1.10 2006/10/09 12:25:44 joerg Exp $
###
### Automatic PLIST generation
@@ -76,9 +76,9 @@ _PRINT_PLIST_COMMON_DIRS!= ${AWK} 'BEGIN { \
# XXX should check $LOCALBASE and $X11BASE, and add @cwd statements
_PRINT_PLIST_FILES_CMD= \
- ${FIND} ${PREFIX}/. -xdev -newer ${_COOKIE.extract} \! -type d -print
+ ${FIND} ${DESTDIR}${PREFIX}/. -xdev -newer ${_COOKIE.extract} \! -type d -print
_PRINT_PLIST_DIRS_CMD= \
- ${FIND} ${PREFIX}/. -xdev -newer ${_COOKIE.extract} -type d -print
+ ${FIND} ${DESTDIR}${PREFIX}/. -xdev -newer ${_COOKIE.extract} -type d -print
.if !empty(LIBTOOLIZE_PLIST:M[yY][eE][sS])
_PRINT_PLIST_LIBTOOLIZE_FILTER?= \
@@ -124,7 +124,7 @@ print-PLIST:
| ${_PRINT_PLIST_LIBTOOLIZE_FILTER} \
| ${SORT} \
| ${AWK} ' \
- { sub("${PREFIX}/\\./", ""); } \
+ { sub("${DESTDIR}${PREFIX}/\\./", ""); } \
${_PRINT_PLIST_AWK_IGNORE} { next; } \
${PRINT_PLIST_AWK} \
${_PRINT_PLIST_AWK_SUBST} \
@@ -153,16 +153,16 @@ print-PLIST:
| ${SORT} -r \
| ${AWK} ' \
/emul\/linux\/proc/ { next; } \
- /${PREFIX:S|/|\\/|g}\/\.$$/ { next; } \
+ /${DESTDIR:S|/|\\/|g}${PREFIX:S|/|\\/|g}\/\.$$/ { next; } \
/${PKG_DBDIR:S|/|\\/|g}\// { next; } \
- { sub("${PREFIX}/\\\\./", ""); } \
+ { sub("${DESTDIR}${PREFIX}/\\\\./", ""); } \
{ sub("^${PKGINFODIR}/", "info/"); } \
{ sub("^${PKGMANDIR}/", "man/"); } \
/^${PKG_DBDIR:S|^${PREFIX}/||:S|/|\\/|g}(\/|$$)/ { next; } \
/^${PKGINFODIR:S|/|\\/|g}$$/ { next; } \
${_PRINT_PLIST_COMMON_DIRS}'` ; \
do \
- if [ `${LS} -la ${PREFIX}/$$i | ${WC} -l` = 3 ]; then \
+ if [ `${LS} -la ${DESTDIR}${PREFIX}/$$i | ${WC} -l` = 3 ]; then \
${ECHO} @exec \$${MKDIR} %D/$$i | ${AWK} ' \
${PRINT_PLIST_AWK} \
{ print $$0; }' ; \