Remove support for USE_DESTDIR=no.diff -r1.384 -r1.385 pkgsrc/mk/bsd.prefs.mk
(joerg)
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: bsd.prefs.mk,v 1.384 2016/04/10 15:10:12 joerg Exp $ | 1 | # $NetBSD: bsd.prefs.mk,v 1.385 2016/04/10 15:58:02 joerg Exp $ | |
2 | # | 2 | # | |
3 | # This file includes the mk.conf file, which contains the user settings. | 3 | # This file includes the mk.conf file, which contains the user settings. | |
4 | # | 4 | # | |
5 | # Packages should include this file before any of the .if directives, as | 5 | # Packages should include this file before any of the .if directives, as | |
6 | # well as before modifying variables like CFLAGS, LDFLAGS, and so on. | 6 | # well as before modifying variables like CFLAGS, LDFLAGS, and so on. | |
7 | # Otherwise the behavior may be unexpected. | 7 | # Otherwise the behavior may be unexpected. | |
8 | # | 8 | # | |
9 | # When mk.conf is included by this file, the following variables are | 9 | # When mk.conf is included by this file, the following variables are | |
10 | # defined: | 10 | # defined: | |
11 | # | 11 | # | |
12 | # ACCEPTABLE_LICENSES | 12 | # ACCEPTABLE_LICENSES | |
13 | # This variable is set to the list of Open Source licenses. See | 13 | # This variable is set to the list of Open Source licenses. See | |
14 | # mk/license.mk for details. | 14 | # mk/license.mk for details. | |
@@ -395,57 +395,50 @@ NO_CONFIGURE= yes | @@ -395,57 +395,50 @@ NO_CONFIGURE= yes | |||
395 | NO_BUILD= yes | 395 | NO_BUILD= yes | |
396 | DISTFILES= # none | 396 | DISTFILES= # none | |
397 | PLIST_SRC= # none | 397 | PLIST_SRC= # none | |
398 | CHECK_PERMS= no | 398 | CHECK_PERMS= no | |
399 | USE_LANGUAGES= # empty | 399 | USE_LANGUAGES= # empty | |
400 | WRKSRC= ${WRKDIR} | 400 | WRKSRC= ${WRKDIR} | |
401 | 401 | |||
402 | do-patch: | 402 | do-patch: | |
403 | @${DO_NADA} | 403 | @${DO_NADA} | |
404 | do-install: | 404 | do-install: | |
405 | @${DO_NADA} | 405 | @${DO_NADA} | |
406 | .endif | 406 | .endif | |
407 | 407 | |||
408 | # After 2011Q1, the default is to use DESTDIR. | |||
409 | USE_DESTDIR?= yes | |||
410 | # PKG_DESTDIR_SUPPORT can only be one of "destdir", or "user-destdir". | 408 | # PKG_DESTDIR_SUPPORT can only be one of "destdir", or "user-destdir". | |
411 | PKG_DESTDIR_SUPPORT?= user-destdir | 409 | PKG_DESTDIR_SUPPORT?= user-destdir | |
412 | 410 | |||
413 | .if ${PKG_DESTDIR_SUPPORT} == "user-destdir" | 411 | .if ${PKG_DESTDIR_SUPPORT} == "user-destdir" | |
414 | _USE_DESTDIR= user-destdir | 412 | _USE_DESTDIR= user-destdir | |
415 | .elif ${PKG_DESTDIR_SUPPORT} == "destdir" | 413 | .elif ${PKG_DESTDIR_SUPPORT} == "destdir" | |
416 | _USE_DESTDIR= destdir | 414 | _USE_DESTDIR= destdir | |
417 | .else | 415 | .else | |
418 | PKG_FAIL_REASON+= "PKG_DESTDIR_SUPPORT must be \`\`destdir'' or \`\`user-destdir''." | 416 | PKG_FAIL_REASON+= "PKG_DESTDIR_SUPPORT must be \`\`destdir'' or \`\`user-destdir''." | |
419 | .endif | 417 | .endif | |
420 | 418 | |||
421 | # When using staged installation, everything gets installed into | 419 | # When using staged installation, everything gets installed into | |
422 | # ${DESTDIR}${PREFIX} instead of ${PREFIX} directly. | 420 | # ${DESTDIR}${PREFIX} instead of ${PREFIX} directly. | |
423 | # | 421 | # | |
424 | .if ${_USE_DESTDIR} != "no" | |||
425 | DESTDIR= ${WRKDIR}/.destdir | 422 | DESTDIR= ${WRKDIR}/.destdir | |
426 | . if ${_USE_DESTDIR} == "destdir" | 423 | .if ${_USE_DESTDIR} == "destdir" | |
427 | _MAKE_PACKAGE_AS_ROOT= yes | 424 | _MAKE_PACKAGE_AS_ROOT= yes | |
428 | _MAKE_CLEAN_AS_ROOT= yes | 425 | _MAKE_CLEAN_AS_ROOT= yes | |
429 | _MAKE_INSTALL_AS_ROOT= yes | 426 | _MAKE_INSTALL_AS_ROOT= yes | |
430 | . elif ${_USE_DESTDIR} == "user-destdir" | 427 | .else | |
431 | _MAKE_PACKAGE_AS_ROOT= no | 428 | _MAKE_PACKAGE_AS_ROOT= no | |
432 | _MAKE_CLEAN_AS_ROOT= no | 429 | _MAKE_CLEAN_AS_ROOT= no | |
433 | _MAKE_INSTALL_AS_ROOT= no | 430 | _MAKE_INSTALL_AS_ROOT= no | |
434 | . endif | 431 | . endif | |
435 | .else | |||
436 | PKG_FAIL_REASON+= "USE_DESTDIR=no is no longer supported." | |||
437 | DESTDIR= | |||
438 | .endif | |||
439 | 432 | |||
440 | # controls whether binary packages are preserved in pkgsrc/packages/All | 433 | # controls whether binary packages are preserved in pkgsrc/packages/All | |
441 | # default is no (to preserve settings since 2013/05/23, prior to that it | 434 | # default is no (to preserve settings since 2013/05/23, prior to that it | |
442 | # was yes) | 435 | # was yes) | |
443 | _KEEP_BIN_PKGS?= no | 436 | _KEEP_BIN_PKGS?= no | |
444 | .if !empty(PKGSRC_KEEP_BIN_PKGS:U:M[Yy][Ee][Ss]) | 437 | .if !empty(PKGSRC_KEEP_BIN_PKGS:U:M[Yy][Ee][Ss]) | |
445 | _KEEP_BIN_PKGS= yes | 438 | _KEEP_BIN_PKGS= yes | |
446 | .endif | 439 | .endif | |
447 | 440 | |||
448 | _MAKE_CLEAN_AS_ROOT?= no | 441 | _MAKE_CLEAN_AS_ROOT?= no | |
449 | # Whether to run the clean target as root. | 442 | # Whether to run the clean target as root. | |
450 | _MAKE_INSTALL_AS_ROOT?= yes | 443 | _MAKE_INSTALL_AS_ROOT?= yes | |
451 | # Whether to run the install target as root. | 444 | # Whether to run the install target as root. |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: haskell.mk,v 1.3 2015/02/17 13:57:47 joerg Exp $ | 1 | # $NetBSD: haskell.mk,v 1.4 2016/04/10 15:58:02 joerg Exp $ | |
2 | # | 2 | # | |
3 | # This Makefile fragment handles Haskell Cabal packages. | 3 | # This Makefile fragment handles Haskell Cabal packages. | |
4 | # See: http://www.haskell.org/cabal/ | 4 | # See: http://www.haskell.org/cabal/ | |
5 | # | 5 | # | |
6 | # Note to users: | 6 | # Note to users: | |
7 | # | 7 | # | |
8 | # * Users choose one favourite Haskell compiler. Though the only | 8 | # * Users choose one favourite Haskell compiler. Though the only | |
9 | # compiler currently supported is GHC. | 9 | # compiler currently supported is GHC. | |
10 | # | 10 | # | |
11 | # * You can't install a cabal package for more than one compilers | 11 | # * You can't install a cabal package for more than one compilers | |
12 | # simultaneously. In the future, this limitation can possibly be | 12 | # simultaneously. In the future, this limitation can possibly be | |
13 | # eliminated using the method used by | 13 | # eliminated using the method used by | |
14 | # "../../lang/python/pyversion.mk". | 14 | # "../../lang/python/pyversion.mk". | |
@@ -238,37 +238,30 @@ do-build: | @@ -238,37 +238,30 @@ do-build: | |||
238 | ./Setup build | 238 | ./Setup build | |
239 | .if ${HASKELL_ENABLE_HADDOCK_DOCUMENTATION} == "yes" | 239 | .if ${HASKELL_ENABLE_HADDOCK_DOCUMENTATION} == "yes" | |
240 | ${RUN} cd ${WRKSRC} && \ | 240 | ${RUN} cd ${WRKSRC} && \ | |
241 | ./Setup haddock | 241 | ./Setup haddock | |
242 | .endif | 242 | .endif | |
243 | 243 | |||
244 | # Define install target. We need installed-pkg-config to be installed | 244 | # Define install target. We need installed-pkg-config to be installed | |
245 | # for package registration (if any). | 245 | # for package registration (if any). | |
246 | _HASKELL_PKG_DESCR_FILE= ${PREFIX}/lib/${DISTNAME}/${_HASKELL_VERSION}/package-description | 246 | _HASKELL_PKG_DESCR_FILE= ${PREFIX}/lib/${DISTNAME}/${_HASKELL_VERSION}/package-description | |
247 | 247 | |||
248 | do-install: | 248 | do-install: | |
249 | ${RUN} cd ${WRKSRC} && \ | 249 | ${RUN} cd ${WRKSRC} && \ | |
250 | ./Setup register --gen-pkg-config=dist/package-description && \ | 250 | ./Setup register --gen-pkg-config=dist/package-description && \ | |
251 | if [ "${_USE_DESTDIR}" = "no" ]; then \ | 251 | ./Setup copy --destdir=${DESTDIR} && \ | |
252 | ./Setup copy && \ | 252 | if [ -f dist/package-description ]; then \ | |
253 | if [ -f dist/package-description ]; then \ | 253 | ${INSTALL_DATA} dist/package-description ${DESTDIR}${_HASKELL_PKG_DESCR_FILE}; \ | |
254 | ${INSTALL_DATA} dist/package-description ${_HASKELL_PKG_DESCR_FILE}; \ | 254 | fi \ | |
255 | fi \ | |||
256 | else \ | |||
257 | ./Setup copy --destdir=${DESTDIR} && \ | |||
258 | if [ -f dist/package-description ]; then \ | |||
259 | ${INSTALL_DATA} dist/package-description ${DESTDIR}${_HASKELL_PKG_DESCR_FILE}; \ | |||
260 | fi \ | |||
261 | fi | |||
262 | 255 | |||
263 | # Define test target. | 256 | # Define test target. | |
264 | do-test: | 257 | do-test: | |
265 | ${RUN} cd ${WRKSRC} && \ | 258 | ${RUN} cd ${WRKSRC} && \ | |
266 | ./Setup test | 259 | ./Setup test | |
267 | 260 | |||
268 | # Substitutions for INSTALL and DEINSTALL. | 261 | # Substitutions for INSTALL and DEINSTALL. | |
269 | FILES_SUBST+= DISTNAME=${DISTNAME} | 262 | FILES_SUBST+= DISTNAME=${DISTNAME} | |
270 | FILES_SUBST+= HASKELL_PKG_BIN=${_HASKELL_PKG_BIN} | 263 | FILES_SUBST+= HASKELL_PKG_BIN=${_HASKELL_PKG_BIN} | |
271 | FILES_SUBST+= HASKELL_PKG_DESCR_FILE=${_HASKELL_PKG_DESCR_FILE} | 264 | FILES_SUBST+= HASKELL_PKG_DESCR_FILE=${_HASKELL_PKG_DESCR_FILE} | |
272 | 265 | |||
273 | INSTALL_TEMPLATES+= ../../mk/haskell/INSTALL.in | 266 | INSTALL_TEMPLATES+= ../../mk/haskell/INSTALL.in | |
274 | DEINSTALL_TEMPLATES+= ../../mk/haskell/DEINSTALL.in | 267 | DEINSTALL_TEMPLATES+= ../../mk/haskell/DEINSTALL.in |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: bsd.build-vars.mk,v 1.10 2016/03/10 16:58:19 jperkin Exp $ | 1 | # $NetBSD: bsd.build-vars.mk,v 1.11 2016/04/10 15:58:02 joerg Exp $ | |
2 | # | 2 | # | |
3 | # Package-settable variables: | 3 | # Package-settable variables: | |
4 | # | 4 | # | |
5 | # BUILD_DIRS is the list of directories in which to perform the build | 5 | # BUILD_DIRS is the list of directories in which to perform the build | |
6 | # process. If the directories are relative paths, then they | 6 | # process. If the directories are relative paths, then they | |
7 | # are assumed to be relative to ${WRKSRC}. | 7 | # are assumed to be relative to ${WRKSRC}. | |
8 | # | 8 | # | |
9 | # MAKE_ENV is the shell environment that is exported to the make | 9 | # MAKE_ENV is the shell environment that is exported to the make | |
10 | # process. | 10 | # process. | |
11 | # | 11 | # | |
12 | # MAKE_FLAGS is a list of arguments that is pass to the make process. | 12 | # MAKE_FLAGS is a list of arguments that is pass to the make process. | |
13 | # | 13 | # | |
14 | # MAKE_FILE is the path to the makefile that is processed by the make | 14 | # MAKE_FILE is the path to the makefile that is processed by the make | |
@@ -40,14 +40,13 @@ MAKE_ENV+= PKGINFODIR=${PKGINFODIR:Q} | @@ -40,14 +40,13 @@ MAKE_ENV+= PKGINFODIR=${PKGINFODIR:Q} | |||
40 | MAKE_ENV+= PKGGNUDIR=${PKGGNUDIR:Q} | 40 | MAKE_ENV+= PKGGNUDIR=${PKGGNUDIR:Q} | |
41 | 41 | |||
42 | # Provide a consistent environment for packages using (Net)BSD-style | 42 | # Provide a consistent environment for packages using (Net)BSD-style | |
43 | # Makefiles. | 43 | # Makefiles. | |
44 | # | 44 | # | |
45 | MAKE_ENV+= MAKECONF=${PKGMAKECONF:U/dev/null} | 45 | MAKE_ENV+= MAKECONF=${PKGMAKECONF:U/dev/null} | |
46 | MAKE_ENV+= OBJECT_FMT=${OBJECT_FMT:Q} | 46 | MAKE_ENV+= OBJECT_FMT=${OBJECT_FMT:Q} | |
47 | MAKE_ENV+= ${USETOOLS:DUSETOOLS=${USETOOLS:Q}} | 47 | MAKE_ENV+= ${USETOOLS:DUSETOOLS=${USETOOLS:Q}} | |
48 | 48 | |||
49 | # Add these bits to the environment used when invoking the recursive make | 49 | # Add these bits to the environment used when invoking the recursive make | |
50 | # processes for build-related phases. | 50 | # processes for build-related phases. | |
51 | # | 51 | # | |
52 | PKGSRC_MAKE_ENV+= PATH=${PATH:Q} | 52 | PKGSRC_MAKE_ENV+= PATH=${PATH:Q} | |
53 | PKGSRC_MAKE_ENV+= USE_DESTDIR=${USE_DESTDIR:Q} |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: check-shlibs.mk,v 1.28 2015/11/24 09:41:20 jperkin Exp $ | 1 | # $NetBSD: check-shlibs.mk,v 1.29 2016/04/10 15:58:02 joerg Exp $ | |
2 | # | 2 | # | |
3 | # This file verifies that all libraries used by the package can be found | 3 | # This file verifies that all libraries used by the package can be found | |
4 | # at run-time. | 4 | # at run-time. | |
5 | # | 5 | # | |
6 | # User-settable variables: | 6 | # User-settable variables: | |
7 | # | 7 | # | |
8 | # CHECK_SHLIBS | 8 | # CHECK_SHLIBS | |
9 | # Whether the check should be enabled or not. | 9 | # Whether the check should be enabled or not. | |
10 | # | 10 | # | |
11 | # Default value: "yes" for PKG_DEVELOPERs, "no" otherwise. | 11 | # Default value: "yes" for PKG_DEVELOPERs, "no" otherwise. | |
12 | # | 12 | # | |
13 | # Package-settable variables: | 13 | # Package-settable variables: | |
14 | # | 14 | # | |
@@ -53,73 +53,39 @@ privileged-install-hook: _check-shlibs | @@ -53,73 +53,39 @@ privileged-install-hook: _check-shlibs | |||
53 | .if ${_USE_CHECK_SHLIBS_NATIVE} == "yes" | 53 | .if ${_USE_CHECK_SHLIBS_NATIVE} == "yes" | |
54 | CHECK_SHLIBS_NATIVE_ENV= | 54 | CHECK_SHLIBS_NATIVE_ENV= | |
55 | . if ${OBJECT_FMT} == "ELF" | 55 | . if ${OBJECT_FMT} == "ELF" | |
56 | USE_TOOLS+= readelf | 56 | USE_TOOLS+= readelf | |
57 | CHECK_SHLIBS_NATIVE= ${PKGSRCDIR}/mk/check/check-shlibs-elf.awk | 57 | CHECK_SHLIBS_NATIVE= ${PKGSRCDIR}/mk/check/check-shlibs-elf.awk | |
58 | CHECK_SHLIBS_NATIVE_ENV+= PLATFORM_RPATH=${_OPSYS_SYSTEM_RPATH:Q} | 58 | CHECK_SHLIBS_NATIVE_ENV+= PLATFORM_RPATH=${_OPSYS_SYSTEM_RPATH:Q} | |
59 | CHECK_SHLIBS_NATIVE_ENV+= READELF=${TOOLS_PATH.readelf:Q} | 59 | CHECK_SHLIBS_NATIVE_ENV+= READELF=${TOOLS_PATH.readelf:Q} | |
60 | . elif ${OBJECT_FMT} == "Mach-O" | 60 | . elif ${OBJECT_FMT} == "Mach-O" | |
61 | CHECK_SHLIBS_NATIVE= ${PKGSRCDIR}/mk/check/check-shlibs-macho.awk | 61 | CHECK_SHLIBS_NATIVE= ${PKGSRCDIR}/mk/check/check-shlibs-macho.awk | |
62 | . endif | 62 | . endif | |
63 | CHECK_SHLIBS_NATIVE_ENV+= CROSS_DESTDIR=${_CROSS_DESTDIR:Q} | 63 | CHECK_SHLIBS_NATIVE_ENV+= CROSS_DESTDIR=${_CROSS_DESTDIR:Q} | |
64 | CHECK_SHLIBS_NATIVE_ENV+= PKG_INFO_CMD=${PKG_INFO:Q} | 64 | CHECK_SHLIBS_NATIVE_ENV+= PKG_INFO_CMD=${PKG_INFO:Q} | |
65 | CHECK_SHLIBS_NATIVE_ENV+= DEPENDS_FILE=${_RRDEPENDS_FILE:Q} | 65 | CHECK_SHLIBS_NATIVE_ENV+= DEPENDS_FILE=${_RRDEPENDS_FILE:Q} | |
66 | . if ${_USE_DESTDIR} != "no" | |||
67 | CHECK_SHLIBS_NATIVE_ENV+= DESTDIR=${DESTDIR:Q} | 66 | CHECK_SHLIBS_NATIVE_ENV+= DESTDIR=${DESTDIR:Q} | |
68 | . endif | |||
69 | CHECK_SHLIBS_NATIVE_ENV+= WRKDIR=${WRKDIR:Q} | 67 | CHECK_SHLIBS_NATIVE_ENV+= WRKDIR=${WRKDIR:Q} | |
70 | . if defined(CHECK_WRKREF) && !empty(CHECK_WRKREF:Mextra) | 68 | . if defined(CHECK_WRKREF) && !empty(CHECK_WRKREF:Mextra) | |
71 | CHECK_SHLIBS_NATIVE_ENV+= CHECK_WRKREF_EXTRA_DIRS=${CHECK_WRKREF_EXTRA_DIRS:Q} | 69 | CHECK_SHLIBS_NATIVE_ENV+= CHECK_WRKREF_EXTRA_DIRS=${CHECK_WRKREF_EXTRA_DIRS:Q} | |
72 | . endif | 70 | . endif | |
73 | 71 | |||
74 | _check-shlibs: error-check .PHONY | 72 | _check-shlibs: error-check .PHONY | |
75 | @${STEP_MSG} "Checking for missing run-time search paths in ${PKGNAME}" | 73 | @${STEP_MSG} "Checking for missing run-time search paths in ${PKGNAME}" | |
76 | ${RUN} rm -f ${ERROR_DIR}/${.TARGET} | 74 | ${RUN} rm -f ${ERROR_DIR}/${.TARGET} | |
77 | ${RUN} \ | 75 | ${RUN} \ | |
78 | cd ${DESTDIR:Q}${PREFIX:Q}; \ | 76 | cd ${DESTDIR:Q}${PREFIX:Q}; \ | |
79 | ${_CHECK_SHLIBS_FILELIST_CMD} | \ | 77 | ${_CHECK_SHLIBS_FILELIST_CMD} | \ | |
80 | ${EGREP} -h ${_CHECK_SHLIBS_ERE:Q} | \ | 78 | ${EGREP} -h ${_CHECK_SHLIBS_ERE:Q} | \ | |
81 | while read file; do \ | 79 | while read file; do \ | |
82 | case "$$file" in \ | 80 | case "$$file" in \ | |
83 | ${CHECK_SHLIBS_SKIP:@p@${p}) continue ;;@} \ | 81 | ${CHECK_SHLIBS_SKIP:@p@${p}) continue ;;@} \ | |
84 | *) ;; \ | 82 | *) ;; \ | |
85 | esac; \ | 83 | esac; \ | |
86 | ${ECHO} $$file; \ | 84 | ${ECHO} $$file; \ | |
87 | done | \ | 85 | done | \ | |
88 | ${PKGSRC_SETENV} ${CHECK_SHLIBS_NATIVE_ENV} ${AWK} -f ${CHECK_SHLIBS_NATIVE} > ${ERROR_DIR}/${.TARGET} | 86 | ${PKGSRC_SETENV} ${CHECK_SHLIBS_NATIVE_ENV} ${AWK} -f ${CHECK_SHLIBS_NATIVE} > ${ERROR_DIR}/${.TARGET} | |
89 | 87 | |||
90 | .else | 88 | .else | |
91 | . if ${_USE_DESTDIR} != "no" | |||
92 | _check-shlibs: error-check .PHONY | 89 | _check-shlibs: error-check .PHONY | |
93 | @${WARNING_MSG} "Skipping missing run-time search-path check in DESTDIR mode." | 90 | @${WARNING_MSG} "Skipping missing run-time search-path check in DESTDIR mode." | |
94 | . else | |||
95 | _check-shlibs: error-check .PHONY | |||
96 | @${STEP_MSG} "Checking for missing run-time search paths in ${PKGNAME}" | |||
97 | ${RUN} rm -f ${ERROR_DIR}/${.TARGET} | |||
98 | ${RUN} \ | |||
99 | exec 1>${ERROR_DIR}/${.TARGET}; \ | |||
100 | case ${LDD:Q}"" in \ | |||
101 | "") ldd=`${TYPE} ldd 2>/dev/null | ${AWK} '{ print $$NF }'` ;; \ | |||
102 | *) ldd=${LDD:Q} ;; \ | |||
103 | esac; \ | |||
104 | ${TEST} -x "$$ldd" || exit 0; \ | |||
105 | cd ${DESTDIR}${PREFIX}; \ | |||
106 | ${_CHECK_SHLIBS_FILELIST_CMD} | \ | |||
107 | ${EGREP} -h ${_CHECK_SHLIBS_ERE:Q} | \ | |||
108 | while read file; do \ | |||
109 | case "$$file" in \ | |||
110 | ${CHECK_SHLIBS_SKIP:@p@${p}) continue ;;@} \ | |||
111 | *) ;; \ | |||
112 | esac; \ | |||
113 | err=`$$ldd $$file 2>&1 | ${GREP} "not found" || ${TRUE}`; \ | |||
114 | ${TEST} -z "$$err" || ${ECHO} "${DESTDIR}${PREFIX}/$$file: $$err"; \ | |||
115 | done | |||
116 | ${RUN} \ | |||
117 | exec 1>>${ERROR_DIR}/${.TARGET}; \ | |||
118 | if ${_NONZERO_FILESIZE_P} ${ERROR_DIR}/${.TARGET}; then \ | |||
119 | ${ECHO} "*** The programs/libs shown above will not find the listed"; \ | |||
120 | ${ECHO} " shared libraries at runtime."; \ | |||
121 | ${ECHO} " Please fix the package (add -Wl,-R.../lib in the right places)!"; \ | |||
122 | ${SHCOMMENT} Might not error-out for non-pkg-developers; \ | |||
123 | fi | |||
124 | . endif | |||
125 | .endif | 91 | .endif |
@@ -1,51 +1,48 @@ | @@ -1,51 +1,48 @@ | |||
1 | # $NetBSD: bsd.install.mk,v 1.15 2014/12/06 23:28:18 agc Exp $ | 1 | # $NetBSD: bsd.install.mk,v 1.16 2016/04/10 15:58:02 joerg Exp $ | |
2 | # | 2 | # | |
3 | # This Makefile fragment is included by bsd.pkg.mk and provides all | 3 | # This Makefile fragment is included by bsd.pkg.mk and provides all | |
4 | # variables and targets related to installing packages. | 4 | # variables and targets related to installing packages. | |
5 | # | 5 | # | |
6 | # The following are the "public" targets provided this module: | 6 | # The following are the "public" targets provided this module: | |
7 | # | 7 | # | |
8 | # install, stage-install, deinstall, reinstall, replace, undo-replace | 8 | # install, stage-install, deinstall, reinstall, replace, undo-replace | |
9 | # | 9 | # | |
10 | # The following targets may be overridden in a package Makefile: | 10 | # The following targets may be overridden in a package Makefile: | |
11 | # | 11 | # | |
12 | # pre-install, do-install, post-install | 12 | # pre-install, do-install, post-install | |
13 | # | 13 | # | |
14 | 14 | |||
15 | _COOKIE.install= ${WRKDIR}/.install_done | 15 | _COOKIE.install= ${WRKDIR}/.install_done | |
16 | 16 | |||
17 | ###################################################################### | 17 | ###################################################################### | |
18 | ### install (PUBLIC) | 18 | ### install (PUBLIC) | |
19 | ###################################################################### | 19 | ###################################################################### | |
20 | ### install is a public target to install the package either by | 20 | ### install is a public target to install the package by depending | |
21 | ### depending on stage-install (_USE_DESTDIR=no) or package-install | 21 | ### on stage-package-install or package-install. The difference is | |
22 | ### (_USE_DESTDIR!=no). | 22 | ### a package is created in the public PACKAGES directory. | |
23 | ### | 23 | ### | |
24 | .PHONY: install | 24 | .PHONY: install | |
25 | .if ${_USE_DESTDIR} == "no" | 25 | .if ${_KEEP_BIN_PKGS} == "no" | |
26 | install: stage-install | |||
27 | .elif ${_KEEP_BIN_PKGS} == "no" | |||
28 | install: stage-package-install | 26 | install: stage-package-install | |
29 | .else | 27 | .else | |
30 | install: package-install | 28 | install: package-install | |
31 | .endif | 29 | .endif | |
32 | 30 | |||
33 | ###################################################################### | 31 | ###################################################################### | |
34 | ### stage-install (PUBLIC) | 32 | ### stage-install (PUBLIC) | |
35 | ###################################################################### | 33 | ###################################################################### | |
36 | ### stage-install is a public target to install the package to | 34 | ### stage-install is a public target to install the package to | |
37 | ### ${PREFIX} (_USE_DESTDIR=no) or to ${DESTDIR}${PREFIX} | 35 | ### to ${DESTDIR}${PREFIX}. | |
38 | ### (_USE_DESTDIR!=no) | |||
39 | ### | 36 | ### | |
40 | .PHONY: stage-install | 37 | .PHONY: stage-install | |
41 | .if !defined(NO_INSTALL) | 38 | .if !defined(NO_INSTALL) | |
42 | . include "install.mk" | 39 | . include "install.mk" | |
43 | .else | 40 | .else | |
44 | . if exists(${_COOKIE.install}) | 41 | . if exists(${_COOKIE.install}) | |
45 | stage-install: | 42 | stage-install: | |
46 | @${DO_NADA} | 43 | @${DO_NADA} | |
47 | . elif defined(_PKGSRC_BARRIER) | 44 | . elif defined(_PKGSRC_BARRIER) | |
48 | stage-install: ${_PKGSRC_BUILD_TARGETS} install-cookie | 45 | stage-install: ${_PKGSRC_BUILD_TARGETS} install-cookie | |
49 | . else | 46 | . else | |
50 | stage-install: barrier | 47 | stage-install: barrier | |
51 | . endif | 48 | . endif |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: deinstall.mk,v 1.11 2011/10/15 00:23:09 reed Exp $ | 1 | # $NetBSD: deinstall.mk,v 1.12 2016/04/10 15:58:02 joerg Exp $ | |
2 | 2 | |||
3 | # DEINSTALLDEPENDS controls whether dependencies and dependents are also | 3 | # DEINSTALLDEPENDS controls whether dependencies and dependents are also | |
4 | # removed when a package is de-installed. The valid values are: | 4 | # removed when a package is de-installed. The valid values are: | |
5 | # | 5 | # | |
6 | # no only the package is removed (if dependencies allow it) | 6 | # no only the package is removed (if dependencies allow it) | |
7 | # yes dependent packages are also removed | 7 | # yes dependent packages are also removed | |
8 | # all dependent packages and unused dependencies are also removed | 8 | # all dependent packages and unused dependencies are also removed | |
9 | # | 9 | # | |
10 | DEINSTALLDEPENDS?= no | 10 | DEINSTALLDEPENDS?= no | |
11 | 11 | |||
12 | ###################################################################### | 12 | ###################################################################### | |
13 | ### deinstall, su-deinstall (PUBLIC) | 13 | ### deinstall, su-deinstall (PUBLIC) | |
14 | ###################################################################### | 14 | ###################################################################### | |
@@ -21,29 +21,26 @@ DEINSTALLDEPENDS?= no | @@ -21,29 +21,26 @@ DEINSTALLDEPENDS?= no | |||
21 | deinstall: su-deinstall | 21 | deinstall: su-deinstall | |
22 | @${PHASE_MSG} "Deinstalling for ${PKGNAME}" | 22 | @${PHASE_MSG} "Deinstalling for ${PKGNAME}" | |
23 | . endif | 23 | . endif | |
24 | .else | 24 | .else | |
25 | . if !target(deinstall) | 25 | . if !target(deinstall) | |
26 | deinstall: su-target | 26 | deinstall: su-target | |
27 | @${PHASE_MSG} "Deinstalling for ${PKGNAME}" | 27 | @${PHASE_MSG} "Deinstalling for ${PKGNAME}" | |
28 | . endif | 28 | . endif | |
29 | .endif | 29 | .endif | |
30 | 30 | |||
31 | _SU_DEINSTALL_TARGETS= acquire-deinstall-lock | 31 | _SU_DEINSTALL_TARGETS= acquire-deinstall-lock | |
32 | _SU_DEINSTALL_TARGETS+= _pkgformat-deinstall | 32 | _SU_DEINSTALL_TARGETS+= _pkgformat-deinstall | |
33 | _SU_DEINSTALL_TARGETS+= release-deinstall-lock | 33 | _SU_DEINSTALL_TARGETS+= release-deinstall-lock | |
34 | .if ${_USE_DESTDIR} == "no" | |||
35 | _SU_DEINSTALL_TARGETS+= install-clean | |||
36 | .endif | |||
37 | su-deinstall: ${_SU_DEINSTALL_TARGETS} | 34 | su-deinstall: ${_SU_DEINSTALL_TARGETS} | |
38 | 35 | |||
39 | .PHONY: acquire-deinstall-lock release-deinstall-lock | 36 | .PHONY: acquire-deinstall-lock release-deinstall-lock | |
40 | acquire-deinstall-lock: acquire-localbase-lock | 37 | acquire-deinstall-lock: acquire-localbase-lock | |
41 | release-deinstall-lock: release-localbase-lock | 38 | release-deinstall-lock: release-localbase-lock | |
42 | 39 | |||
43 | MAKEFLAGS.su-deinstall+= DEINSTALLDEPENDS=${DEINSTALLDEPENDS} | 40 | MAKEFLAGS.su-deinstall+= DEINSTALLDEPENDS=${DEINSTALLDEPENDS} | |
44 | 41 | |||
45 | ###################################################################### | 42 | ###################################################################### | |
46 | ### reinstall (PUBLIC) | 43 | ### reinstall (PUBLIC) | |
47 | ###################################################################### | 44 | ###################################################################### | |
48 | ### reinstall is a special target to re-run the install target. | 45 | ### reinstall is a special target to re-run the install target. | |
49 | ### It will acquire elevated privileges just-in-time. | 46 | ### It will acquire elevated privileges just-in-time. |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: install.mk,v 1.67 2015/10/12 09:08:22 jperkin Exp $ | 1 | # $NetBSD: install.mk,v 1.68 2016/04/10 15:58:02 joerg Exp $ | |
2 | # | 2 | # | |
3 | # This file provides the code for the "install" phase. | 3 | # This file provides the code for the "install" phase. | |
4 | # | 4 | # | |
5 | # Public targets: | 5 | # Public targets: | |
6 | # | 6 | # | |
7 | # stage-install: | 7 | # stage-install: | |
8 | # Installs the package files into LOCALBASE or ${DESTDIR}${LOCALBASE}. | 8 | # Installs the package files into LOCALBASE or ${DESTDIR}${LOCALBASE}. | |
9 | # | 9 | # | |
10 | 10 | |||
11 | # Interface for other infrastructure components: | 11 | # Interface for other infrastructure components: | |
12 | # | 12 | # | |
13 | # Hooks for use by the infrastructure: | 13 | # Hooks for use by the infrastructure: | |
14 | # | 14 | # | |
@@ -144,85 +144,57 @@ install-check-version: ${_COOKIE.extract | @@ -144,85 +144,57 @@ install-check-version: ${_COOKIE.extract | |||
144 | extractname=`${CAT} ${_COOKIE.extract}`; \ | 144 | extractname=`${CAT} ${_COOKIE.extract}`; \ | |
145 | pkgname=${PKGNAME}; \ | 145 | pkgname=${PKGNAME}; \ | |
146 | case "$$extractname" in \ | 146 | case "$$extractname" in \ | |
147 | "") ${WARNING_MSG} "${WRKDIR} may contain an older version of ${PKGBASE}" ;; \ | 147 | "") ${WARNING_MSG} "${WRKDIR} may contain an older version of ${PKGBASE}" ;; \ | |
148 | "$$pkgname") ;; \ | 148 | "$$pkgname") ;; \ | |
149 | *) ${WARNING_MSG} "Package version $$extractname in ${WRKDIR}"; \ | 149 | *) ${WARNING_MSG} "Package version $$extractname in ${WRKDIR}"; \ | |
150 | ${WARNING_MSG} "Current version $$pkgname in ${PKGPATH}"; \ | 150 | ${WARNING_MSG} "Current version $$pkgname in ${PKGPATH}"; \ | |
151 | ${WARNING_MSG} "Cleaning and rebuilding $$pkgname..."; \ | 151 | ${WARNING_MSG} "Cleaning and rebuilding $$pkgname..."; \ | |
152 | ${RECURSIVE_MAKE} ${MAKEFLAGS} clean; \ | 152 | ${RECURSIVE_MAKE} ${MAKEFLAGS} clean; \ | |
153 | ${RECURSIVE_MAKE} ${MAKEFLAGS} build ;; \ | 153 | ${RECURSIVE_MAKE} ${MAKEFLAGS} build ;; \ | |
154 | esac | 154 | esac | |
155 | 155 | |||
156 | ###################################################################### | 156 | ###################################################################### | |
157 | ### The targets below are run with elevated privileges. | |||
158 | ###################################################################### | |||
159 | ||||
160 | .PHONY: acquire-install-localbase-lock release-install-localbase-lock | |||
161 | acquire-install-localbase-lock: acquire-localbase-lock | |||
162 | release-install-localbase-lock: release-localbase-lock | |||
163 | ||||
164 | ###################################################################### | |||
165 | ### install-all, su-install-all (PRIVATE) | 157 | ### install-all, su-install-all (PRIVATE) | |
166 | ###################################################################### | 158 | ###################################################################### | |
167 | ### install-all is a helper target to run the install target of | 159 | ### install-all is a helper target to run the install target of | |
168 | ### the built software, register the software installation, and run | 160 | ### the built software, register the software installation, and run | |
169 | ### some sanity checks. | 161 | ### some sanity checks. | |
170 | ### | 162 | ### | |
171 | .if ${_USE_DESTDIR} != "user-destdir" | |||
172 | _INSTALL_ALL_TARGETS+= acquire-install-localbase-lock | |||
173 | .endif | |||
174 | .if ${_USE_DESTDIR} == "no" | |||
175 | _INSTALL_ALL_TARGETS+= _pkgformat-check-conflicts | |||
176 | _INSTALL_ALL_TARGETS+= _pkgformat-check-installed | |||
177 | .endif | |||
178 | _INSTALL_ALL_TARGETS+= install-check-umask | 163 | _INSTALL_ALL_TARGETS+= install-check-umask | |
179 | .if empty(CHECK_FILES:M[nN][oO]) && !empty(CHECK_FILES_SUPPORTED:M[Yy][Ee][Ss]) | 164 | .if empty(CHECK_FILES:M[nN][oO]) && !empty(CHECK_FILES_SUPPORTED:M[Yy][Ee][Ss]) | |
180 | _INSTALL_ALL_TARGETS+= check-files-pre | 165 | _INSTALL_ALL_TARGETS+= check-files-pre | |
181 | .endif | 166 | .endif | |
182 | _INSTALL_ALL_TARGETS+= install-makedirs | 167 | _INSTALL_ALL_TARGETS+= install-makedirs | |
183 | .if defined(INSTALLATION_DIRS_FROM_PLIST) && \ | 168 | .if defined(INSTALLATION_DIRS_FROM_PLIST) && \ | |
184 | !empty(INSTALLATION_DIRS_FROM_PLIST:M[Yy][Ee][Ss]) | 169 | !empty(INSTALLATION_DIRS_FROM_PLIST:M[Yy][Ee][Ss]) | |
185 | _INSTALL_ALL_TARGETS+= install-dirs-from-PLIST | 170 | _INSTALL_ALL_TARGETS+= install-dirs-from-PLIST | |
186 | .elif defined(AUTO_MKDIRS) && !empty(AUTO_MKDIRS:M[Yy][Ee][Ss]) | 171 | .elif defined(AUTO_MKDIRS) && !empty(AUTO_MKDIRS:M[Yy][Ee][Ss]) | |
187 | _INSTALL_ALL_TARGETS+= install-dirs-from-PLIST | 172 | _INSTALL_ALL_TARGETS+= install-dirs-from-PLIST | |
188 | .endif | 173 | .endif | |
189 | .if ${_USE_DESTDIR} == "no" | |||
190 | _INSTALL_ALL_TARGETS+= pre-install-script | |||
191 | .endif | |||
192 | _INSTALL_ALL_TARGETS+= pre-install | 174 | _INSTALL_ALL_TARGETS+= pre-install | |
193 | _INSTALL_ALL_TARGETS+= do-install | 175 | _INSTALL_ALL_TARGETS+= do-install | |
194 | _INSTALL_ALL_TARGETS+= post-install | 176 | _INSTALL_ALL_TARGETS+= post-install | |
195 | _INSTALL_ALL_TARGETS+= plist | 177 | _INSTALL_ALL_TARGETS+= plist | |
196 | .if !empty(STRIP_DEBUG:M[Yy][Ee][Ss]) | 178 | .if !empty(STRIP_DEBUG:M[Yy][Ee][Ss]) | |
197 | _INSTALL_ALL_TARGETS+= install-strip-debug | 179 | _INSTALL_ALL_TARGETS+= install-strip-debug | |
198 | .endif | 180 | .endif | |
199 | _INSTALL_ALL_TARGETS+= install-doc-handling | 181 | _INSTALL_ALL_TARGETS+= install-doc-handling | |
200 | _INSTALL_ALL_TARGETS+= install-script-data | 182 | _INSTALL_ALL_TARGETS+= install-script-data | |
201 | .if empty(CHECK_FILES:M[nN][oO]) && !empty(CHECK_FILES_SUPPORTED:M[Yy][Ee][Ss]) | 183 | .if empty(CHECK_FILES:M[nN][oO]) && !empty(CHECK_FILES_SUPPORTED:M[Yy][Ee][Ss]) | |
202 | _INSTALL_ALL_TARGETS+= check-files-post | 184 | _INSTALL_ALL_TARGETS+= check-files-post | |
203 | .endif | 185 | .endif | |
204 | .if ${_USE_DESTDIR} == "no" | |||
205 | _INSTALL_ALL_TARGETS+= post-install-script | |||
206 | .endif | |||
207 | .if ${_USE_DESTDIR} == "no" | |||
208 | _INSTALL_ALL_TARGETS+= _pkgformat-register | |||
209 | .else | |||
210 | _INSTALL_ALL_TARGETS+= _pkgformat-generate-metadata | 186 | _INSTALL_ALL_TARGETS+= _pkgformat-generate-metadata | |
211 | .endif | |||
212 | _INSTALL_ALL_TARGETS+= privileged-install-hook | 187 | _INSTALL_ALL_TARGETS+= privileged-install-hook | |
213 | .if ${_USE_DESTDIR} != "user-destdir" | |||
214 | _INSTALL_ALL_TARGETS+= release-install-localbase-lock | |||
215 | .endif | |||
216 | _INSTALL_ALL_TARGETS+= error-check | 188 | _INSTALL_ALL_TARGETS+= error-check | |
217 | 189 | |||
218 | .PHONY: install-all su-install-all | 190 | .PHONY: install-all su-install-all | |
219 | . if !empty(_MAKE_INSTALL_AS_ROOT:M[Yy][Ee][Ss]) | 191 | . if !empty(_MAKE_INSTALL_AS_ROOT:M[Yy][Ee][Ss]) | |
220 | install-all: su-target | 192 | install-all: su-target | |
221 | . else | 193 | . else | |
222 | install-all: su-install-all | 194 | install-all: su-install-all | |
223 | . endif | 195 | . endif | |
224 | su-install-all: ${_INSTALL_ALL_TARGETS} | 196 | su-install-all: ${_INSTALL_ALL_TARGETS} | |
225 | 197 | |||
226 | ###################################################################### | 198 | ###################################################################### | |
227 | ### install-check-umask (PRIVATE) | 199 | ### install-check-umask (PRIVATE) | |
228 | ###################################################################### | 200 | ###################################################################### | |
@@ -305,27 +277,27 @@ install-dirs-from-PLIST: | @@ -305,27 +277,27 @@ install-dirs-from-PLIST: | |||
305 | 277 | |||
306 | ###################################################################### | 278 | ###################################################################### | |
307 | ### pre-install, do-install, post-install (PUBLIC, override) | 279 | ### pre-install, do-install, post-install (PUBLIC, override) | |
308 | ###################################################################### | 280 | ###################################################################### | |
309 | ### {pre,do,post}-install are the heart of the package-customizable | 281 | ### {pre,do,post}-install are the heart of the package-customizable | |
310 | ### install targets, and may be overridden within a package Makefile. | 282 | ### install targets, and may be overridden within a package Makefile. | |
311 | ### | 283 | ### | |
312 | .PHONY: pre-install do-install post-install | 284 | .PHONY: pre-install do-install post-install | |
313 | 285 | |||
314 | INSTALL_DIRS?= ${BUILD_DIRS} | 286 | INSTALL_DIRS?= ${BUILD_DIRS} | |
315 | INSTALL_MAKE_FLAGS?= # none | 287 | INSTALL_MAKE_FLAGS?= # none | |
316 | INSTALL_TARGET?= install ${USE_IMAKE:D${NO_INSTALL_MANPAGES:D:Uinstall.man}} | 288 | INSTALL_TARGET?= install ${USE_IMAKE:D${NO_INSTALL_MANPAGES:D:Uinstall.man}} | |
317 | DESTDIR_VARNAME?= DESTDIR | 289 | DESTDIR_VARNAME?= DESTDIR | |
318 | .if ${_USE_DESTDIR} != "no" && !empty(DESTDIR_VARNAME) | 290 | .if !empty(DESTDIR_VARNAME) | |
319 | INSTALL_ENV+= ${DESTDIR_VARNAME}=${DESTDIR:Q} | 291 | INSTALL_ENV+= ${DESTDIR_VARNAME}=${DESTDIR:Q} | |
320 | INSTALL_MAKE_FLAGS+= ${DESTDIR_VARNAME}=${DESTDIR:Q} | 292 | INSTALL_MAKE_FLAGS+= ${DESTDIR_VARNAME}=${DESTDIR:Q} | |
321 | .endif | 293 | .endif | |
322 | 294 | |||
323 | .if !target(do-install) | 295 | .if !target(do-install) | |
324 | do-install: | 296 | do-install: | |
325 | . for _dir_ in ${INSTALL_DIRS} | 297 | . for _dir_ in ${INSTALL_DIRS} | |
326 | ${RUN} ${_ULIMIT_CMD} \ | 298 | ${RUN} ${_ULIMIT_CMD} \ | |
327 | cd ${WRKSRC} && cd ${_dir_} && \ | 299 | cd ${WRKSRC} && cd ${_dir_} && \ | |
328 | ${PKGSRC_SETENV} ${INSTALL_ENV} ${MAKE_ENV} \ | 300 | ${PKGSRC_SETENV} ${INSTALL_ENV} ${MAKE_ENV} \ | |
329 | ${MAKE_PROGRAM} ${MAKE_FLAGS} ${INSTALL_MAKE_FLAGS} \ | 301 | ${MAKE_PROGRAM} ${MAKE_FLAGS} ${INSTALL_MAKE_FLAGS} \ | |
330 | -f ${MAKE_FILE} ${INSTALL_TARGET} | 302 | -f ${MAKE_FILE} ${INSTALL_TARGET} | |
331 | . endfor | 303 | . endfor |
@@ -1,75 +1,62 @@ | @@ -1,75 +1,62 @@ | |||
1 | # $NetBSD: replace.mk,v 1.17 2015/09/07 19:23:47 gdt Exp $ | 1 | # $NetBSD: replace.mk,v 1.18 2016/04/10 15:58:02 joerg Exp $ | |
2 | # | 2 | # | |
3 | # Public targets: | 3 | # Public targets: | |
4 | # | 4 | # | |
5 | # replace: | 5 | # replace: | |
6 | # Updates a package in-place on the system. | 6 | # Updates a package in-place on the system. | |
7 | # It will acquire elevated privileges just-in-time. | 7 | # It will acquire elevated privileges just-in-time. | |
8 | # | 8 | # | |
9 | # undo-replace: | 9 | # undo-replace: | |
10 | # Undoes the effects of a previous "make replace". | 10 | # Undoes the effects of a previous "make replace". | |
11 | # It will acquire elevated privileges just-in-time. | 11 | # It will acquire elevated privileges just-in-time. | |
12 | # | 12 | # | |
13 | # | 13 | # | |
14 | # Private targets that must be defined by the package system format: | 14 | # Private targets that must be defined by the package system format: | |
15 | # | 15 | # | |
16 | # _pkgformat-replace: | |||
17 | # Updates a package in-place on the system (USE_DESTDIR=no). | |||
18 | # | |||
19 | # _pkgformat-destdir-replace: | 16 | # _pkgformat-destdir-replace: | |
20 | # Updates a package in-place on the system (USE_DESTDIR=yes). | 17 | # Updates a package in-place on the system. | |
21 | # | 18 | # | |
22 | # _pkgformat-undo-replace: | 19 | # _pkgformat-undo-replace: | |
23 | # Undoes a previous "make _pkgformat-replace". | 20 | # Undoes a previous "make _pkgformat-replace". | |
24 | 21 | |||
25 | # _pkgformat-destdir-undo-replace: | 22 | # _pkgformat-destdir-undo-replace: | |
26 | # Undoes a previous "make _pkgformat-destdir-replace". | 23 | # Undoes a previous "make _pkgformat-destdir-replace". | |
27 | 24 | |||
28 | .if ${_USE_DESTDIR} == "no" | 25 | .if ${_KEEP_BIN_PKGS} == "no" | |
29 | _REPLACE_TARGETS+= ${_PKGSRC_BUILD_TARGETS} | |||
30 | .elif ${_KEEP_BIN_PKGS} == "no" | |||
31 | _REPLACE_TARGETS+= stage-package-create | 26 | _REPLACE_TARGETS+= stage-package-create | |
32 | .else | 27 | .else | |
33 | _REPLACE_TARGETS+= package | 28 | _REPLACE_TARGETS+= package | |
34 | .endif | 29 | .endif | |
35 | _REPLACE_TARGETS+= replace-message | 30 | _REPLACE_TARGETS+= replace-message | |
36 | _REPLACE_TARGETS+= unprivileged-install-hook | 31 | _REPLACE_TARGETS+= unprivileged-install-hook | |
37 | 32 | |||
38 | # | 33 | # | |
39 | # replace | 34 | # replace | |
40 | # | 35 | # | |
41 | 36 | |||
42 | .PHONY: replace | 37 | .PHONY: replace | |
43 | .if defined(_PKGSRC_BARRIER) | 38 | .if defined(_PKGSRC_BARRIER) | |
44 | replace: ${_REPLACE_TARGETS} su-target | 39 | replace: ${_REPLACE_TARGETS} su-target | |
45 | .else | 40 | .else | |
46 | replace: barrier | 41 | replace: barrier | |
47 | .endif | 42 | .endif | |
48 | 43 | |||
49 | replace-message: .PHONY | 44 | replace-message: .PHONY | |
50 | @${PHASE_MSG} "Replacing for ${PKGNAME}" | 45 | @${PHASE_MSG} "Replacing for ${PKGNAME}" | |
51 | 46 | |||
52 | .if ${_USE_DESTDIR} == "no" | |||
53 | su-replace: .PHONY _pkgformat-replace | |||
54 | .else | |||
55 | su-replace: .PHONY _pkgformat-destdir-replace | 47 | su-replace: .PHONY _pkgformat-destdir-replace | |
56 | .endif | |||
57 | MAKEFLAGS.su-replace= _UPDATE_RUNNING=yes | 48 | MAKEFLAGS.su-replace= _UPDATE_RUNNING=yes | |
58 | MAKEFLAGS.su-replace+= PKGNAME_REQD=${PKGNAME_REQD:Q} | 49 | MAKEFLAGS.su-replace+= PKGNAME_REQD=${PKGNAME_REQD:Q} | |
59 | 50 | |||
60 | # | 51 | # | |
61 | # undo-replace | 52 | # undo-replace | |
62 | # | 53 | # | |
63 | 54 | |||
64 | undo-replace: .PHONY undo-replace-message su-target | 55 | undo-replace: .PHONY undo-replace-message su-target | |
65 | 56 | |||
66 | undo-replace-message: .PHONY | 57 | undo-replace-message: .PHONY | |
67 | @${PHASE_MSG} "Undoing replacement for ${PKGNAME}" | 58 | @${PHASE_MSG} "Undoing replacement for ${PKGNAME}" | |
68 | @${WARNING_MSG} "experimental target - DATA LOSS MAY OCCUR." | 59 | @${WARNING_MSG} "experimental target - DATA LOSS MAY OCCUR." | |
69 | 60 | |||
70 | .if ${_USE_DESTDIR} == "no" | |||
71 | su-undo-replace: .PHONY _pkgformat-undo-replace | |||
72 | .else | |||
73 | su-undo-replace: .PHONY _pkgformat-destdir-undo-replace | 61 | su-undo-replace: .PHONY _pkgformat-destdir-undo-replace | |
74 | .endif | |||
75 | MAKEFLAGS.su-undo-replace= _UPDATE_RUNNING=yes | 62 | MAKEFLAGS.su-undo-replace= _UPDATE_RUNNING=yes |
@@ -1,34 +1,30 @@ | @@ -1,34 +1,30 @@ | |||
1 | # $NetBSD: package.mk,v 1.24 2013/05/23 13:18:56 obache Exp $ | 1 | # $NetBSD: package.mk,v 1.25 2016/04/10 15:58:02 joerg Exp $ | |
2 | # | 2 | # | |
3 | # This file provides the code for the "package" phase. | 3 | # This file provides the code for the "package" phase. | |
4 | # | 4 | # | |
5 | # Public targets: | 5 | # Public targets: | |
6 | # | 6 | # | |
7 | # package: | 7 | # package: | |
8 | # Generates a binary package. | 8 | # Generates a binary package. | |
9 | # It will acquire elevated privileges just-in-time. | 9 | # It will acquire elevated privileges just-in-time. | |
10 | # | 10 | # | |
11 | # XXX: From which files is the binary package generated? The | 11 | # XXX: From which files is the binary package generated? The | |
12 | # installed files in LOCALBASE, or some files in WRKDIR/.destdir? | 12 | # installed files in LOCALBASE, or some files in WRKDIR/.destdir? | |
13 | # | 13 | # | |
14 | 14 | |||
15 | _PACKAGE_TARGETS+= check-vulnerable | 15 | _PACKAGE_TARGETS+= check-vulnerable | |
16 | .if make(replace) && ${_USE_DESTDIR} == "no" | |||
17 | _PACKAGE_TARGETS+= replace | |||
18 | .else | |||
19 | _PACKAGE_TARGETS+= stage-install | 16 | _PACKAGE_TARGETS+= stage-install | |
20 | _PACKAGE_TARGETS+= stage-package-create | 17 | _PACKAGE_TARGETS+= stage-package-create | |
21 | .endif | |||
22 | _PACKAGE_TARGETS+= acquire-package-lock | 18 | _PACKAGE_TARGETS+= acquire-package-lock | |
23 | _PACKAGE_TARGETS+= ${_COOKIE.package} | 19 | _PACKAGE_TARGETS+= ${_COOKIE.package} | |
24 | _PACKAGE_TARGETS+= release-package-lock | 20 | _PACKAGE_TARGETS+= release-package-lock | |
25 | 21 | |||
26 | .PHONY: package | 22 | .PHONY: package | |
27 | .if !target(package) | 23 | .if !target(package) | |
28 | . if exists(${_COOKIE.package}) | 24 | . if exists(${_COOKIE.package}) | |
29 | package: | 25 | package: | |
30 | @${DO_NADA} | 26 | @${DO_NADA} | |
31 | . elif defined(_PKGSRC_BARRIER) | 27 | . elif defined(_PKGSRC_BARRIER) | |
32 | package: ${_PACKAGE_TARGETS} | 28 | package: ${_PACKAGE_TARGETS} | |
33 | . else | 29 | . else | |
34 | package: barrier | 30 | package: barrier | |
@@ -74,54 +70,39 @@ package-cookie: | @@ -74,54 +70,39 @@ package-cookie: | |||
74 | ${RUN} ${MKDIR} ${_COOKIE.package:H} | 70 | ${RUN} ${MKDIR} ${_COOKIE.package:H} | |
75 | ${RUN} ${ECHO} ${PKGNAME} > ${_COOKIE.package} | 71 | ${RUN} ${ECHO} ${PKGNAME} > ${_COOKIE.package} | |
76 | 72 | |||
77 | ###################################################################### | 73 | ###################################################################### | |
78 | ### The targets below are run with elevated privileges. | 74 | ### The targets below are run with elevated privileges. | |
79 | ###################################################################### | 75 | ###################################################################### | |
80 | 76 | |||
81 | ###################################################################### | 77 | ###################################################################### | |
82 | ### package-all, su-package-all (PRIVATE) | 78 | ### package-all, su-package-all (PRIVATE) | |
83 | ###################################################################### | 79 | ###################################################################### | |
84 | ### package-all is a helper target to create the binary package and | 80 | ### package-all is a helper target to create the binary package and | |
85 | ### generate any necessary warnings. | 81 | ### generate any necessary warnings. | |
86 | ### | 82 | ### | |
87 | .if ${_USE_DESTDIR} == "no" | |||
88 | _PACKAGE_ALL_TARGETS+= package-check-installed | |||
89 | .endif | |||
90 | _PACKAGE_ALL_TARGETS+= package-create | 83 | _PACKAGE_ALL_TARGETS+= package-create | |
91 | _PACKAGE_ALL_TARGETS+= _package-warnings | 84 | _PACKAGE_ALL_TARGETS+= _package-warnings | |
92 | _PACKAGE_ALL_TARGETS+= error-check | 85 | _PACKAGE_ALL_TARGETS+= error-check | |
93 | 86 | |||
94 | .PHONY: package-all su-package-all | 87 | .PHONY: package-all su-package-all | |
95 | .if !empty(_MAKE_PACKAGE_AS_ROOT:M[Yy][Ee][Ss]) | 88 | .if !empty(_MAKE_PACKAGE_AS_ROOT:M[Yy][Ee][Ss]) | |
96 | package-all: su-target | 89 | package-all: su-target | |
97 | .else | 90 | .else | |
98 | package-all: su-package-all | 91 | package-all: su-package-all | |
99 | .endif | 92 | .endif | |
100 | su-package-all: ${_PACKAGE_ALL_TARGETS} | 93 | su-package-all: ${_PACKAGE_ALL_TARGETS} | |
101 | 94 | |||
102 | ###################################################################### | 95 | ###################################################################### | |
103 | ### package-check-installed (PRIVATE, override) | |||
104 | ###################################################################### | |||
105 | ### package-check-installed verifies that the package is installed on | |||
106 | ### the system. This should be overridden per package system format. | |||
107 | ### | |||
108 | .if !target(package-check-installed) | |||
109 | .PHONY: package-check-installed | |||
110 | package-check-installed: | |||
111 | @${DO_NADA} | |||
112 | .endif | |||
113 | ||||
114 | ###################################################################### | |||
115 | ### package-create (PRIVATE, override) | 96 | ### package-create (PRIVATE, override) | |
116 | ###################################################################### | 97 | ###################################################################### | |
117 | ### package-create creates the binary package. This should be overridden | 98 | ### package-create creates the binary package. This should be overridden | |
118 | ### per package system format. | 99 | ### per package system format. | |
119 | ### | 100 | ### | |
120 | .if !target(package-create) | 101 | .if !target(package-create) | |
121 | .PHONY: package-create | 102 | .PHONY: package-create | |
122 | package-create: | 103 | package-create: | |
123 | @${DO_NADA} | 104 | @${DO_NADA} | |
124 | .endif | 105 | .endif | |
125 | 106 | |||
126 | # Displays warnings about the binary package. | 107 | # Displays warnings about the binary package. | |
127 | # | 108 | # |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | $NetBSD: README,v 1.2 2014/12/30 15:13:19 wiz Exp $ | 1 | $NetBSD: README,v 1.3 2016/04/10 15:58:03 joerg Exp $ | |
2 | 2 | |||
3 | = Introduction = | 3 | = Introduction = | |
4 | 4 | |||
5 | A package format is a packaging system that is supported by pkgsrc. | 5 | A package format is a packaging system that is supported by pkgsrc. | |
6 | Currently, there is only one (the native pkgsrc tools), but maybe we can | 6 | Currently, there is only one (the native pkgsrc tools), but maybe we can | |
7 | support RPM, dpkg or the Solaris native packages someday. It can also be | 7 | support RPM, dpkg or the Solaris native packages someday. It can also be | |
8 | used to test new variants of the packaging tools. | 8 | used to test new variants of the packaging tools. | |
9 | 9 | |||
10 | NOTE: The Google Summer of Code 2011 project includes rpm and debian | 10 | NOTE: The Google Summer of Code 2011 project includes rpm and debian | |
11 | http://addpackageforma.sourceforge.net/ | 11 | http://addpackageforma.sourceforge.net/ | |
12 | 12 | |||
13 | The PKG_FORMAT variable is used to select the format. The default | 13 | The PKG_FORMAT variable is used to select the format. The default | |
14 | format is ``pkg''. | 14 | format is ``pkg''. | |
@@ -47,22 +47,21 @@ shell commands. They may contain referen | @@ -47,22 +47,21 @@ shell commands. They may contain referen | |||
47 | * PKG_FILELIST_CMD | 47 | * PKG_FILELIST_CMD | |
48 | 48 | |||
49 | XXX: Why isn't this variable in the previous list? | 49 | XXX: Why isn't this variable in the previous list? | |
50 | 50 | |||
51 | == Make targets == | 51 | == Make targets == | |
52 | 52 | |||
53 | The following make targets must be implemented: | 53 | The following make targets must be implemented: | |
54 | 54 | |||
55 | * _pkgformat-check-vulnerable | 55 | * _pkgformat-check-vulnerable | |
56 | * _pkgformat-deinstall | 56 | * _pkgformat-deinstall | |
57 | * _pkgformat-show-depends | 57 | * _pkgformat-show-depends | |
58 | * _pkgformat-install-dependencies | 58 | * _pkgformat-install-dependencies | |
59 | * bootstrap-depends | 59 | * bootstrap-depends | |
60 | * _pkgformat-register | |||
61 | * tarup (XXX: This doesn't sound like a target that should be defined | 60 | * tarup (XXX: This doesn't sound like a target that should be defined | |
62 | here.) | 61 | here.) | |
63 | * tarup-pkg | 62 | * tarup-pkg | |
64 | * package-install | 63 | * package-install | |
65 | * _pkgformat-replace | 64 | * _pkgformat-replace | |
66 | * _pkgformat-destdir-replace | 65 | * _pkgformat-destdir-replace | |
67 | * _pkgformat-undo-replace | 66 | * _pkgformat-undo-replace | |
68 | 67 |
@@ -1,75 +1,7 @@ | @@ -1,75 +1,7 @@ | |||
1 | # $NetBSD: install.mk,v 1.1 2011/10/15 00:23:09 reed Exp $ | 1 | # $NetBSD: install.mk,v 1.2 2016/04/10 15:58:03 joerg Exp $ | |
2 | # | |||
3 | # _pkgformat-check-conflicts: | |||
4 | # Checks for conflicts between the package and installed packages. | |||
5 | # | |||
6 | # XXX: Needs WRKDIR. | |||
7 | # | |||
8 | # _pkgformat-check-installed: | |||
9 | # Checks if the package (or an older version of it) is already | |||
10 | # installed on the system. | |||
11 | # | |||
12 | # XXX: Needs WRKDIR. | |||
13 | # | |||
14 | # _pkgformat-register: | |||
15 | # Populates the package database with the appropriate entries to | |||
16 | # register the package as being installed on the system. | |||
17 | # | 2 | # | |
18 | # _pkgformat-install-clean: | 3 | # _pkgformat-install-clean: | |
19 | # Removes the state files from the run of an ``install'' target. | 4 | # Removes the state files from the run of an ``install'' target. | |
20 | # | 5 | # | |
21 | 6 | |||
22 | _pkgformat-check-conflicts: .PHONY error-check | |||
23 | ${RUN}${RM} -f ${WRKDIR}/.CONFLICTS | |||
24 | .for _conflict_ in ${CONFLICTS} | |||
25 | ${RUN} \ | |||
26 | found="`${_PKG_BEST_EXISTS} ${_conflict_:Q} || ${TRUE}`"; \ | |||
27 | case "$$found" in \ | |||
28 | "") ;; \ | |||
29 | *) ${ECHO} "$$found" >> ${WRKDIR}/.CONFLICTS ;; \ | |||
30 | esac | |||
31 | .endfor | |||
32 | ${RUN} \ | |||
33 | ${TEST} -f ${WRKDIR}/.CONFLICTS || exit 0; \ | |||
34 | exec 1>${ERROR_DIR}/${.TARGET}; \ | |||
35 | ${ECHO} "${PKGNAME} conflicts with installed package(s):"; \ | |||
36 | ${CAT} ${WRKDIR}/.CONFLICTS | ${SED} -e "s|^| |"; \ | |||
37 | ${ECHO} "They install the same files into the same place."; \ | |||
38 | ${ECHO} "Please remove conflicts first with pkg_delete(1)."; \ | |||
39 | ${RM} -f ${WRKDIR}/.CONFLICTS | |||
40 | ||||
41 | _pkgformat-check-installed: .PHONY error-check | |||
42 | ${RUN} \ | |||
43 | found="`${_PKG_BEST_EXISTS} ${PKGWILDCARD:Q} || ${TRUE}`"; \ | |||
44 | ${TEST} -n "$$found" || exit 0; \ | |||
45 | exec 1>${ERROR_DIR}/${.TARGET}; \ | |||
46 | ${ECHO} "$$found is already installed - perhaps an older version?"; \ | |||
47 | ${ECHO} "If so, you may use either of:"; \ | |||
48 | ${ECHO} " - \"pkg_delete $$found\" and \"${MAKE} reinstall\""; \ | |||
49 | ${ECHO} " to upgrade properly"; \ | |||
50 | ${ECHO} " - \"${MAKE} update\" to rebuild the package and all"; \ | |||
51 | ${ECHO} " of its dependencies"; \ | |||
52 | ${ECHO} " - \"${MAKE} replace\" to replace only the package without"; \ | |||
53 | ${ECHO} " re-linking dependencies, risking various problems." | |||
54 | ||||
55 | _REGISTER_DEPENDENCIES= \ | |||
56 | ${PKGSRC_SETENV} PKG_DBDIR=${_PKG_DBDIR:Q} \ | |||
57 | AWK=${TOOLS_AWK:Q} \ | |||
58 | ${SH} ${PKGSRCDIR}/mk/pkgformat/pkg/register-dependencies | |||
59 | ||||
60 | _pkgformat-register: .PHONY _pkgformat-generate-metadata ${_RDEPENDS_FILE} | |||
61 | @${STEP_MSG} "Registering installation for ${PKGNAME}" | |||
62 | ${RUN}${RM} -fr ${_PKG_DBDIR}/${PKGNAME} | |||
63 | ${RUN}${MKDIR} ${_PKG_DBDIR}/${PKGNAME} | |||
64 | ${RUN}${CP} ${PKG_DB_TMPDIR}/* ${_PKG_DBDIR}/${PKGNAME} | |||
65 | ${RUN}${PKG_ADMIN} add ${PKGNAME} | |||
66 | ${RUN} \ | |||
67 | case ${_AUTOMATIC:Q}"" in \ | |||
68 | [yY][eE][sS]) ${PKG_ADMIN} set automatic=yes ${PKGNAME} ;; \ | |||
69 | esac | |||
70 | ${RUN}${_FULL_DEPENDS_CMD} | \ | |||
71 | ${SORT} -u | ${_REGISTER_DEPENDENCIES} ${PKGNAME} | |||
72 | ${RUN}${GREP} '^@pkgdir ' < ${_PKG_DBDIR}/${PKGNAME}/+CONTENTS | \ | |||
73 | while read tag dir; do ${MKDIR} ${PREFIX}/$$dir; done | |||
74 | ||||
75 | _pkgformat-install-clean: .PHONY _pkgformat-clean-metadata | 7 | _pkgformat-install-clean: .PHONY _pkgformat-clean-metadata |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: metadata.mk,v 1.12 2015/07/04 16:18:38 joerg Exp $ | 1 | # $NetBSD: metadata.mk,v 1.13 2016/04/10 15:58:03 joerg Exp $ | |
2 | 2 | |||
3 | ###################################################################### | 3 | ###################################################################### | |
4 | ### The targets below are all PRIVATE. | 4 | ### The targets below are all PRIVATE. | |
5 | ###################################################################### | 5 | ###################################################################### | |
6 | 6 | |||
7 | ###################################################################### | 7 | ###################################################################### | |
8 | ### | 8 | ### | |
9 | ### Temporary package meta-data directory. The contents of this directory | 9 | ### Temporary package meta-data directory. The contents of this directory | |
10 | ### are copied directly into the real package meta-data directory. | 10 | ### are copied directly into the real package meta-data directory. | |
11 | ### | 11 | ### | |
12 | PKG_DB_TMPDIR= ${WRKDIR}/.pkgdb | 12 | PKG_DB_TMPDIR= ${WRKDIR}/.pkgdb | |
13 | 13 | |||
14 | unprivileged-install-hook: ${PKG_DB_TMPDIR} | 14 | unprivileged-install-hook: ${PKG_DB_TMPDIR} | |
@@ -237,47 +237,26 @@ MESSAGE_SUBST+= PKGNAME=${PKGNAME} \ | @@ -237,47 +237,26 @@ MESSAGE_SUBST+= PKGNAME=${PKGNAME} \ | |||
237 | EMULSUBDIR=${EMULSUBDIR} \ | 237 | EMULSUBDIR=${EMULSUBDIR} \ | |
238 | LOCALBASE=${LOCALBASE} \ | 238 | LOCALBASE=${LOCALBASE} \ | |
239 | X11BASE=${X11BASE} \ | 239 | X11BASE=${X11BASE} \ | |
240 | PKG_SYSCONFDIR=${PKG_SYSCONFDIR} \ | 240 | PKG_SYSCONFDIR=${PKG_SYSCONFDIR} \ | |
241 | ROOT_GROUP=${REAL_ROOT_GROUP} \ | 241 | ROOT_GROUP=${REAL_ROOT_GROUP} \ | |
242 | ROOT_USER=${REAL_ROOT_USER} | 242 | ROOT_USER=${REAL_ROOT_USER} | |
243 | 243 | |||
244 | _MESSAGE_SUBST_SED= ${MESSAGE_SUBST:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/} | 244 | _MESSAGE_SUBST_SED= ${MESSAGE_SUBST:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/} | |
245 | 245 | |||
246 | ${_MESSAGE_FILE}: ${MESSAGE_SRC} | 246 | ${_MESSAGE_FILE}: ${MESSAGE_SRC} | |
247 | ${RUN}${MKDIR} ${.TARGET:H} | 247 | ${RUN}${MKDIR} ${.TARGET:H} | |
248 | ${RUN}${CAT} ${.ALLSRC} | \ | 248 | ${RUN}${CAT} ${.ALLSRC} | \ | |
249 | ${SED} ${_MESSAGE_SUBST_SED} > ${.TARGET} | 249 | ${SED} ${_MESSAGE_SUBST_SED} > ${.TARGET} | |
250 | ||||
251 | # Display MESSAGE file and optionally mail the contents to | |||
252 | # PKGSRC_MESSAGE_RECIPIENTS. | |||
253 | # | |||
254 | .PHONY: install-display-message | |||
255 | _pkgformat-register: install-display-message | |||
256 | install-display-message: ${_MESSAGE_FILE} | |||
257 | @${STEP_MSG} "Please note the following:" | |||
258 | @${ECHO_MSG} "" | |||
259 | @${CAT} ${_MESSAGE_FILE} | |||
260 | @${ECHO_MSG} "" | |||
261 | . if !empty(PKGSRC_MESSAGE_RECIPIENTS) | |||
262 | ${RUN} \ | |||
263 | (${ECHO} "The ${PKGNAME} package was installed on `${HOSTNAME_CMD}` at `date`"; \ | |||
264 | ${ECHO} ""; \ | |||
265 | ${ECHO} "Please note the following:"; \ | |||
266 | ${ECHO} ""; \ | |||
267 | ${CAT} ${_MESSAGE_FILE}; \ | |||
268 | ${ECHO} "") | \ | |||
269 | ${MAIL_CMD} -s"Package ${PKGNAME} installed on `${HOSTNAME_CMD}`" ${PKGSRC_MESSAGE_RECIPIENTS} | |||
270 | . endif | |||
271 | .endif # MESSAGE_SRC | 250 | .endif # MESSAGE_SRC | |
272 | 251 | |||
273 | ###################################################################### | 252 | ###################################################################### | |
274 | ### | 253 | ### | |
275 | ### +PRESERVE - Package preserve file | 254 | ### +PRESERVE - Package preserve file | |
276 | ### | 255 | ### | |
277 | ### The existence of this file prevents pkg_delete from removing this | 256 | ### The existence of this file prevents pkg_delete from removing this | |
278 | ### package unless one "force-deletes" the package. | 257 | ### package unless one "force-deletes" the package. | |
279 | ### | 258 | ### | |
280 | .if defined(PKG_PRESERVE) | 259 | .if defined(PKG_PRESERVE) | |
281 | _PRESERVE_FILE= ${PKG_DB_TMPDIR}/+PRESERVE | 260 | _PRESERVE_FILE= ${PKG_DB_TMPDIR}/+PRESERVE | |
282 | _METADATA_TARGETS+= ${_PRESERVE_FILE} | 261 | _METADATA_TARGETS+= ${_PRESERVE_FILE} | |
283 | 262 | |||
@@ -354,31 +333,27 @@ _PKG_CREATE_ARGS+= -B ${_BUILD_INFO_F | @@ -354,31 +333,27 @@ _PKG_CREATE_ARGS+= -B ${_BUILD_INFO_F | |||
354 | _PKG_CREATE_ARGS+= -b ${_BUILD_VERSION_FILE} | 333 | _PKG_CREATE_ARGS+= -b ${_BUILD_VERSION_FILE} | |
355 | _PKG_CREATE_ARGS+= -c ${_COMMENT_FILE} | 334 | _PKG_CREATE_ARGS+= -c ${_COMMENT_FILE} | |
356 | _PKG_CREATE_ARGS+= ${_MESSAGE_FILE:D -D ${_MESSAGE_FILE}} | 335 | _PKG_CREATE_ARGS+= ${_MESSAGE_FILE:D -D ${_MESSAGE_FILE}} | |
357 | _PKG_CREATE_ARGS+= -d ${_DESCR_FILE} | 336 | _PKG_CREATE_ARGS+= -d ${_DESCR_FILE} | |
358 | _PKG_CREATE_ARGS+= -f ${_DEPENDS_PLIST} | 337 | _PKG_CREATE_ARGS+= -f ${_DEPENDS_PLIST} | |
359 | _PKG_CREATE_ARGS+= ${PKG_PRESERVE:D -n ${_PRESERVE_FILE}} | 338 | _PKG_CREATE_ARGS+= ${PKG_PRESERVE:D -n ${_PRESERVE_FILE}} | |
360 | _PKG_CREATE_ARGS+= -S ${_SIZE_ALL_FILE} | 339 | _PKG_CREATE_ARGS+= -S ${_SIZE_ALL_FILE} | |
361 | _PKG_CREATE_ARGS+= -s ${_SIZE_PKG_FILE} | 340 | _PKG_CREATE_ARGS+= -s ${_SIZE_PKG_FILE} | |
362 | _PKG_CREATE_ARGS+= ${CONFLICTS:D -C ${CONFLICTS:Q}} | 341 | _PKG_CREATE_ARGS+= ${CONFLICTS:D -C ${CONFLICTS:Q}} | |
363 | _PKG_CREATE_ARGS+= ${INSTALL_FILE:D ${_INSTALL_ARG_cmd:sh}} | 342 | _PKG_CREATE_ARGS+= ${INSTALL_FILE:D ${_INSTALL_ARG_cmd:sh}} | |
364 | _PKG_CREATE_ARGS+= ${DEINSTALL_FILE:D ${_DEINSTALL_ARG_cmd:sh}} | 343 | _PKG_CREATE_ARGS+= ${DEINSTALL_FILE:D ${_DEINSTALL_ARG_cmd:sh}} | |
365 | 344 | |||
366 | _PKG_ARGS_INSTALL+= ${_PKG_CREATE_ARGS} | 345 | _PKG_ARGS_INSTALL+= ${_PKG_CREATE_ARGS} | |
367 | .if ${_USE_DESTDIR} == "no" | |||
368 | _PKG_ARGS_INSTALL+= -p ${PREFIX} | |||
369 | .else | |||
370 | _PKG_ARGS_INSTALL+= -I ${PREFIX} -p ${DESTDIR}${PREFIX} | 346 | _PKG_ARGS_INSTALL+= -I ${PREFIX} -p ${DESTDIR}${PREFIX} | |
371 | .endif | |||
372 | 347 | |||
373 | _DEINSTALL_ARG_cmd= if ${TEST} -f ${DEINSTALL_FILE}; then \ | 348 | _DEINSTALL_ARG_cmd= if ${TEST} -f ${DEINSTALL_FILE}; then \ | |
374 | ${ECHO} "-k "${DEINSTALL_FILE:Q}; \ | 349 | ${ECHO} "-k "${DEINSTALL_FILE:Q}; \ | |
375 | else \ | 350 | else \ | |
376 | ${ECHO}; \ | 351 | ${ECHO}; \ | |
377 | fi | 352 | fi | |
378 | _INSTALL_ARG_cmd= if ${TEST} -f ${INSTALL_FILE}; then \ | 353 | _INSTALL_ARG_cmd= if ${TEST} -f ${INSTALL_FILE}; then \ | |
379 | ${ECHO} "-i "${INSTALL_FILE:Q}; \ | 354 | ${ECHO} "-i "${INSTALL_FILE:Q}; \ | |
380 | else \ | 355 | else \ | |
381 | ${ECHO}; \ | 356 | ${ECHO}; \ | |
382 | fi | 357 | fi | |
383 | 358 | |||
384 | _CONTENTS_TARGETS+= ${_BUILD_INFO_FILE} | 359 | _CONTENTS_TARGETS+= ${_BUILD_INFO_FILE} |
@@ -1,82 +1,53 @@ | @@ -1,82 +1,53 @@ | |||
1 | # $NetBSD: package.mk,v 1.13 2016/02/02 08:15:07 rillig Exp $ | 1 | # $NetBSD: package.mk,v 1.14 2016/04/10 15:58:03 joerg Exp $ | |
2 | 2 | |||
3 | .if defined(PKG_SUFX) | 3 | .if defined(PKG_SUFX) | |
4 | WARNINGS+= "PKG_SUFX is deprecated, please use PKG_COMPRESSION" | 4 | WARNINGS+= "PKG_SUFX is deprecated, please use PKG_COMPRESSION" | |
5 | . if ${PKG_SUFX} == ".tgz" | 5 | . if ${PKG_SUFX} == ".tgz" | |
6 | PKG_COMPRESSION= gzip | 6 | PKG_COMPRESSION= gzip | |
7 | . elif ${PKG_SUFX} == ".tbz" | 7 | . elif ${PKG_SUFX} == ".tbz" | |
8 | PKG_COMPRESSION= bzip2 | 8 | PKG_COMPRESSION= bzip2 | |
9 | . else | 9 | . else | |
10 | WARNINGS+= "Unsupported value for PKG_SUFX" | 10 | WARNINGS+= "Unsupported value for PKG_SUFX" | |
11 | . endif | 11 | . endif | |
12 | .endif | 12 | .endif | |
13 | PKG_SUFX?= .tgz | 13 | PKG_SUFX?= .tgz | |
14 | FILEBASE?= ${PKGBASE} | 14 | FILEBASE?= ${PKGBASE} | |
15 | PKGFILE?= ${PKGREPOSITORY}/${FILEBASE}-${PKGVERSION}${PKG_SUFX} | 15 | PKGFILE?= ${PKGREPOSITORY}/${FILEBASE}-${PKGVERSION}${PKG_SUFX} | |
16 | .if ${_USE_DESTDIR} == "no" | |||
17 | . if !empty(SIGN_PACKAGES:Mgpg) | |||
18 | STAGE_PKGFILE?= ${WRKDIR}/.packages/${FILEBASE}-${PKGVERSION}${PKG_SUFX} | 16 | STAGE_PKGFILE?= ${WRKDIR}/.packages/${FILEBASE}-${PKGVERSION}${PKG_SUFX} | |
19 | . elif !empty(SIGN_PACKAGES:Mx509) | |||
20 | STAGE_PKGFILE?= ${WRKDIR}/.packages/${FILEBASE}-${PKGVERSION}${PKG_SUFX} | |||
21 | . else | |||
22 | STAGE_PKGFILE?= ${PKGFILE} | |||
23 | . endif | |||
24 | .else | |||
25 | STAGE_PKGFILE?= ${WRKDIR}/.packages/${FILEBASE}-${PKGVERSION}${PKG_SUFX} | |||
26 | .endif | |||
27 | PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR} | 17 | PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR} | |
28 | PKGREPOSITORYSUBDIR?= All | 18 | PKGREPOSITORYSUBDIR?= All | |
29 | 19 | |||
30 | ###################################################################### | 20 | ###################################################################### | |
31 | ### package-check-installed (PRIVATE, pkgsrc/mk/package/package.mk) | |||
32 | ###################################################################### | |||
33 | ### package-check-installed verifies that the package is installed on | |||
34 | ### the system. | |||
35 | ### | |||
36 | .PHONY: package-check-installed | |||
37 | package-check-installed: | |||
38 | ${RUN} ${PKG_INFO} -qe ${PKGNAME} \ | |||
39 | || ${FAIL_MSG} "${PKGNAME} is not installed." | |||
40 | ||||
41 | ###################################################################### | |||
42 | ### package-create (PRIVATE, pkgsrc/mk/package/package.mk) | 21 | ### package-create (PRIVATE, pkgsrc/mk/package/package.mk) | |
43 | ###################################################################### | 22 | ###################################################################### | |
44 | ### package-create creates the binary package. | 23 | ### package-create creates the binary package. | |
45 | ### | 24 | ### | |
46 | .PHONY: package-create | 25 | .PHONY: package-create | |
47 | package-create: ${PKGFILE} package-links | 26 | package-create: ${PKGFILE} package-links | |
48 | 27 | |||
49 | ###################################################################### | 28 | ###################################################################### | |
50 | ### stage-package-create (PRIVATE, pkgsrc/mk/package/package.mk) | 29 | ### stage-package-create (PRIVATE, pkgsrc/mk/package/package.mk) | |
51 | ###################################################################### | 30 | ###################################################################### | |
52 | ### stage-package-create creates the binary package for stage install. | 31 | ### stage-package-create creates the binary package for stage install. | |
53 | ### | 32 | ### | |
54 | .PHONY: stage-package-create | 33 | .PHONY: stage-package-create | |
55 | .if ${_USE_DESTDIR} == "no" | |||
56 | stage-package-create: package-create | |||
57 | .else | |||
58 | stage-package-create: stage-install ${STAGE_PKGFILE} | 34 | stage-package-create: stage-install ${STAGE_PKGFILE} | |
59 | .endif | |||
60 | 35 | |||
61 | _PKG_ARGS_PACKAGE+= ${_PKG_CREATE_ARGS} | 36 | _PKG_ARGS_PACKAGE+= ${_PKG_CREATE_ARGS} | |
62 | _PKG_ARGS_PACKAGE+= -F ${PKG_COMPRESSION} | 37 | _PKG_ARGS_PACKAGE+= -F ${PKG_COMPRESSION} | |
63 | .if ${_USE_DESTDIR} == "no" | |||
64 | _PKG_ARGS_PACKAGE+= -p ${PREFIX} | |||
65 | .else | |||
66 | _PKG_ARGS_PACKAGE+= -I ${PREFIX} -p ${DESTDIR}${PREFIX} | 38 | _PKG_ARGS_PACKAGE+= -I ${PREFIX} -p ${DESTDIR}${PREFIX} | |
67 | . if ${_USE_DESTDIR} == "user-destdir" | 39 | .if ${_USE_DESTDIR} == "user-destdir" | |
68 | _PKG_ARGS_PACKAGE+= -u ${REAL_ROOT_USER} -g ${REAL_ROOT_GROUP} | 40 | _PKG_ARGS_PACKAGE+= -u ${REAL_ROOT_USER} -g ${REAL_ROOT_GROUP} | |
69 | . endif | |||
70 | .endif | 41 | .endif | |
71 | 42 | |||
72 | ${STAGE_PKGFILE}: ${_CONTENTS_TARGETS} | 43 | ${STAGE_PKGFILE}: ${_CONTENTS_TARGETS} | |
73 | @${STEP_MSG} "Creating binary package ${.TARGET}" | 44 | @${STEP_MSG} "Creating binary package ${.TARGET}" | |
74 | ${RUN} ${MKDIR} ${.TARGET:H}; ${_ULIMIT_CMD} \ | 45 | ${RUN} ${MKDIR} ${.TARGET:H}; ${_ULIMIT_CMD} \ | |
75 | tmpname=${.TARGET:S,${PKG_SUFX}$,.tmp${PKG_SUFX},}; \ | 46 | tmpname=${.TARGET:S,${PKG_SUFX}$,.tmp${PKG_SUFX},}; \ | |
76 | if ! ${PKG_CREATE} ${_PKG_ARGS_PACKAGE} "$$tmpname"; then \ | 47 | if ! ${PKG_CREATE} ${_PKG_ARGS_PACKAGE} "$$tmpname"; then \ | |
77 | exitcode=$$?; ${RM} -f "$$tmpname"; exit $$exitcode; \ | 48 | exitcode=$$?; ${RM} -f "$$tmpname"; exit $$exitcode; \ | |
78 | fi | 49 | fi | |
79 | .if !empty(SIGN_PACKAGES:U:Mgpg) | 50 | .if !empty(SIGN_PACKAGES:U:Mgpg) | |
80 | @${STEP_MSG} "Signing binary package ${.TARGET} (GPG)" | 51 | @${STEP_MSG} "Signing binary package ${.TARGET} (GPG)" | |
81 | ${RUN} tmpname=${.TARGET:S,${PKG_SUFX}$,.tmp${PKG_SUFX},}; \ | 52 | ${RUN} tmpname=${.TARGET:S,${PKG_SUFX}$,.tmp${PKG_SUFX},}; \ | |
82 | ${PKG_ADMIN} gpg-sign-package "$$tmpname" ${.TARGET} | 53 | ${PKG_ADMIN} gpg-sign-package "$$tmpname" ${.TARGET} | |
@@ -177,35 +148,30 @@ tarup-pkg: | @@ -177,35 +148,30 @@ tarup-pkg: | |||
177 | .if defined(_PKGSRC_BARRIER) | 148 | .if defined(_PKGSRC_BARRIER) | |
178 | package-install: package real-package-install | 149 | package-install: package real-package-install | |
179 | .else | 150 | .else | |
180 | package-install: barrier | 151 | package-install: barrier | |
181 | .endif | 152 | .endif | |
182 | 153 | |||
183 | .PHONY: stage-package-install | 154 | .PHONY: stage-package-install | |
184 | .if defined(_PKGSRC_BARRIER) | 155 | .if defined(_PKGSRC_BARRIER) | |
185 | stage-package-install: stage-package-create real-package-install | 156 | stage-package-install: stage-package-create real-package-install | |
186 | .else | 157 | .else | |
187 | stage-package-install: barrier | 158 | stage-package-install: barrier | |
188 | .endif | 159 | .endif | |
189 | 160 | |||
190 | .if ${_USE_DESTDIR} != "no" | 161 | .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) | |
191 | . if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) | |||
192 | real-package-install: su-real-package-install | 162 | real-package-install: su-real-package-install | |
193 | . else | |||
194 | real-package-install: su-target | |||
195 | . endif | |||
196 | .else | 163 | .else | |
197 | real-package-install: | 164 | real-package-install: su-target | |
198 | @${DO_NADA} | |||
199 | .endif | 165 | .endif | |
200 | 166 | |||
201 | MAKEFLAGS.su-real-package-install= PKGNAME_REQD=${PKGNAME_REQD:Q} | 167 | MAKEFLAGS.su-real-package-install= PKGNAME_REQD=${PKGNAME_REQD:Q} | |
202 | su-real-package-install: | 168 | su-real-package-install: | |
203 | @${PHASE_MSG} "Installing binary package of "${PKGNAME:Q} | 169 | @${PHASE_MSG} "Installing binary package of "${PKGNAME:Q} | |
204 | .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) | 170 | .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) | |
205 | @${MKDIR} ${_CROSS_DESTDIR}${PREFIX} | 171 | @${MKDIR} ${_CROSS_DESTDIR}${PREFIX} | |
206 | ${PKG_ADD} -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${STAGE_PKGFILE} | 172 | ${PKG_ADD} -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${STAGE_PKGFILE} | |
207 | @${ECHO} "Fixing recorded cwd..." | 173 | @${ECHO} "Fixing recorded cwd..." | |
208 | @${SED} -e 's|@cwd ${_CROSS_DESTDIR}|@cwd |' ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS > ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp | 174 | @${SED} -e 's|@cwd ${_CROSS_DESTDIR}|@cwd |' ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS > ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp | |
209 | @${MV} ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS | 175 | @${MV} ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS | |
210 | .else | 176 | .else | |
211 | ${RUN} case ${_AUTOMATIC:Q}"" in \ | 177 | ${RUN} case ${_AUTOMATIC:Q}"" in \ |
@@ -1,26 +1,20 @@ | @@ -1,26 +1,20 @@ | |||
1 | # $NetBSD: pkgformat.mk,v 1.2 2014/12/30 15:13:20 wiz Exp $ | 1 | # $NetBSD: pkgformat.mk,v 1.3 2016/04/10 15:58:03 joerg Exp $ | |
2 | # | 2 | # | |
3 | # This Makefile fragment provides variable and target overrides that are | 3 | # This Makefile fragment provides variable and target overrides that are | |
4 | # specific to the pkgsrc native package format. | 4 | # specific to the pkgsrc native package format. | |
5 | # | 5 | # | |
6 | 6 | |||
7 | # PKG_FILELIST_CMD outputs the list of files owned by ${PKGNAME} as | 7 | # PKG_FILELIST_CMD outputs the list of files in the package based on | |
8 | # registered on the system. | 8 | # _DEPENDS_PLIST. | |
9 | # | 9 | # | |
10 | # For DESTDIR support, just use _DEPENDS_PLIST instead. | |||
11 | # | |||
12 | .if ${_USE_DESTDIR} == "no" | |||
13 | PKG_FILELIST_CMD= ${PKG_INFO} -qL ${PKGNAME:Q} | |||
14 | .else | |||
15 | PKG_FILELIST_CMD= ${SED} -e "/^@/d" -e "s|^|${PREFIX}/|" ${_DEPENDS_PLIST} | 10 | PKG_FILELIST_CMD= ${SED} -e "/^@/d" -e "s|^|${PREFIX}/|" ${_DEPENDS_PLIST} | |
16 | .endif | |||
17 | 11 | |||
18 | .include "depends.mk" | 12 | .include "depends.mk" | |
19 | .include "check.mk" | 13 | .include "check.mk" | |
20 | .include "metadata.mk" | 14 | .include "metadata.mk" | |
21 | .include "install.mk" | 15 | .include "install.mk" | |
22 | .include "deinstall.mk" | 16 | .include "deinstall.mk" | |
23 | .include "replace.mk" | 17 | .include "replace.mk" | |
24 | .include "package.mk" | 18 | .include "package.mk" | |
25 | 19 | |||
26 | .include "utility.mk" | 20 | .include "utility.mk" |
@@ -1,29 +1,24 @@ | @@ -1,29 +1,24 @@ | |||
1 | # $NetBSD: replace.mk,v 1.2 2013/05/23 13:18:56 obache Exp $ | 1 | # $NetBSD: replace.mk,v 1.3 2016/04/10 15:58:03 joerg Exp $ | |
2 | # | 2 | # | |
3 | 3 | |||
4 | # _pkgformat-replace: | |||
5 | # Updates a package in-place on the system (USE_DESTDIR=no). | |||
6 | # | |||
7 | # _pkgformat-destdir-replace: | 4 | # _pkgformat-destdir-replace: | |
8 | # Updates a package in-place on the system (USE_DESTDIR=yes). | 5 | # Updates a package in-place on the system. | |
9 | # | 6 | # | |
10 | # See also: | 7 | # See also: | |
11 | # replace | 8 | # replace | |
12 | # | 9 | # | |
13 | # XXX: The whole replacement, from deinstalling the old package up | 10 | # XXX: The whole replacement, from deinstalling the old package up | |
14 | # to installing the new package, should be one transaction. It | 11 | # to installing the new package, should be one transaction. | |
15 | # currently isn't, and the check-files target for other packages | |||
16 | # can be confused when a +REQUIRED_BY files suddenly disappears. | |||
17 | # | 12 | # | |
18 | _pkgformat-replace: \ | 13 | _pkgformat-replace: \ | |
19 | replace-names \ | 14 | replace-names \ | |
20 | replace-tarup \ | 15 | replace-tarup \ | |
21 | replace-preserve-installed-info \ | 16 | replace-preserve-installed-info \ | |
22 | replace-preserve-required-by \ | 17 | replace-preserve-required-by \ | |
23 | deinstall \ | 18 | deinstall \ | |
24 | install-clean \ | 19 | install-clean \ | |
25 | install \ | 20 | install \ | |
26 | replace-fixup-required-by \ | 21 | replace-fixup-required-by \ | |
27 | replace-fixup-installed-info \ | 22 | replace-fixup-installed-info \ | |
28 | .PHONY | 23 | .PHONY | |
29 | 24 |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: bsd.pkginstall.mk,v 1.65 2016/04/10 15:33:42 joerg Exp $ | 1 | # $NetBSD: bsd.pkginstall.mk,v 1.66 2016/04/10 15:58:03 joerg Exp $ | |
2 | # | 2 | # | |
3 | # This Makefile fragment is included by bsd.pkg.mk and implements the | 3 | # This Makefile fragment is included by bsd.pkg.mk and implements the | |
4 | # common INSTALL/DEINSTALL scripts framework. To use the pkginstall | 4 | # common INSTALL/DEINSTALL scripts framework. To use the pkginstall | |
5 | # framework, simply set the relevant variables to customize the install | 5 | # framework, simply set the relevant variables to customize the install | |
6 | # scripts to the package. | 6 | # scripts to the package. | |
7 | # | 7 | # | |
8 | # User-settable variables: | 8 | # User-settable variables: | |
9 | # | 9 | # | |
10 | # FONTS_VERBOSE indicates whether the +FONTS scriptlet will output a message | 10 | # FONTS_VERBOSE indicates whether the +FONTS scriptlet will output a message | |
11 | # noting the actions taken if PKG_UPDATE_FONTS_DB is YES. It is either | 11 | # noting the actions taken if PKG_UPDATE_FONTS_DB is YES. It is either | |
12 | # YES or NO and defaults to YES for PKG_DEVELOPERs, otherwise NO. | 12 | # YES or NO and defaults to YES for PKG_DEVELOPERs, otherwise NO. | |
13 | # | 13 | # | |
14 | # INFO_FILES_VERBOSE indicates whether the +INFO_FILES scriptlet will output | 14 | # INFO_FILES_VERBOSE indicates whether the +INFO_FILES scriptlet will output | |
@@ -363,29 +363,28 @@ su-create-usergroup: ${_INSTALL_USERGROU | @@ -363,29 +363,28 @@ su-create-usergroup: ${_INSTALL_USERGROU | |||
363 | exit $$exitcode | 363 | exit $$exitcode | |
364 | 364 | |||
365 | # SPECIAL_PERMS are lists that look like: | 365 | # SPECIAL_PERMS are lists that look like: | |
366 | # file user group mode | 366 | # file user group mode | |
367 | # At post-install time, <file> (it may be a directory) is changed | 367 | # At post-install time, <file> (it may be a directory) is changed | |
368 | # to be owned by <user>:<group> with <mode> permissions. If a file | 368 | # to be owned by <user>:<group> with <mode> permissions. If a file | |
369 | # pathname is relative, then it is taken to be relative to ${PREFIX}. | 369 | # pathname is relative, then it is taken to be relative to ${PREFIX}. | |
370 | # | 370 | # | |
371 | # SPECIAL_PERMS should be used primarily to change permissions of | 371 | # SPECIAL_PERMS should be used primarily to change permissions of | |
372 | # files or directories listed in the PLIST. This may be used to | 372 | # files or directories listed in the PLIST. This may be used to | |
373 | # make certain files set-uid or to change the ownership or a | 373 | # make certain files set-uid or to change the ownership or a | |
374 | # directory. | 374 | # directory. | |
375 | # | 375 | # | |
376 | # Note that when USE_DESTDIR is in effect, the special permissions | 376 | # The special permissions may not directly recorded (as file | |
377 | # are not directly recorded (as file attributes) in the binary | 377 | # attributes) in the binary package file. | |
378 | # package file. | |||
379 | # | 378 | # | |
380 | # SETUID_ROOT_PERMS is a convenience definition to note an executable is | 379 | # SETUID_ROOT_PERMS is a convenience definition to note an executable is | |
381 | # meant to be setuid-root, and should be used as follows: | 380 | # meant to be setuid-root, and should be used as follows: | |
382 | # | 381 | # | |
383 | # SPECIAL_PERMS+= /path/to/suidroot ${SETUID_ROOT_PERMS} | 382 | # SPECIAL_PERMS+= /path/to/suidroot ${SETUID_ROOT_PERMS} | |
384 | # | 383 | # | |
385 | # SETGID_GAMES_PERMS is a convenience definition to note an executable is | 384 | # SETGID_GAMES_PERMS is a convenience definition to note an executable is | |
386 | # meant to be setgid games, and should be used as follows: | 385 | # meant to be setgid games, and should be used as follows: | |
387 | # | 386 | # | |
388 | # SPECIAL_PERMS+= /path/to/sgidgame ${SETGID_GAMES_PERMS} | 387 | # SPECIAL_PERMS+= /path/to/sgidgame ${SETGID_GAMES_PERMS} | |
389 | # | 388 | # | |
390 | # GAMEDATA_PERMS and GAMEDIR_PERMS are convenience definitions for files | 389 | # GAMEDATA_PERMS and GAMEDIR_PERMS are convenience definitions for files | |
391 | # that are meant to be accessed by things that are setgid games. Because | 390 | # that are meant to be accessed by things that are setgid games. Because | |
@@ -1049,28 +1048,26 @@ FILES_SUBST+= TOUCH=${TOUCH:Q} | @@ -1049,28 +1048,26 @@ FILES_SUBST+= TOUCH=${TOUCH:Q} | |||
1049 | FILES_SUBST+= TR=${TR:Q} | 1048 | FILES_SUBST+= TR=${TR:Q} | |
1050 | FILES_SUBST+= TRUE=${TRUE:Q} | 1049 | FILES_SUBST+= TRUE=${TRUE:Q} | |
1051 | FILES_SUBST+= USERADD=${USERADD:Q} | 1050 | FILES_SUBST+= USERADD=${USERADD:Q} | |
1052 | FILES_SUBST+= XARGS=${XARGS:Q} | 1051 | FILES_SUBST+= XARGS=${XARGS:Q} | |
1053 | 1052 | |||
1054 | FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/} | 1053 | FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/} | |
1055 | 1054 | |||
1056 | PKG_REFCOUNT_DBDIR?= ${PKG_DBDIR}.refcount | 1055 | PKG_REFCOUNT_DBDIR?= ${PKG_DBDIR}.refcount | |
1057 | 1056 | |||
1058 | INSTALL_SCRIPTS_ENV= PKG_PREFIX=${PREFIX} | 1057 | INSTALL_SCRIPTS_ENV= PKG_PREFIX=${PREFIX} | |
1059 | INSTALL_SCRIPTS_ENV+= PKG_METADATA_DIR=${_PKG_DBDIR}/${PKGNAME} | 1058 | INSTALL_SCRIPTS_ENV+= PKG_METADATA_DIR=${_PKG_DBDIR}/${PKGNAME} | |
1060 | INSTALL_SCRIPTS_ENV+= PKG_REFCOUNT_DBDIR=${PKG_REFCOUNT_DBDIR} | 1059 | INSTALL_SCRIPTS_ENV+= PKG_REFCOUNT_DBDIR=${PKG_REFCOUNT_DBDIR} | |
1061 | 1060 | |||
1062 | .PHONY: pre-install-script post-install-script | |||
1063 | ||||
1064 | DEINSTALL_FILE= ${PKG_DB_TMPDIR}/+DEINSTALL | 1061 | DEINSTALL_FILE= ${PKG_DB_TMPDIR}/+DEINSTALL | |
1065 | INSTALL_FILE= ${PKG_DB_TMPDIR}/+INSTALL | 1062 | INSTALL_FILE= ${PKG_DB_TMPDIR}/+INSTALL | |
1066 | _DEINSTALL_FILE= ${_PKGINSTALL_DIR}/DEINSTALL | 1063 | _DEINSTALL_FILE= ${_PKGINSTALL_DIR}/DEINSTALL | |
1067 | _INSTALL_FILE= ${_PKGINSTALL_DIR}/INSTALL | 1064 | _INSTALL_FILE= ${_PKGINSTALL_DIR}/INSTALL | |
1068 | _DEINSTALL_FILE_DFLT= ${_PKGINSTALL_DIR}/DEINSTALL.default | 1065 | _DEINSTALL_FILE_DFLT= ${_PKGINSTALL_DIR}/DEINSTALL.default | |
1069 | _INSTALL_FILE_DFLT= ${_PKGINSTALL_DIR}/INSTALL.default | 1066 | _INSTALL_FILE_DFLT= ${_PKGINSTALL_DIR}/INSTALL.default | |
1070 | 1067 | |||
1071 | .PHONY: generate-install-scripts | 1068 | .PHONY: generate-install-scripts | |
1072 | generate-install-scripts: \ | 1069 | generate-install-scripts: \ | |
1073 | ${_DEINSTALL_FILE} ${_INSTALL_FILE} \ | 1070 | ${_DEINSTALL_FILE} ${_INSTALL_FILE} \ | |
1074 | ${_DEINSTALL_FILE_DFLT} ${_INSTALL_FILE_DFLT} | 1071 | ${_DEINSTALL_FILE_DFLT} ${_INSTALL_FILE_DFLT} | |
1075 | .if !exists(${DEINSTALL_FILE}) || !exists(${INSTALL_FILE}) | 1072 | .if !exists(${DEINSTALL_FILE}) || !exists(${INSTALL_FILE}) | |
1076 | ${RUN}${MKDIR} ${INSTALL_FILE:H} | 1073 | ${RUN}${MKDIR} ${INSTALL_FILE:H} | |
@@ -1112,44 +1109,26 @@ ${_DEINSTALL_FILE}: ${DEINSTALL_SRC} | @@ -1112,44 +1109,26 @@ ${_DEINSTALL_FILE}: ${DEINSTALL_SRC} | |||
1112 | ${RUN}${CHMOD} +x ${.TARGET} | 1109 | ${RUN}${CHMOD} +x ${.TARGET} | |
1113 | 1110 | |||
1114 | ${_INSTALL_FILE}: ${INSTALL_SRC} | 1111 | ${_INSTALL_FILE}: ${INSTALL_SRC} | |
1115 | ${RUN}${MKDIR} ${.TARGET:H} | 1112 | ${RUN}${MKDIR} ${.TARGET:H} | |
1116 | ${RUN} \ | 1113 | ${RUN} \ | |
1117 | exec 1>>${.TARGET}; \ | 1114 | exec 1>>${.TARGET}; \ | |
1118 | case ${.ALLSRC:Q}"" in \ | 1115 | case ${.ALLSRC:Q}"" in \ | |
1119 | "") ${ECHO} "#!${SH}" ; \ | 1116 | "") ${ECHO} "#!${SH}" ; \ | |
1120 | ${ECHO} "exit 0" ;; \ | 1117 | ${ECHO} "exit 0" ;; \ | |
1121 | *) ${CAT} ${.ALLSRC} | ${SED} ${FILES_SUBST_SED} ;; \ | 1118 | *) ${CAT} ${.ALLSRC} | ${SED} ${FILES_SUBST_SED} ;; \ | |
1122 | esac | 1119 | esac | |
1123 | ${RUN}${CHMOD} +x ${.TARGET} | 1120 | ${RUN}${CHMOD} +x ${.TARGET} | |
1124 | 1121 | |||
1125 | pre-install-script: | |||
1126 | ${RUN} \ | |||
1127 | if ${TEST} -x ${INSTALL_FILE}; then \ | |||
1128 | ${STEP_MSG} "Running PRE-INSTALL script actions"; \ | |||
1129 | cd ${PKG_DB_TMPDIR} && ${PKGSRC_SETENV} ${INSTALL_SCRIPTS_ENV} \ | |||
1130 | ${_PKG_DEBUG_SCRIPT} ${INSTALL_FILE} ${PKGNAME} \ | |||
1131 | PRE-INSTALL; \ | |||
1132 | fi | |||
1133 | ||||
1134 | post-install-script: | |||
1135 | ${RUN} \ | |||
1136 | if ${TEST} -x ${INSTALL_FILE}; then \ | |||
1137 | ${STEP_MSG} "Running POST-INSTALL script actions"; \ | |||
1138 | cd ${PKG_DB_TMPDIR} && ${PKGSRC_SETENV} ${INSTALL_SCRIPTS_ENV} \ | |||
1139 | ${_PKG_DEBUG_SCRIPT} ${INSTALL_FILE} ${PKGNAME} \ | |||
1140 | POST-INSTALL; \ | |||
1141 | fi | |||
1142 | ||||
1143 | # rc.d scripts are automatically generated and installed into the rc.d | 1122 | # rc.d scripts are automatically generated and installed into the rc.d | |
1144 | # scripts example directory at the post-install step. The following | 1123 | # scripts example directory at the post-install step. The following | |
1145 | # variables are relevant to this process: | 1124 | # variables are relevant to this process: | |
1146 | # | 1125 | # | |
1147 | # RCD_SCRIPTS lists the basenames of the rc.d scripts | 1126 | # RCD_SCRIPTS lists the basenames of the rc.d scripts | |
1148 | # | 1127 | # | |
1149 | # RCD_SCRIPT_SRC.<script> the source file for <script>; this will | 1128 | # RCD_SCRIPT_SRC.<script> the source file for <script>; this will | |
1150 | # be run through FILES_SUBST to generate | 1129 | # be run through FILES_SUBST to generate | |
1151 | # the rc.d script (defaults to | 1130 | # the rc.d script (defaults to | |
1152 | # ${FILESDIR}/<script>.sh) | 1131 | # ${FILESDIR}/<script>.sh) | |
1153 | # | 1132 | # | |
1154 | # If the source rc.d script is not present, then the automatic handling | 1133 | # If the source rc.d script is not present, then the automatic handling | |
1155 | # doesn't occur. | 1134 | # doesn't occur. |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: print-plist.mk,v 1.27 2015/06/07 03:39:08 joerg Exp $ | 1 | # $NetBSD: print-plist.mk,v 1.28 2016/04/10 15:58:03 joerg Exp $ | |
2 | 2 | |||
3 | ### | 3 | ### | |
4 | ### Automatic PLIST generation | 4 | ### Automatic PLIST generation | |
5 | ### - files & symlinks first | 5 | ### - files & symlinks first | |
6 | ### - empty directories are handled properly | 6 | ### - empty directories are handled properly | |
7 | ### - dirs from mtree files are excluded | 7 | ### - dirs from mtree files are excluded | |
8 | ### - substitute for platform or package specifics substrings | 8 | ### - substitute for platform or package specifics substrings | |
9 | ### | 9 | ### | |
10 | ### Usage: | 10 | ### Usage: | |
11 | ### - make install | 11 | ### - make install | |
12 | ### - make print-PLIST | brain >PLIST | 12 | ### - make print-PLIST | brain >PLIST | |
13 | ### | 13 | ### | |
14 | 14 | |||
@@ -43,42 +43,32 @@ _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^([ | @@ -43,42 +43,32 @@ _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^([ | |||
43 | _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^.*\/encodings\.dir/) | 43 | _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^.*\/encodings\.dir/) | |
44 | _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^.*\/fonts\.dir/) | 44 | _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^.*\/fonts\.dir/) | |
45 | .endif | 45 | .endif | |
46 | .if (defined(FONTS_DIRS.ttf) && !empty(FONTS_DIRS.ttf:M*)) || \ | 46 | .if (defined(FONTS_DIRS.ttf) && !empty(FONTS_DIRS.ttf:M*)) || \ | |
47 | (defined(FONTS_DIRS.type1) && !empty(FONTS_DIRS.type1:M*)) | 47 | (defined(FONTS_DIRS.type1) && !empty(FONTS_DIRS.type1:M*)) | |
48 | _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^.*\/fonts\.scale/) | 48 | _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^.*\/fonts\.scale/) | |
49 | .endif | 49 | .endif | |
50 | .if (defined(FONTS_DIRS.ttf) && !empty(FONTS_DIRS.ttf:M*)) || \ | 50 | .if (defined(FONTS_DIRS.ttf) && !empty(FONTS_DIRS.ttf:M*)) || \ | |
51 | (defined(FONTS_DIRS.type1) && !empty(FONTS_DIRS.type1:M*)) || \ | 51 | (defined(FONTS_DIRS.type1) && !empty(FONTS_DIRS.type1:M*)) || \ | |
52 | (defined(FONTS_DIRS.x11) && !empty(FONTS_DIRS.x11:M*)) | 52 | (defined(FONTS_DIRS.x11) && !empty(FONTS_DIRS.x11:M*)) | |
53 | _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^.*\/fonts\.cache-1/) | 53 | _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^.*\/fonts\.cache-1/) | |
54 | .endif | 54 | .endif | |
55 | 55 | |||
56 | # scan $PREFIX for any files/dirs modified since the package was extracted | 56 | # List the content of $PREFIX and emit "@pkgdir " statements for | |
57 | # will emit "@exec mkdir"-statements for empty directories | 57 | # empty directories. | |
58 | # XXX will fail for data files that were copied using tar (e.g. emacs)! | |||
59 | # XXX should check $LOCALBASE and $X11BASE, and add @cwd statements | |||
60 | ||||
61 | .if ${_USE_DESTDIR} == "no" | |||
62 | _PRINT_PLIST_FILES_CMD= \ | |||
63 | ${FIND} ${DESTDIR}${PREFIX}/. -xdev -newer ${_COOKIE.extract} \! -type d -print | |||
64 | _PRINT_PLIST_DIRS_CMD= \ | |||
65 | ${FIND} ${DESTDIR}${PREFIX}/. -xdev -newer ${_COOKIE.extract} -type d -print | |||
66 | .else | |||
67 | _PRINT_PLIST_FILES_CMD= \ | 58 | _PRINT_PLIST_FILES_CMD= \ | |
68 | ${FIND} ${DESTDIR}${PREFIX}/. \! -type d -print | 59 | ${FIND} ${DESTDIR}${PREFIX}/. \! -type d -print | |
69 | _PRINT_PLIST_DIRS_CMD= \ | 60 | _PRINT_PLIST_DIRS_CMD= \ | |
70 | ${FIND} ${DESTDIR}${PREFIX}/. -type d -print | 61 | ${FIND} ${DESTDIR}${PREFIX}/. -type d -print | |
71 | .endif | |||
72 | 62 | |||
73 | .if !empty(LIBTOOLIZE_PLIST:M[yY][eE][sS]) | 63 | .if !empty(LIBTOOLIZE_PLIST:M[yY][eE][sS]) | |
74 | _PRINT_PLIST_LIBTOOLIZE_FILTER?= \ | 64 | _PRINT_PLIST_LIBTOOLIZE_FILTER?= \ | |
75 | ( \ | 65 | ( \ | |
76 | if ${TEST} -d ${WRKDIR}; then \ | 66 | if ${TEST} -d ${WRKDIR}; then \ | |
77 | tmpdir="${WRKDIR}"; \ | 67 | tmpdir="${WRKDIR}"; \ | |
78 | else \ | 68 | else \ | |
79 | tmpdir="$${TMPDIR-/tmp}"; \ | 69 | tmpdir="$${TMPDIR-/tmp}"; \ | |
80 | fi; \ | 70 | fi; \ | |
81 | fileslist="$$tmpdir/print.plist.files.$$$$"; \ | 71 | fileslist="$$tmpdir/print.plist.files.$$$$"; \ | |
82 | libslist="$$tmpdir/print.plist.libs.$$$$"; \ | 72 | libslist="$$tmpdir/print.plist.libs.$$$$"; \ | |
83 | while read file; do \ | 73 | while read file; do \ | |
84 | case $$file in \ | 74 | case $$file in \ |