Wed Sep 2 14:40:41 2009 UTC ()
Add STRIP_DEBUG option, which removes debug information from all files,
leaving basic symbol tables intact. Document that INSTALL_UNSTRIPPED
doesn't work for all packages.


(joerg)
diff -r1.7 -r1.8 pkgsrc/mk/install/bsd.install-vars.mk
diff -r1.52 -r1.53 pkgsrc/mk/install/install.mk

cvs diff -r1.7 -r1.8 pkgsrc/mk/install/bsd.install-vars.mk (expand / switch to unified diff)

--- pkgsrc/mk/install/bsd.install-vars.mk 2007/07/02 14:54:10 1.7
+++ pkgsrc/mk/install/bsd.install-vars.mk 2009/09/02 14:40:40 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: bsd.install-vars.mk,v 1.7 2007/07/02 14:54:10 joerg Exp $ 1# $NetBSD: bsd.install-vars.mk,v 1.8 2009/09/02 14:40:40 joerg Exp $
2# 2#
3# This Makefile fragment is included separately by bsd.pkg.mk and 3# This Makefile fragment is included separately by bsd.pkg.mk and
4# defines some variables which must be defined earlier than where 4# defines some variables which must be defined earlier than where
5# bsd.install.mk is included. 5# bsd.install.mk is included.
6# 6#
7# Package-settable variables: 7# Package-settable variables:
8# 8#
9# INSTALLATION_DIRS_FROM_PLIST 9# INSTALLATION_DIRS_FROM_PLIST
10# If set to "yes", the static PLIST files of the package will 10# If set to "yes", the static PLIST files of the package will
11# be used to determine which directories need to be created before 11# be used to determine which directories need to be created before
12# the "real" installation should start. 12# the "real" installation should start.
13# 13#
14 14
@@ -36,19 +36,21 @@ _MANCOMPRESSED!= \ @@ -36,19 +36,21 @@ _MANCOMPRESSED!= \
36 { ${ECHO} ".include \""${PKGMAKECONF:Q}"\""; \ 36 { ${ECHO} ".include \""${PKGMAKECONF:Q}"\""; \
37 ${ECHO} "all:"; \ 37 ${ECHO} "all:"; \
38 ${ECHO} ".if defined(MANZ)"; \ 38 ${ECHO} ".if defined(MANZ)"; \
39 ${ECHO} " @${ECHO} yes"; \ 39 ${ECHO} " @${ECHO} yes"; \
40 ${ECHO} ".else"; \ 40 ${ECHO} ".else"; \
41 ${ECHO} " @${ECHO} no"; \ 41 ${ECHO} " @${ECHO} no"; \
42 ${ECHO} ".endif"; \ 42 ${ECHO} ".endif"; \
43 } | ${MAKE} -f - all 43 } | ${MAKE} -f - all
44. endif 44. endif
45.endif 45.endif
46_MANZ= ${MANZ:Dyes:Uno} 46_MANZ= ${MANZ:Dyes:Uno}
47MAKEVARS+= _MANCOMPRESSED _MANZ 47MAKEVARS+= _MANCOMPRESSED _MANZ
48 48
 49STRIP_DEBUG?= no
 50
49.if !empty(_MANCOMPRESSED:M[yY][eE][sS]) && empty(_MANZ:M[yY][eE][sS]) 51.if !empty(_MANCOMPRESSED:M[yY][eE][sS]) && empty(_MANZ:M[yY][eE][sS])
50USE_TOOLS+= gunzip 52USE_TOOLS+= gunzip
51.endif 53.endif
52.if empty(_MANCOMPRESSED:M[yY][eE][sS]) && !empty(_MANZ:M[yY][eE][sS]) 54.if empty(_MANCOMPRESSED:M[yY][eE][sS]) && !empty(_MANZ:M[yY][eE][sS])
53USE_TOOLS+= gzip 55USE_TOOLS+= gzip
54.endif 56.endif

cvs diff -r1.52 -r1.53 pkgsrc/mk/install/install.mk (expand / switch to unified diff)

