| @@ -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) |
319 | pre-install: | | 327 | pre-install: |
320 | @${DO_NADA} | | 328 | @${DO_NADA} |
321 | .endif | | 329 | .endif |
322 | .if !target(post-install) | | 330 | .if !target(post-install) |
323 | post-install: | | 331 | post-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 |
| | | 342 | install-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} \ |