pkgsrc/mk/plist/plist.mk

241 lines
8.1 KiB
Makefile
Raw Normal View History

# $NetBSD: plist.mk,v 1.15 2006/07/21 13:40:27 jlam Exp $
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
#
# This Makefile fragment handles the creation of PLISTs for use by
# pkg_create(8).
#
# The following variables affect the PLIST generation:
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
#
# PLIST_TYPE specifies whether the generated PLIST is derived
# automatically from the installed files, or if the PLIST entries
# are listed in files. Valid values are "dynamic" and "static",
# and the default value is "static".
#
# PLIST_SRC is the source file(s) for the generated PLIST file. By
# default, its value is constructed from the PLIST.* files within
# the package directory.
#
# GENERATE_PLIST is a sequence of commands, terminating in a semicolon,
# that outputs contents for a PLIST to stdout and is appended to
# the contents of ${PLIST_SRC}.
#
# IGNORE_INFO_DIRS is a list of ${PREFIX}-relative paths that do
# *not* contain info files.
#
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
.if ${PKG_INSTALLATION_TYPE} == "pkgviews"
PLIST_TYPE?= dynamic
.endif
PLIST_TYPE?= static
######################################################################
# PLIST_SRC is the source file for the generated PLIST file. If PLIST_SRC
# is not explicitly defined, then build one up from various PLIST.* files
# that are present in the package directory. The order goes (if the files
# are present):
#
# PLIST.common
# PLIST.${OPSYS} (e.g., PLIST.NetBSD)
# PLIST.${MACHINE_ARCH} (e.g,, PLIST.macppc)
# PLIST.${OPSYS}-${MACHINE_ARCH} (e.g., PLIST.NetBSD-macppc)
# PLIST
# PLIST.common_end
#
.if !defined(PLIST_SRC)
. if exists(${PKGDIR}/PLIST.common)
PLIST_SRC+= ${PKGDIR}/PLIST.common
. endif
. if exists(${PKGDIR}/PLIST.${OPSYS})
PLIST_SRC+= ${PKGDIR}/PLIST.${OPSYS}
. endif
. if exists(${PKGDIR}/PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g})
PLIST_SRC+= ${PKGDIR}/PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g}
. endif
. if exists(${PKGDIR}/PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g})
PLIST_SRC+= ${PKGDIR}/PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g}
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
. endif
. if exists(${PKGDIR}/PLIST)
PLIST_SRC+= ${PKGDIR}/PLIST
. endif
. if exists(${PKGDIR}/PLIST.common_end)
PLIST_SRC+= ${PKGDIR}/PLIST.common_end
. endif
.endif # !PLIST_SRC
# This is the path to the generated PLIST file.
PLIST= ${WRKDIR}/.PLIST
######################################################################
.if (defined(USE_IMAKE) || !empty(USE_TOOLS:Mimake))
_IMAKE_MANINSTALL= ${IMAKE_MANINSTALL}
.else
_IMAKE_MANINSTALL= # empty
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
.endif
_LIBTOOL_EXPAND= \
${SETENV} ECHO=${TOOLS_ECHO:Q} GREP=${TOOLS_GREP:Q} \
SORT=${TOOLS_SORT:Q} TEST=${TOOLS_TEST:Q} \
${SH} ${.CURDIR}/../../mk/plist/libtool-expand
.if !defined(_IGNORE_INFO_PATH)
. for _dir_ in ${IGNORE_INFO_DIRS}
_IGNORE_INFO_PATH:= ${_IGNORE_INFO_PATH}:${_dir_}
. endfor
_IGNORE_INFO_PATH:= ${_IGNORE_INFO_PATH:S/^://}
.endif
MAKEVARS+= _IGNORE_INFO_PATH
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
# _PLIST_AWK_ENV holds the shell environment passed to the awk script
# that does post-processing of the PLIST. See the individual *.awk
# scripts for information on each of the variable set in the environment.
#
_PLIST_AWK_ENV+= PKGLOCALEDIR=${PKGLOCALEDIR:Q}
_PLIST_AWK_ENV+= USE_PKGLOCALEDIR=${USE_PKGLOCALEDIR:Dyes:Uno}
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
_PLIST_AWK_ENV+= IMAKE_MANINSTALL=${_IMAKE_MANINSTALL:Q}
_PLIST_AWK_ENV+= IGNORE_INFO_PATH=${_IGNORE_INFO_PATH:Q}
2006-03-20 02:48:57 +01:00
_PLIST_AWK_ENV+= PKGINFODIR=${PKGINFODIR:Q}
_PLIST_AWK_ENV+= IGNORE_LIBTOOLIZE=${IGNORE_LIBTOOLIZE:Q}
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
_PLIST_AWK_ENV+= LIBTOOLIZE_PLIST=${LIBTOOLIZE_PLIST:Q}
2006-03-14 17:54:28 +01:00
_PLIST_AWK_ENV+= LIBTOOL_EXPAND=${_LIBTOOL_EXPAND:Q}
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
_PLIST_AWK_ENV+= LS=${TOOLS_LS:Q}
_PLIST_AWK_ENV+= MANINSTALL=${MANINSTALL:Q}
_PLIST_AWK_ENV+= MANZ=${_MANZ:Q}
_PLIST_AWK_ENV+= PKGMANDIR=${PKGMANDIR:Q}
_PLIST_AWK_ENV+= PREFIX=${PREFIX:Q}
_PLIST_AWK_ENV+= TEST=${TOOLS_TEST:Q}
# PLIST_SUBST contains package-settable "${variable}" to "value"
# substitutions for PLISTs
#
PLIST_SUBST+= OPSYS=${OPSYS:Q} \
OS_VERSION=${OS_VERSION:Q} \
MACHINE_ARCH=${MACHINE_ARCH:Q} \
MACHINE_GNU_ARCH=${MACHINE_GNU_ARCH:Q} \
MACHINE_GNU_PLATFORM=${MACHINE_GNU_PLATFORM:Q} \
LN=${LN:Q} \
LOWER_VENDOR=${LOWER_VENDOR:Q} \
LOWER_OPSYS=${LOWER_OPSYS:Q} \
LOWER_OS_VERSION=${LOWER_OS_VERSION:Q} \
PKGBASE=${PKGBASE:Q} \
PKGNAME=${PKGNAME_NOREV:Q} \
PKGLOCALEDIR=${PKGLOCALEDIR:Q} \
PKGVERSION=${PKGVERSION:C/nb[0-9]*$//} \
LOCALBASE=${LOCALBASE:Q} \
VIEWBASE=${VIEWBASE:Q} \
X11BASE=${X11BASE:Q} \
X11PREFIX=${X11PREFIX:Q} \
SVR4_PKGNAME=${SVR4_PKGNAME:Q} \
CHGRP=${CHGRP:Q} \
CHMOD=${CHMOD:Q} \
CHOWN=${CHOWN:Q} \
MKDIR=${MKDIR:Q} \
RMDIR=${RMDIR:Q} \
RM=${RM:Q} \
TRUE=${TRUE:Q} \
PKGMANDIR=${PKGMANDIR:Q}
# Pass the PLIST_SUBST substitutions to the subst.awk script by prepending
# PLIST_" to all of the variable names and adding them into the environment.
#
_PLIST_AWK_ENV+= ${PLIST_SUBST:S/^/PLIST_/}
_PLIST_AWK_ENV+= PLIST_SUBST_VARS=${PLIST_SUBST:S/^/PLIST_/:C/=.*//:M*:Q}
_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-functions.awk
_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-subst.awk
_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-locale.awk
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
_PLIST_AWK+= -f ${.CURDIR}/../../mk/plist/plist-info.awk
_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
2006-03-20 02:48:57 +01:00
_PLIST_INFO_AWK+= -f ${.CURDIR}/../../mk/plist/plist-functions.awk
_PLIST_INFO_AWK+= -f ${.CURDIR}/../../mk/plist/plist-info.awk
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
_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
_SHLIB_AWKFILE.aixlib= ${.CURDIR}/../../mk/plist/shlib-none.awk
_SHLIB_AWKFILE.a.out= ${.CURDIR}/../../mk/plist/shlib-aout.awk
_SHLIB_AWKFILE.dylib= ${.CURDIR}/../../mk/plist/shlib-dylib.awk
_SHLIB_AWKFILE.none= ${.CURDIR}/../../mk/plist/shlib-none.awk
# SHLIB_TYPE is the type of shared library supported by the platform.
SHLIB_TYPE= ${_SHLIB_TYPE_cmd:sh}
_SHLIB_TYPE_cmd= \
${SETENV} ECHO=${TOOLS_ECHO:Q} FILE_CMD=${TOOLS_FILE_CMD:Q} \
TEST=${TOOLS_TEST:Q} PKG_INFO_CMD=${PKG_INFO_CMD:Q} \
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
${SH} ${.CURDIR}/../../mk/plist/shlib-type ${_OPSYS_SHLIB_TYPE:Q}
######################################################################
# GENERATE_PLIST is a sequence of commands, terminating in a semicolon,
# that outputs contents for a PLIST to stdout and is appended to
# the contents of ${PLIST_SRC}.
#
GENERATE_PLIST?= ${TRUE};
.if ${PKG_INSTALLATION_TYPE} == "pkgviews"
#
# _PLIST_IGNORE_FILES basically mirrors the list of ignored files found
# in pkg_views(1). It's used by the dynamic PLIST generator to skip
# adding the named files to the PLIST.
#
_PLIST_IGNORE_FILES+= +* # package metadata files
2006-03-20 02:48:57 +01:00
. if defined(INFO_FILES)
_PLIST_IGNORE_FILES+= ${PKGINFODIR}/dir
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
. endif
_PLIST_IGNORE_FILES+= *[~\#] *.OLD *.orig *,v # scratch config files
. if !empty(CONF_DEPENDS)
_PLIST_IGNORE_FILES+= ${PKG_SYSCONFDIR:S,^${PREFIX}/,,}
. endif
_PLIST_IGNORE_FILES+= ${PLIST_IGNORE_FILES}
.endif
_BUILD_DEFS+= _PLIST_IGNORE_FILES
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
.if ${PLIST_TYPE} == "dynamic"
_PLIST_IGNORE_CMD= \
( while read i; do \
ignore=no; \
for p in ${_PLIST_IGNORE_FILES}; do \
case "$$i" in \
$$p) ignore=yes; break ;; \
esac; \
done; \
[ "$$ignore" = "yes" ] || ${ECHO} "$$i"; \
done )
_GENERATE_PLIST= \
${FIND} ${PREFIX} \! -type d -print | ${SORT} | \
${SED} -e "s|^${PREFIX}/||" | \
${_PLIST_IGNORE_CMD}; \
${FIND} ${PREFIX} -type d -print | ${SORT} -r | \
${GREP} -v "^${PREFIX}$$" | \
${_PLIST_IGNORE_CMD} | \
${SED} -e "s|^${PREFIX}/|@unexec ${RMDIR} -p %D/|" \
-e "s,$$, 2>/dev/null || ${TRUE},";
.else
_GENERATE_PLIST= ${CAT} ${PLIST_SRC}; \
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
${GENERATE_PLIST}
.endif
.PHONY: plist
plist: ${PLIST}
.if ${PLIST_TYPE} == "static"
${PLIST}: ${PLIST_SRC}
.endif
${PLIST}:
First pass at implementing support for package system flavors other than pkgsrc's current one. This is an important lead-up to any project that redesigns the pkg_* tools in that it doesn't tie us to past design (mis)choices. This commit mostly deals with rearranging code, although there was a considerable amount of rewriting done in cases where I thought the code was somewhat messy and was difficult to understand. The design I chose for supporting multiple package system flavors is that the various depends, install, package, etc. modules would define default targets and variables that may be overridden in files from pkgsrc/mk/flavor/${PKG_FLAVOR}. The default targets would do the sensible thing of doing nothing, and pkgsrc infrastructure would rely on the appropriate things to be defined in pkgsrc/mk/flavor to do the real work. The pkgsrc/mk/flavor directory contains subdirectories corresponding to each package system flavor that we support. Currently, I only have "pkg" which represents the current pkgsrc-native package flavor. I've separated out most of the code where we make assumptions about the package system flavor, mostly either because we directly use the pkg_* tools, or we make assumptions about the package meta-data directory, or we directly manipulate the package meta-data files, and placed it into pkgsrc/mk/flavor/pkg. There are several new modules that have been refactored out of bsd.pkg.mk as part of these changes: check, depends, install, package, and update. Each of these modules has been slimmed down by rewriting them to avoid some recursive make calls. I've also religiously documented which targets are "public" and which are "private" so that users won't rely on reaching into pkgsrc innards to call a private target. The "depends" module is a complete overhaul of the way that we handle dependencies. There is now a separate "depends" phase that occurs before the "extract" phase where dependencies are installed. This differs from the old way where dependencies were installed just before extraction occurred. The reduce-depends.mk file is now replaced by a script that is invoked only once during the depends phase and is used to generate a cookie file that holds the full set of reduced dependencies. It is now possible to type "make depends" in a package directory and all missing dependencies will be installed. Future work on this project include: * Resolve the workflow design in anticipation of future work on staged installations where "package" conceptually happens before "install". * Rewrite the buildlink3 framework to not assume the use of the pkgsrc pkg_* tools. * Rewrite the pkginstall framework to provide a standard pkg_* tool to perform the actions, and allowing a purely declarative file per package to describe what actions need to be taken at install or deinstall time. * Implement support for the SVR4 package flavor. This will be proof that the appropriate abstractions are in place to allow using a completely different set of package management tools.
2006-06-04 01:11:42 +02:00
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
Initial commit of a new module that encapsulates all of the code for manipulating PLISTs. This module is not used by default pending more widespread testing -- currently the variable _USE_PLIST_MODULE must be defined in /etc/mk.conf to enable its use. The main features of the new PLIST module are: (1) Splits out the PLIST-handling code from bsd.pkg.mk into a separate "plist" module. (2) Splits out giant, multi-line awk scripts stored in make variables into separate awk scripts that may be joined together to post-process PLISTs. Each of these awk scripts consolidates the processing for one set of files, e.g., man pages, info pages, etc., and is more easily commented than a make variable. (3) Splits out the print-PLIST code from the regular PLIST code since they have no common pieces (print-plist.mk vs. plist.mk). (4) Completely re-implements the shared-library handling to be more efficient. Along the way, this also fixes a problem for Mac OS X users where the PLISTs incorrectly contained absolute paths. (5) Completely re-implements the info-file handling so that we can migrate from INFO_FILES definitions to just adding info/foo.info entries in the static PLISTs. (6) Adds commented-out support for automatically compressed or decompressed info page entries based on the value of MANZ. These changes will be activated after texinfo.mk has been replaced by something that is built using the more modern primitives now available in pkgsrc. (7) Move the file compression logic into a separate script "doc-compress" that compresses or decompresses files while minding symlinks. This script is now called by bsd.pkg.mk to do the "autmoatic man page handling". In the future, it will also handle the "automatic info page handling" and possible others. In general, the idea is to move stuff out of the Makefiles and into separate files where we don't need to worry about quoting rules and where each file can have a separate history of commits. This simplifies the makefile logic (especially in terms of readability) and also simplifies maintenance of the code.
2006-01-13 00:43:56 +01:00
${_PKG_SILENT}${_PKG_DEBUG} \
{ ${_GENERATE_PLIST} } | \
${SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_AWK} | \
${SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_SHLIB_AWK} \
> ${.TARGET}
2006-03-20 02:48:57 +01:00
.if defined(INFO_FILES)
INFO_FILES_cmd= \
${CAT} ${PLIST} | \
${SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_INFO_AWK} | \
${AWK} '($$0 !~ "-[0-9]*(\.gz)?$$") { print }'
.endif