--- pkgsrc/mk/install/install.mk 2008/11/18 22:03:56 1.52
+++ pkgsrc/mk/install/install.mk 2009/09/02 14:40:41 1.53
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: install.mk,v 1.52 2008/11/18 22:03:56 rillig Exp $ 1# $NetBSD: install.mk,v 1.53 2009/09/02 14:40:41 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# install: 7# install:
8# Installs the package files into LOCALBASE. 8# Installs the package files into 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#
@@ -16,26 +16,31 @@ @@ -16,26 +16,31 @@
16# This hook is placed after the package has been installed, 16# This hook is placed after the package has been installed,
17# before leaving the privileged mode. 17# before leaving the privileged mode.
18# 18#
19# unprivileged-install-hook: 19# unprivileged-install-hook:
20# This hook is placed _before_ switching to privileged mode 20# This hook is placed _before_ switching to privileged mode
21# in order to install the package. 21# in order to install the package.
22# 22#
23 23
24# === User-settable variables === 24# === User-settable variables ===
25# 25#
26# INSTALL_UNSTRIPPED 26# INSTALL_UNSTRIPPED
27# If "yes", all binaries and shared libraries are installed 27# If "yes", all binaries and shared libraries are installed
28# unstripped. Otherwise they are stripped while being installed. 28# unstripped. Otherwise they are stripped while being installed.
 29# This option is not supported by all packages.
 30#
 31# STRIP_DEBUG
 32# If set to "yes", call ${STRI} -g to remove debug information
 33# from all files. The symbol tables are still preserved.
29# 34#
30# Keywords: strip unstripped 35# Keywords: strip unstripped
31# 36#
32# === Package-settable variables === 37# === Package-settable variables ===
33# 38#
34# INSTALLATION_DIRS 39# INSTALLATION_DIRS
35# A list of directories that should be created at the very 40# A list of directories that should be created at the very
36# beginning of the install phase. These directories are relative 41# beginning of the install phase. These directories are relative
37# to ${PREFIX}. As a convenience, a leading man/ is transformed 42# to ${PREFIX}. As a convenience, a leading man/ is transformed
38# to ${PKGMANDIR}, to save package authors from typing too much. 43# to ${PKGMANDIR}, to save package authors from typing too much.
39# 44#
40# AUTO_MKDIRS 45# AUTO_MKDIRS
41# INSTALLATION_DIRS_FROM_PLIST 46# INSTALLATION_DIRS_FROM_PLIST
@@ -173,26 +178,29 @@ _INSTALL_ALL_TARGETS+= install-makedirs @@ -173,26 +178,29 @@ _INSTALL_ALL_TARGETS+= install-makedirs
173.if defined(INSTALLATION_DIRS_FROM_PLIST) && \ 178.if defined(INSTALLATION_DIRS_FROM_PLIST) && \
174 !empty(INSTALLATION_DIRS_FROM_PLIST:M[Yy][Ee][Ss]) 179 !empty(INSTALLATION_DIRS_FROM_PLIST:M[Yy][Ee][Ss])
175_INSTALL_ALL_TARGETS+= install-dirs-from-PLIST 180_INSTALL_ALL_TARGETS+= install-dirs-from-PLIST
176.elif defined(AUTO_MKDIRS) && !empty(AUTO_MKDIRS:M[Yy][Ee][Ss]) 181.elif defined(AUTO_MKDIRS) && !empty(AUTO_MKDIRS:M[Yy][Ee][Ss])
177_INSTALL_ALL_TARGETS+= install-dirs-from-PLIST 182_INSTALL_ALL_TARGETS+= install-dirs-from-PLIST
178.endif 183.endif
179.if ${_USE_DESTDIR} == "no" 184.if ${_USE_DESTDIR} == "no"
180_INSTALL_ALL_TARGETS+= pre-install-script 185_INSTALL_ALL_TARGETS+= pre-install-script
181.endif 186.endif
182_INSTALL_ALL_TARGETS+= pre-install 187_INSTALL_ALL_TARGETS+= pre-install
183_INSTALL_ALL_TARGETS+= do-install 188_INSTALL_ALL_TARGETS+= do-install
184_INSTALL_ALL_TARGETS+= post-install 189_INSTALL_ALL_TARGETS+= post-install
185_INSTALL_ALL_TARGETS+= plist 190_INSTALL_ALL_TARGETS+= plist
 191.if !empty(STRIP_DEBUG:M[Yy][Ee][Ss])
 192_INSTALL_ALL_TARGETS+= install-strip-debug
 193.endif
