Sun Apr 10 15:58:03 2016 UTC ()
Remove support for USE_DESTDIR=no.


(joerg)
diff -r1.384 -r1.385 pkgsrc/mk/bsd.prefs.mk
diff -r1.3 -r1.4 pkgsrc/mk/haskell.mk
diff -r1.10 -r1.11 pkgsrc/mk/build/bsd.build-vars.mk
diff -r1.28 -r1.29 pkgsrc/mk/check/check-shlibs.mk
diff -r1.15 -r1.16 pkgsrc/mk/install/bsd.install.mk
diff -r1.11 -r1.12 pkgsrc/mk/install/deinstall.mk
diff -r1.67 -r1.68 pkgsrc/mk/install/install.mk
diff -r1.17 -r1.18 pkgsrc/mk/install/replace.mk
diff -r1.24 -r1.25 pkgsrc/mk/package/package.mk
diff -r1.2 -r1.3 pkgsrc/mk/pkgformat/README
diff -r1.1 -r1.2 pkgsrc/mk/pkgformat/pkg/install.mk
diff -r1.12 -r1.13 pkgsrc/mk/pkgformat/pkg/metadata.mk
diff -r1.13 -r1.14 pkgsrc/mk/pkgformat/pkg/package.mk
diff -r1.2 -r1.3 pkgsrc/mk/pkgformat/pkg/pkgformat.mk
diff -r1.2 -r1.3 pkgsrc/mk/pkgformat/pkg/replace.mk
diff -r1.65 -r1.66 pkgsrc/mk/pkginstall/bsd.pkginstall.mk
diff -r1.27 -r1.28 pkgsrc/mk/plist/print-plist.mk

cvs diff -r1.384 -r1.385 pkgsrc/mk/bsd.prefs.mk (expand / switch to unified diff)

--- pkgsrc/mk/bsd.prefs.mk 2016/04/10 15:10:12 1.384
+++ pkgsrc/mk/bsd.prefs.mk 2016/04/10 15:58:02 1.385
@@ -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
395NO_BUILD= yes 395NO_BUILD= yes
396DISTFILES= # none 396DISTFILES= # none
397PLIST_SRC= # none 397PLIST_SRC= # none
398CHECK_PERMS= no 398CHECK_PERMS= no
399USE_LANGUAGES= # empty 399USE_LANGUAGES= # empty
400WRKSRC= ${WRKDIR} 400WRKSRC= ${WRKDIR}
401 401
402do-patch: 402do-patch:
403 @${DO_NADA} 403 @${DO_NADA}
404do-install: 404do-install:
405 @${DO_NADA} 405 @${DO_NADA}
406.endif 406.endif
407 407
408# After 2011Q1, the default is to use DESTDIR. 
409USE_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".
411PKG_DESTDIR_SUPPORT?= user-destdir 409PKG_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
418PKG_FAIL_REASON+= "PKG_DESTDIR_SUPPORT must be \`\`destdir'' or \`\`user-destdir''." 416PKG_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" 
425DESTDIR= ${WRKDIR}/.destdir 422DESTDIR= ${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 
436PKG_FAIL_REASON+= "USE_DESTDIR=no is no longer supported." 
437DESTDIR= 
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.

cvs diff -r1.3 -r1.4 pkgsrc/mk/haskell.mk (expand / switch to unified diff)

--- pkgsrc/mk/haskell.mk 2015/02/17 13:57:47 1.3
+++ pkgsrc/mk/haskell.mk 2016/04/10 15:58:02 1.4
@@ -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
248do-install: 248do-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.
264do-test: 257do-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.
269FILES_SUBST+= DISTNAME=${DISTNAME} 262FILES_SUBST+= DISTNAME=${DISTNAME}
270FILES_SUBST+= HASKELL_PKG_BIN=${_HASKELL_PKG_BIN} 263FILES_SUBST+= HASKELL_PKG_BIN=${_HASKELL_PKG_BIN}
271FILES_SUBST+= HASKELL_PKG_DESCR_FILE=${_HASKELL_PKG_DESCR_FILE} 264FILES_SUBST+= HASKELL_PKG_DESCR_FILE=${_HASKELL_PKG_DESCR_FILE}
272 265
273INSTALL_TEMPLATES+= ../../mk/haskell/INSTALL.in 266INSTALL_TEMPLATES+= ../../mk/haskell/INSTALL.in
274DEINSTALL_TEMPLATES+= ../../mk/haskell/DEINSTALL.in 267DEINSTALL_TEMPLATES+= ../../mk/haskell/DEINSTALL.in

cvs diff -r1.10 -r1.11 pkgsrc/mk/build/bsd.build-vars.mk (expand / switch to unified diff)

--- pkgsrc/mk/build/bsd.build-vars.mk 2016/03/10 16:58:19 1.10
+++ pkgsrc/mk/build/bsd.build-vars.mk 2016/04/10 15:58:02 1.11
@@ -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}
40MAKE_ENV+= PKGGNUDIR=${PKGGNUDIR:Q} 40MAKE_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#
45MAKE_ENV+= MAKECONF=${PKGMAKECONF:U/dev/null} 45MAKE_ENV+= MAKECONF=${PKGMAKECONF:U/dev/null}
46MAKE_ENV+= OBJECT_FMT=${OBJECT_FMT:Q} 46MAKE_ENV+= OBJECT_FMT=${OBJECT_FMT:Q}
47MAKE_ENV+= ${USETOOLS:DUSETOOLS=${USETOOLS:Q}} 47MAKE_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#
52PKGSRC_MAKE_ENV+= PATH=${PATH:Q} 52PKGSRC_MAKE_ENV+= PATH=${PATH:Q}
53PKGSRC_MAKE_ENV+= USE_DESTDIR=${USE_DESTDIR:Q} 

