summaryrefslogtreecommitdiff
path: root/mk/plist
diff options
context:
space:
mode:
authorjlam <jlam>2006-03-20 01:48:57 +0000
committerjlam <jlam>2006-03-20 01:48:57 +0000
commita1f40fe5ef676654c5817c7e144bc1ed1a4711f3 (patch)
treeae13569d46a666109d6041531b50702a8539f819 /mk/plist
parent76ffdfa744f2bae43c57cb87e0e1564badab6d40 (diff)
downloadpkgsrc-a1f40fe5ef676654c5817c7e144bc1ed1a4711f3.tar.gz
* Creates a new variable PKGINFODIR (named similarly to PKGMANDIR)
that is a purely user-settable variable to represent the relative path under ${PREFIX} where info files are stored and "dir" files are managed. PKGINFODIR defaults to "info". INFO_DIR still works, but will be obsoleted after the 2006Q1 branch. * Modify GNU_CONFIGURE_INFODIR to only honor ${PKGINFODIR} if the package installs directly into ${PREFIX} and not some subdirectory under ${PREFIX}. This fixes packages that don't really honor $(infodir) all that well, and also avoids PLIST problems relating to directory removal for those packages. * Since the majority of Emacs Lisp packages use GNU_CONFIGURE, just set GNU_CONFIGURE_INFODIR directly to ${EMACS_INFOPREFIX}, which is the Emacs-distro-specific location for info files. Also pass EMACS_INFOPREFIX through PLIST_SUBST for PLIST substitution. * INFO_FILES should be defined if the package installs info files. If the info files are not listed in the PLIST, then INFO_FILES must list the filenames for the info files installed by the package, which are assumed to be located in ${PREFIX}/${PKGINFODIR}. * The plist module can now better detect info files listed in PLISTs and exports a command to the pkginstall module to append info file names to the +INFO_FILES scriptlet at install-time. * The print-PLIST target is updated to properly list info files in the auto-generated PLIST. * The check-files code is updated to skip all "dir" Info database files.
Diffstat (limited to 'mk/plist')
-rw-r--r--mk/plist/plist-info.awk51
-rw-r--r--mk/plist/plist.mk23
-rw-r--r--mk/plist/print-plist.mk23
3 files changed, 55 insertions, 42 deletions
diff --git a/mk/plist/plist-info.awk b/mk/plist/plist-info.awk
index f6c4c593b0c..bf298d62185 100644
--- a/mk/plist/plist-info.awk
+++ b/mk/plist/plist-info.awk
@@ -1,4 +1,4 @@
-# $NetBSD: plist-info.awk,v 1.9 2006/03/14 23:16:01 jlam Exp $
+# $NetBSD: plist-info.awk,v 1.10 2006/03/20 01:48:58 jlam Exp $
#
# Copyright (c) 2006 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -44,7 +44,7 @@
### IGNORE_INFO_PATH is a colon-separated list of ${PREFIX}-relative paths
### that do *not* contain info files.
###
-### INFO_DIR is the ${PREFIX}-relative path to the installed info pages.
+### PKGINFODIR is the ${PREFIX}-relative path to the installed info pages.
###
### LS is the path to the "ls" binary.
###
@@ -57,7 +57,7 @@
### the path to a "test" binary.
###
BEGIN {
- INFO_DIR = ENVIRON["INFO_DIR"] ? ENVIRON["INFO_DIR"] : "info"
+ PKGINFODIR = ENVIRON["PKGINFODIR"] ? ENVIRON["PKGINFODIR"] : "info"
LS = ENVIRON["LS"] ? ENVIRON["LS"] : "ls"
MANZ = ENVIRON["MANZ"] ? ENVIRON["MANZ"] : "no"
PREFIX = ENVIRON["PREFIX"] ? ENVIRON["PREFIX"] : "/usr/pkg"
@@ -69,46 +69,41 @@ BEGIN {
}
###
-### Canonicalize info page entries by stripping any ".gz" suffixes.
+### Canonicalize info page entries by converting ${PKGINFODIR}/ to info/.
###
/^[^@]/ && ($0 !~ "^" IGNORE_INFO_REGEXP "/") && \
-/^([^\/]*\/)*info\/[^\/]*(\.info)?-[0-9]+\.gz$/ {
- sub("\\.gz$", "")
+($0 ~ "^" PKGINFODIR "\/[^\/]+(\.info)?(-[0-9]+)?(\.gz)?$") {
+ sub("^" PKGINFODIR "/", "info/")
+}
+($0 !~ "^@dirrm " IGNORE_INFO_REGEXP "$") && \
+($0 ~ "^@dirrm " PKGINFODIR "$") {
+ sub(PKGINFODIR "$", "info")
}
###
-### Ignore *-1, *-2, etc. files in the PLIST as we get the list of
-### installed split files below.
+### Canonicalize info page entries by stripping any ".gz" suffixes.
###
/^[^@]/ && ($0 !~ "^" IGNORE_INFO_REGEXP "/") && \
-/^([^\/]*\/)*info\/[^\/]*(\.info)?-[0-9]+$/ {
- next
+/^([^\/]*\/)*(info\/[^\/]+(\.info)?|[^\/]+\.info)(-[0-9]+)?\.gz$/ {
+ sub("\.gz$", "")
}
###
-### Convert info/ to ${INFO_DIR}/ for all info page entries.
+### Ignore *-1, *-2, etc. files in the PLIST as we get the list of
+### installed split files below.
###
/^[^@]/ && ($0 !~ "^" IGNORE_INFO_REGEXP "/") && \
-($0 !~ "^([^\/]*\/)*" INFO_DIR "\/[^\/]*(\.info)?$") && \
-/^([^\/]*\/)*info\/[^\/]*(\.info)?$/ {
- if ($0 ~ "^info/") {
- sub("^info/", INFO_DIR "/")
- } else {
- sub("/info/", "/" INFO_DIR "/")
- }
-}
-($0 !~ "^@dirrm " IGNORE_INFO_REGEXP "$") && \
-($0 !~ "^@dirrm " INFO_DIR "$") && \
-/^@dirrm ([^\/]*\/)*info$/ {
- sub("info$", INFO_DIR)
+/^([^\/]*\/)*(info\/[^\/]+(\.info)?|[^\/]+\.info)-[0-9]+$/ {
+ next
}
###
-### For each info page entry, print all of the installed info sub-pages
-### associated with that entry.
+### For each info page entry, convert any info/ to ${PKGINFODIR}/ and print
+### all of the installed info sub-pages associated with that entry.
###
/^[^@]/ && ($0 !~ "^" IGNORE_INFO_REGEXP "/") && \
-($0 ~ "^([^\/]*\/)*" INFO_DIR "\/[^\/]*(\.info)?$") {
+/^([^\/]*\/)*(info\/[^\/]+(\.info)?|[^\/]+\.info)$/ {
+ sub("^info/", PKGINFODIR "/")
cmd = TEST " -f " PREFIX "/" $0 " -o -f " PREFIX "/" $0 ".gz"
if (system(cmd) == 0) {
base = $0
@@ -129,3 +124,7 @@ BEGIN {
}
next
}
+($0 !~ "^@dirrm " IGNORE_INFO_REGEXP "$") && \
+($0 ~ "^@dirrm info$") {
+ sub("info$", PKGINFODIR)
+}
diff --git a/mk/plist/plist.mk b/mk/plist/plist.mk
index 1639fa6d740..6d982ccc0bb 100644
--- a/mk/plist/plist.mk
+++ b/mk/plist/plist.mk
@@ -1,4 +1,4 @@
-# $NetBSD: plist.mk,v 1.6 2006/03/14 17:14:47 jlam Exp $
+# $NetBSD: plist.mk,v 1.7 2006/03/20 01:48:58 jlam Exp $
#
# This Makefile fragment handles the creation of PLISTs for use by
# pkg_create(8).
@@ -92,7 +92,7 @@ MAKEVARS+= _IGNORE_INFO_PATH
#
_PLIST_AWK_ENV+= IMAKE_MANINSTALL=${_IMAKE_MANINSTALL:Q}
_PLIST_AWK_ENV+= IGNORE_INFO_PATH=${_IGNORE_INFO_PATH:Q}
-_PLIST_AWK_ENV+= INFO_DIR=${INFO_DIR:Q}
+_PLIST_AWK_ENV+= PKGINFODIR=${PKGINFODIR:Q}
_PLIST_AWK_ENV+= LIBTOOLIZE_PLIST=${LIBTOOLIZE_PLIST:Q}
_PLIST_AWK_ENV+= LIBTOOL_EXPAND=${_LIBTOOL_EXPAND:Q}
_PLIST_AWK_ENV+= LS=${TOOLS_LS:Q}
@@ -145,6 +145,9 @@ _PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-man.awk
_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-libtool.awk
_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-default.awk
+_PLIST_INFO_AWK+= -f ${.CURDIR}/../../mk/plist/plist-functions.awk
+_PLIST_INFO_AWK+= -f ${.CURDIR}/../../mk/plist/plist-info.awk
+
_PLIST_SHLIB_AWK= -f ${_SHLIB_AWKFILE.${SHLIB_TYPE}}
_SHLIB_AWKFILE.COFF= ${.CURDIR}/../../mk/plist/shlib-none.awk
_SHLIB_AWKFILE.ELF= ${.CURDIR}/../../mk/plist/shlib-elf.awk
@@ -188,9 +191,8 @@ _INFO_GENERATE_PLIST= ${TRUE};
# adding the named files to the PLIST.
#
_PLIST_IGNORE_FILES+= +* # package metadata files
-_PLIST_IGNORE_FILES+= info/dir
-. if defined(INFO_DIR) && empty(INFO_DIR:Minfo)
-_PLIST_IGNORE_FILES+= ${INFO_DIR}/dir
+. if defined(INFO_FILES)
+_PLIST_IGNORE_FILES+= ${PKGINFODIR}/dir
. endif
_PLIST_IGNORE_FILES+= *[~\#] *.OLD *.orig *,v # scratch config files
. if !empty(CONF_DEPENDS)
@@ -238,3 +240,14 @@ ${PLIST}:
${SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_AWK} | \
${SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_SHLIB_AWK} \
> ${.TARGET}
+
+.if defined(INFO_FILES)
+. if empty(INFO_FILES)
+INFO_FILES_cmd= \
+ ${CAT} ${PLIST} | \
+ ${SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_INFO_AWK} | \
+ ${AWK} '($$0 !~ "-[0-9]*(\.gz)?$$") { print }'
+. else
+INFO_FILES_cmd= ${TRUE}
+. endif
+.endif
diff --git a/mk/plist/print-plist.mk b/mk/plist/print-plist.mk
index fb57695ff11..7df9dad78aa 100644
--- a/mk/plist/print-plist.mk
+++ b/mk/plist/print-plist.mk
@@ -1,4 +1,4 @@
-# $NetBSD: print-plist.mk,v 1.4 2006/03/09 16:39:39 jlam Exp $
+# $NetBSD: print-plist.mk,v 1.5 2006/03/20 01:48:58 jlam Exp $
###
### Automatic PLIST generation
@@ -28,18 +28,16 @@ _PRINT_PLIST_AWK_SUBST+= \
gsub(/${PKGNAME_NOREV}/, "$${PKGNAME}"); \
gsub(/${PKGVERSION:S/./\./g:C/nb[0-9]*$$//}/, "$${PKGVERSION}");\
gsub(/${PKGLOCALEDIR}\/locale/, "$${PKGLOCALEDIR}/locale"); \
+ gsub("^${PKGINFODIR}\/", "info/"); \
gsub("^${PKGMANDIR}\/", "man/"); \
}
-_PRINT_PLIST_AWK_IGNORE= ($$0 ~ /emul\/linux\/proc/)
-_PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^info\/dir$$/)
-.if defined(INFO_DIR) && empty(INFO_DIR:Minfo)
-_PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^${INFO_DIR:S|/|\\/|g}\/dir$$/)
-.endif
-.if defined(INFO_FILES) && !empty(INFO_FILES)
-. for _f_ in ${INFO_FILES}
-_PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^${INFO_DIR:S|/|\\/|g}\/${_f_:S|+|\+|g}(-[0-9]+)?(\.gz)?$$/)
-. endfor
+_PRINT_PLIST_AWK_IGNORE= ($$0 ~ /^${PKG_DBDIR:S|^${PREFIX}/||:S|/|\\/|g}\//)
+_PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /emul\/linux\/proc/)
+.if defined(INFO_FILES)
+_PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^${PKGINFODIR:S|/|\\/|g}\/dir$$/)
+_PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^${PKGINFODIR:S|/|\\/|g}\/[^\/]+(-[0-9]+)(\.gz)?$$/)
+_PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^([^\/]*\/)*(info\/[^\/]+|[^\/]+\.info)(-[0-9]+)(\.gz)?$$/)
.endif
# Common (system) directories not to generate @dirrm statements for
@@ -154,9 +152,12 @@ print-PLIST:
| ${SORT} -r \
| ${AWK} ' \
/emul\/linux\/proc/ { next; } \
- /${PREFIX:S|/|\\/|g}\/\.$$/ { next; } \
+ /${PKG_DBDIR:S|/|\\/|g}\// { next; } \
{ sub("${PREFIX}/\\\\./", ""); } \
+ { sub("^${PKGINFODIR}/", "info/"); } \
{ sub("^${PKGMANDIR}/", "man/"); } \
+ /^${PKG_DBDIR:S|^${PREFIX}/||:S|/|\\/|g}(\/|$$)/ { next; } \
+ /^${PKGINFODIR:S|/|\\/|g}$$/ { next; } \
${_PRINT_PLIST_COMMON_DIRS}'` ; \
do \
if [ `${LS} -la ${PREFIX}/$$i | ${WC} -l` = 3 ]; then \