186_INSTALL_ALL_TARGETS+= install-doc-handling 194_INSTALL_ALL_TARGETS+= install-doc-handling
187_INSTALL_ALL_TARGETS+= install-script-data 195_INSTALL_ALL_TARGETS+= install-script-data
188.if empty(CHECK_FILES:M[nN][oO]) && !empty(CHECK_FILES_SUPPORTED:M[Yy][Ee][Ss]) 196.if empty(CHECK_FILES:M[nN][oO]) && !empty(CHECK_FILES_SUPPORTED:M[Yy][Ee][Ss])
189_INSTALL_ALL_TARGETS+= check-files-post 197_INSTALL_ALL_TARGETS+= check-files-post
190.endif 198.endif
191.if ${_USE_DESTDIR} == "no" 199.if ${_USE_DESTDIR} == "no"
192_INSTALL_ALL_TARGETS+= post-install-script 200_INSTALL_ALL_TARGETS+= post-install-script
193.endif 201.endif
194.if ${_USE_DESTDIR} == "no" 202.if ${_USE_DESTDIR} == "no"
195_INSTALL_ALL_TARGETS+= _flavor-register 203_INSTALL_ALL_TARGETS+= _flavor-register
196.else 204.else
197_INSTALL_ALL_TARGETS+= _flavor-generate-metadata 205_INSTALL_ALL_TARGETS+= _flavor-generate-metadata
198.endif 206.endif
@@ -315,26 +323,39 @@ do-install: @@ -315,26 +323,39 @@ do-install:
315. endfor 323. endfor
316.endif 324.endif
317 325
318.if !target(pre-install) 326.if !target(pre-install)
319pre-install: 327pre-install:
320 @${DO_NADA} 328 @${DO_NADA}
321.endif 329.endif
322.if !target(post-install) 330.if !target(post-install)
323post-install: 331post-install:
324 @${DO_NADA} 332 @${DO_NADA}
325.endif 333.endif
326 334
327###################################################################### 335######################################################################
 336### install-strip-debug (PRIVATE)
 337######################################################################
 338### install-strip-debug tries to strip debug information from
 339### the files in PLIST.
 340###
 341.PHONY: install-strip-debug
 342install-strip-debug: plist
 343 @${STEP_MSG} "Automatic stripping of debug information"
 344 ${RUN}${CAT} ${PLIST} \
 345 | ${SED} -e 's|^|${DESTDIR}${PREFIX}/|' \
 346 | ${XARGS} ${STRIP} -g 2>/dev/null || ${TRUE}
 347
 348######################################################################
328### install-doc-handling (PRIVATE) 349### install-doc-handling (PRIVATE)
329###################################################################### 350######################################################################
330### install-doc-handling does automatic document (de)compression based 351### install-doc-handling does automatic document (de)compression based
331### on the contents of the PLIST. 352### on the contents of the PLIST.
332### 353###
333_PLIST_REGEXP.info= \ 354_PLIST_REGEXP.info= \
334 ^([^\/]*\/)*${PKGINFODIR}/[^/]*(\.info)?(-[0-9]+)?(\.gz)?$$ 355 ^([^\/]*\/)*${PKGINFODIR}/[^/]*(\.info)?(-[0-9]+)?(\.gz)?$$
335_PLIST_REGEXP.man= \ 356_PLIST_REGEXP.man= \
336 ^([^/]*/)+(man[1-9ln]/[^/]*\.[1-9ln]|cat[1-9ln]/[^/]*\.[0-9])(\.gz)?$$ 357 ^([^/]*/)+(man[1-9ln]/[^/]*\.[1-9ln]|cat[1-9ln]/[^/]*\.[0-9])(\.gz)?$$
337 358
338_DOC_COMPRESS= \ 359_DOC_COMPRESS= \
339 ${SETENV} PATH=${PATH:Q} \ 360 ${SETENV} PATH=${PATH:Q} \
340 MANZ=${_MANZ} \ 361 MANZ=${_MANZ} \