cvs diff -r1.28 -r1.29 pkgsrc/mk/check/check-shlibs.mk (expand / switch to unified diff)

--- pkgsrc/mk/check/check-shlibs.mk 2015/11/24 09:41:20 1.28
+++ pkgsrc/mk/check/check-shlibs.mk 2016/04/10 15:58:02 1.29
@@ -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"
54CHECK_SHLIBS_NATIVE_ENV= 54CHECK_SHLIBS_NATIVE_ENV=
55. if ${OBJECT_FMT} == "ELF" 55. if ${OBJECT_FMT} == "ELF"
56USE_TOOLS+= readelf 56USE_TOOLS+= readelf
57CHECK_SHLIBS_NATIVE= ${PKGSRCDIR}/mk/check/check-shlibs-elf.awk 57CHECK_SHLIBS_NATIVE= ${PKGSRCDIR}/mk/check/check-shlibs-elf.awk
58CHECK_SHLIBS_NATIVE_ENV+= PLATFORM_RPATH=${_OPSYS_SYSTEM_RPATH:Q} 58CHECK_SHLIBS_NATIVE_ENV+= PLATFORM_RPATH=${_OPSYS_SYSTEM_RPATH:Q}
59CHECK_SHLIBS_NATIVE_ENV+= READELF=${TOOLS_PATH.readelf:Q} 59CHECK_SHLIBS_NATIVE_ENV+= READELF=${TOOLS_PATH.readelf:Q}
60. elif ${OBJECT_FMT} == "Mach-O" 60. elif ${OBJECT_FMT} == "Mach-O"
61CHECK_SHLIBS_NATIVE= ${PKGSRCDIR}/mk/check/check-shlibs-macho.awk 61CHECK_SHLIBS_NATIVE= ${PKGSRCDIR}/mk/check/check-shlibs-macho.awk
62. endif 62. endif
63CHECK_SHLIBS_NATIVE_ENV+= CROSS_DESTDIR=${_CROSS_DESTDIR:Q} 63CHECK_SHLIBS_NATIVE_ENV+= CROSS_DESTDIR=${_CROSS_DESTDIR:Q}
64CHECK_SHLIBS_NATIVE_ENV+= PKG_INFO_CMD=${PKG_INFO:Q} 64CHECK_SHLIBS_NATIVE_ENV+= PKG_INFO_CMD=${PKG_INFO:Q}
65CHECK_SHLIBS_NATIVE_ENV+= DEPENDS_FILE=${_RRDEPENDS_FILE:Q} 65CHECK_SHLIBS_NATIVE_ENV+= DEPENDS_FILE=${_RRDEPENDS_FILE:Q}
66. if ${_USE_DESTDIR} != "no" 
67CHECK_SHLIBS_NATIVE_ENV+= DESTDIR=${DESTDIR:Q} 66CHECK_SHLIBS_NATIVE_ENV+= DESTDIR=${DESTDIR:Q}
68. endif 
69CHECK_SHLIBS_NATIVE_ENV+= WRKDIR=${WRKDIR:Q} 67CHECK_SHLIBS_NATIVE_ENV+= WRKDIR=${WRKDIR:Q}
70. if defined(CHECK_WRKREF) && !empty(CHECK_WRKREF:Mextra) 68. if defined(CHECK_WRKREF) && !empty(CHECK_WRKREF:Mextra)
71CHECK_SHLIBS_NATIVE_ENV+= CHECK_WRKREF_EXTRA_DIRS=${CHECK_WRKREF_EXTRA_DIRS:Q} 69CHECK_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

cvs diff -r1.15 -r1.16 pkgsrc/mk/install/bsd.install.mk (expand / switch to unified diff)

--- pkgsrc/mk/install/bsd.install.mk 2014/12/06 23:28:18 1.15
+++ pkgsrc/mk/install/bsd.install.mk 2016/04/10 15:58:02 1.16
@@ -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"
26install: stage-install 
27.elif ${_KEEP_BIN_PKGS} == "no" 
28install: stage-package-install 26install: stage-package-install
29.else 27.else
30install: package-install 28install: 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})
45stage-install: 42stage-install:
46 @${DO_NADA} 43 @${DO_NADA}
47. elif defined(_PKGSRC_BARRIER) 44. elif defined(_PKGSRC_BARRIER)
48stage-install: ${_PKGSRC_BUILD_TARGETS} install-cookie 45stage-install: ${_PKGSRC_BUILD_TARGETS} install-cookie
49. else 46. else
50stage-install: barrier 47stage-install: barrier
51. endif 48. endif

cvs diff -r1.11 -r1.12 pkgsrc/mk/install/deinstall.mk (expand / switch to unified diff)

--- pkgsrc/mk/install/deinstall.mk 2011/10/15 00:23:09 1.11
+++ pkgsrc/mk/install/deinstall.mk 2016/04/10 15:58:02 1.12
@@ -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#
10DEINSTALLDEPENDS?= no 10DEINSTALLDEPENDS?= 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
21deinstall: su-deinstall 21deinstall: 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)
26deinstall: su-target 26deinstall: 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 
37su-deinstall: ${_SU_DEINSTALL_TARGETS} 34su-deinstall: ${_SU_DEINSTALL_TARGETS}
38 35
39.PHONY: acquire-deinstall-lock release-deinstall-lock 36.PHONY: acquire-deinstall-lock release-deinstall-lock
40acquire-deinstall-lock: acquire-localbase-lock 37acquire-deinstall-lock: acquire-localbase-lock
41release-deinstall-lock: release-localbase-lock 38release-deinstall-lock: release-localbase-lock
42 39
43MAKEFLAGS.su-deinstall+= DEINSTALLDEPENDS=${DEINSTALLDEPENDS} 40MAKEFLAGS.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.

cvs diff -r1.67 -r1.68 pkgsrc/mk/install/install.mk (expand / switch to unified diff)

--- pkgsrc/mk/install/install.mk 2015/10/12 09:08:22 1.67
+++ pkgsrc/mk/install/install.mk 2016/04/10 15:58:02 1.68
@@ -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 
161acquire-install-localbase-lock: acquire-localbase-lock 
162release-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])
220install-all: su-target 192install-all: su-target
221. else 193. else
222install-all: su-install-all 194install-all: su-install-all
223. endif 195. endif
224su-install-all: ${_INSTALL_ALL_TARGETS} 196su-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
314INSTALL_DIRS?= ${BUILD_DIRS} 286INSTALL_DIRS?= ${BUILD_DIRS}
315INSTALL_MAKE_FLAGS?= # none 287INSTALL_MAKE_FLAGS?= # none
316INSTALL_TARGET?= install ${USE_IMAKE:D${NO_INSTALL_MANPAGES:D:Uinstall.man}} 288INSTALL_TARGET?= install ${USE_IMAKE:D${NO_INSTALL_MANPAGES:D:Uinstall.man}}
317DESTDIR_VARNAME?= DESTDIR 289DESTDIR_VARNAME?= DESTDIR
318.if ${_USE_DESTDIR} != "no" && !empty(DESTDIR_VARNAME) 290.if !empty(DESTDIR_VARNAME)
319INSTALL_ENV+= ${DESTDIR_VARNAME}=${DESTDIR:Q} 291INSTALL_ENV+= ${DESTDIR_VARNAME}=${DESTDIR:Q}
320INSTALL_MAKE_FLAGS+= ${DESTDIR_VARNAME}=${DESTDIR:Q} 292INSTALL_MAKE_FLAGS+= ${DESTDIR_VARNAME}=${DESTDIR:Q}
321.endif 293.endif
322 294
323.if !target(do-install) 295.if !target(do-install)
324do-install: 296do-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

cvs diff -r1.17 -r1.18 pkgsrc/mk/install/replace.mk (expand / switch to unified diff)

--- pkgsrc/mk/install/replace.mk 2015/09/07 19:23:47 1.17
+++ pkgsrc/mk/install/replace.mk 2016/04/10 15:58:02 1.18
@@ -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)
44replace: ${_REPLACE_TARGETS} su-target 39replace: ${_REPLACE_TARGETS} su-target
45.else 40.else
46replace: barrier 41replace: barrier
47.endif 42.endif
48 43
49replace-message: .PHONY 44replace-message: .PHONY
50 @${PHASE_MSG} "Replacing for ${PKGNAME}" 45 @${PHASE_MSG} "Replacing for ${PKGNAME}"
51 46
52.if ${_USE_DESTDIR} == "no" 
53su-replace: .PHONY _pkgformat-replace 
54.else 
55su-replace: .PHONY _pkgformat-destdir-replace 47su-replace: .PHONY _pkgformat-destdir-replace
56.endif 
57MAKEFLAGS.su-replace= _UPDATE_RUNNING=yes 48MAKEFLAGS.su-replace= _UPDATE_RUNNING=yes
58MAKEFLAGS.su-replace+= PKGNAME_REQD=${PKGNAME_REQD:Q} 49MAKEFLAGS.su-replace+= PKGNAME_REQD=${PKGNAME_REQD:Q}
59 50
60# 51#
61# undo-replace 52# undo-replace
62# 53#
63 54
64undo-replace: .PHONY undo-replace-message su-target 55undo-replace: .PHONY undo-replace-message su-target
65 56
66undo-replace-message: .PHONY 57undo-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" 
71su-undo-replace: .PHONY _pkgformat-undo-replace 
72.else 
73su-undo-replace: .PHONY _pkgformat-destdir-undo-replace 61su-undo-replace: .PHONY _pkgformat-destdir-undo-replace
74.endif 
75MAKEFLAGS.su-undo-replace= _UPDATE_RUNNING=yes 62MAKEFLAGS.su-undo-replace= _UPDATE_RUNNING=yes

cvs diff -r1.24 -r1.25 pkgsrc/mk/package/package.mk (expand / switch to unified diff)

--- pkgsrc/mk/package/package.mk 2013/05/23 13:18:56 1.24
+++ pkgsrc/mk/package/package.mk 2016/04/10 15:58:02 1.25
@@ -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})
29package: 25package:
30 @${DO_NADA} 26 @${DO_NADA}
31. elif defined(_PKGSRC_BARRIER) 27. elif defined(_PKGSRC_BARRIER)
32package: ${_PACKAGE_TARGETS} 28package: ${_PACKAGE_TARGETS}
33. else 29. else
34package: barrier 30package: 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])
96package-all: su-target 89package-all: su-target
97.else 90.else
98package-all: su-package-all 91package-all: su-package-all
99.endif 92.endif
100su-package-all: ${_PACKAGE_ALL_TARGETS} 93su-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 
110package-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
122package-create: 103package-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#

cvs diff -r1.2 -r1.3 pkgsrc/mk/pkgformat/README (expand / switch to unified diff)

--- pkgsrc/mk/pkgformat/README 2014/12/30 15:13:19 1.2
+++ pkgsrc/mk/pkgformat/README 2016/04/10 15:58:03 1.3
@@ -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
5A package format is a packaging system that is supported by pkgsrc. 5A package format is a packaging system that is supported by pkgsrc.
6Currently, there is only one (the native pkgsrc tools), but maybe we can 6Currently, there is only one (the native pkgsrc tools), but maybe we can
7support RPM, dpkg or the Solaris native packages someday. It can also be 7support RPM, dpkg or the Solaris native packages someday. It can also be
8used to test new variants of the packaging tools. 8used to test new variants of the packaging tools.
9 9
10NOTE: The Google Summer of Code 2011 project includes rpm and debian 10NOTE: The Google Summer of Code 2011 project includes rpm and debian
11http://addpackageforma.sourceforge.net/ 11http://addpackageforma.sourceforge.net/
12 12
13The PKG_FORMAT variable is used to select the format. The default 13The PKG_FORMAT variable is used to select the format. The default
14format is ``pkg''. 14format 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
49XXX: Why isn't this variable in the previous list? 49XXX: Why isn't this variable in the previous list?
50 50
51== Make targets == 51== Make targets ==
52 52
53The following make targets must be implemented: 53The 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

cvs diff -r1.1 -r1.2 pkgsrc/mk/pkgformat/pkg/install.mk (expand / switch to unified diff)

--- pkgsrc/mk/pkgformat/pkg/install.mk 2011/10/15 00:23:09 1.1
+++ pkgsrc/mk/pkgformat/pkg/install.mk 2016/04/10 15:58:03 1.2
@@ -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

cvs diff -r1.12 -r1.13 pkgsrc/mk/pkgformat/pkg/metadata.mk (expand / switch to unified diff)

--- pkgsrc/mk/pkgformat/pkg/metadata.mk 2015/07/04 16:18:38 1.12
+++ pkgsrc/mk/pkgformat/pkg/metadata.mk 2016/04/10 15:58:03 1.13
@@ -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###
12PKG_DB_TMPDIR= ${WRKDIR}/.pkgdb 12PKG_DB_TMPDIR= ${WRKDIR}/.pkgdb
13 13
14unprivileged-install-hook: ${PKG_DB_TMPDIR} 14unprivileged-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 
256install-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}

cvs diff -r1.13 -r1.14 pkgsrc/mk/pkgformat/pkg/package.mk (expand / switch to unified diff)

--- pkgsrc/mk/pkgformat/pkg/package.mk 2016/02/02 08:15:07 1.13
+++ pkgsrc/mk/pkgformat/pkg/package.mk 2016/04/10 15:58:03 1.14
@@ -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)
4WARNINGS+= "PKG_SUFX is deprecated, please use PKG_COMPRESSION" 4WARNINGS+= "PKG_SUFX is deprecated, please use PKG_COMPRESSION"
5. if ${PKG_SUFX} == ".tgz" 5. if ${PKG_SUFX} == ".tgz"
6PKG_COMPRESSION= gzip 6PKG_COMPRESSION= gzip
7. elif ${PKG_SUFX} == ".tbz" 7. elif ${PKG_SUFX} == ".tbz"
8PKG_COMPRESSION= bzip2 8PKG_COMPRESSION= bzip2
9. else 9. else
10WARNINGS+= "Unsupported value for PKG_SUFX" 10WARNINGS+= "Unsupported value for PKG_SUFX"
11. endif 11. endif
12.endif 12.endif
13PKG_SUFX?= .tgz 13PKG_SUFX?= .tgz
14FILEBASE?= ${PKGBASE} 14FILEBASE?= ${PKGBASE}
15PKGFILE?= ${PKGREPOSITORY}/${FILEBASE}-${PKGVERSION}${PKG_SUFX} 15PKGFILE?= ${PKGREPOSITORY}/${FILEBASE}-${PKGVERSION}${PKG_SUFX}
16.if ${_USE_DESTDIR} == "no" 
17. if !empty(SIGN_PACKAGES:Mgpg) 
18STAGE_PKGFILE?= ${WRKDIR}/.packages/${FILEBASE}-${PKGVERSION}${PKG_SUFX} 16STAGE_PKGFILE?= ${WRKDIR}/.packages/${FILEBASE}-${PKGVERSION}${PKG_SUFX}
19. elif !empty(SIGN_PACKAGES:Mx509) 
20STAGE_PKGFILE?= ${WRKDIR}/.packages/${FILEBASE}-${PKGVERSION}${PKG_SUFX} 
21. else 
22STAGE_PKGFILE?= ${PKGFILE} 
23. endif 
24.else 
25STAGE_PKGFILE?= ${WRKDIR}/.packages/${FILEBASE}-${PKGVERSION}${PKG_SUFX} 
26.endif 
27PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR} 17PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR}
28PKGREPOSITORYSUBDIR?= All 18PKGREPOSITORYSUBDIR?= 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 
37package-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
47package-create: ${PKGFILE} package-links 26package-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" 
56stage-package-create: package-create 
57.else 
58stage-package-create: stage-install ${STAGE_PKGFILE} 34stage-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)
178package-install: package real-package-install 149package-install: package real-package-install
179.else 150.else
180package-install: barrier 151package-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)
185stage-package-install: stage-package-create real-package-install 156stage-package-install: stage-package-create real-package-install
186.else 157.else
187stage-package-install: barrier 158stage-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]) 
192real-package-install: su-real-package-install 162real-package-install: su-real-package-install
193. else 
194real-package-install: su-target 
195. endif 
196.else 163.else
197real-package-install: 164real-package-install: su-target
198 @${DO_NADA} 
199.endif 165.endif
200 166
201MAKEFLAGS.su-real-package-install= PKGNAME_REQD=${PKGNAME_REQD:Q} 167MAKEFLAGS.su-real-package-install= PKGNAME_REQD=${PKGNAME_REQD:Q}
202su-real-package-install: 168su-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 \

cvs diff -r1.2 -r1.3 pkgsrc/mk/pkgformat/pkg/pkgformat.mk (expand / switch to unified diff)

--- pkgsrc/mk/pkgformat/pkg/pkgformat.mk 2014/12/30 15:13:20 1.2
+++ pkgsrc/mk/pkgformat/pkg/pkgformat.mk 2016/04/10 15:58:03 1.3
@@ -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" 
13PKG_FILELIST_CMD= ${PKG_INFO} -qL ${PKGNAME:Q} 
14.else 
15PKG_FILELIST_CMD= ${SED} -e "/^@/d" -e "s|^|${PREFIX}/|" ${_DEPENDS_PLIST} 10PKG_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"

cvs diff -r1.2 -r1.3 pkgsrc/mk/pkgformat/pkg/replace.mk (expand / switch to unified diff)

--- pkgsrc/mk/pkgformat/pkg/replace.mk 2013/05/23 13:18:56 1.2
+++ pkgsrc/mk/pkgformat/pkg/replace.mk 2016/04/10 15:58:03 1.3
@@ -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

cvs diff -r1.65 -r1.66 pkgsrc/mk/pkginstall/bsd.pkginstall.mk (expand / switch to unified diff)

--- pkgsrc/mk/pkginstall/bsd.pkginstall.mk 2016/04/10 15:33:42 1.65
+++ pkgsrc/mk/pkginstall/bsd.pkginstall.mk 2016/04/10 15:58:03 1.66
@@ -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}
1049FILES_SUBST+= TR=${TR:Q} 1048FILES_SUBST+= TR=${TR:Q}
1050FILES_SUBST+= TRUE=${TRUE:Q} 1049FILES_SUBST+= TRUE=${TRUE:Q}
1051FILES_SUBST+= USERADD=${USERADD:Q} 1050FILES_SUBST+= USERADD=${USERADD:Q}
1052FILES_SUBST+= XARGS=${XARGS:Q} 1051FILES_SUBST+= XARGS=${XARGS:Q}
1053 1052
1054FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/} 1053FILES_SUBST_SED= ${FILES_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
1055 1054
1056PKG_REFCOUNT_DBDIR?= ${PKG_DBDIR}.refcount 1055PKG_REFCOUNT_DBDIR?= ${PKG_DBDIR}.refcount
1057 1056
1058INSTALL_SCRIPTS_ENV= PKG_PREFIX=${PREFIX} 1057INSTALL_SCRIPTS_ENV= PKG_PREFIX=${PREFIX}
1059INSTALL_SCRIPTS_ENV+= PKG_METADATA_DIR=${_PKG_DBDIR}/${PKGNAME} 1058INSTALL_SCRIPTS_ENV+= PKG_METADATA_DIR=${_PKG_DBDIR}/${PKGNAME}
1060INSTALL_SCRIPTS_ENV+= PKG_REFCOUNT_DBDIR=${PKG_REFCOUNT_DBDIR} 1059INSTALL_SCRIPTS_ENV+= PKG_REFCOUNT_DBDIR=${PKG_REFCOUNT_DBDIR}
1061 1060
1062.PHONY: pre-install-script post-install-script 
1063 
1064DEINSTALL_FILE= ${PKG_DB_TMPDIR}/+DEINSTALL 1061DEINSTALL_FILE= ${PKG_DB_TMPDIR}/+DEINSTALL
1065INSTALL_FILE= ${PKG_DB_TMPDIR}/+INSTALL 1062INSTALL_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
1072generate-install-scripts: \ 1069generate-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
1125pre-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 
1134post-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.

cvs diff -r1.27 -r1.28 pkgsrc/mk/plist/print-plist.mk (expand / switch to unified diff)

--- pkgsrc/mk/plist/print-plist.mk 2015/06/07 03:39:08 1.27
+++ pkgsrc/mk/plist/print-plist.mk 2016/04/10 15:58:03 1.28
@@ -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 \