diff options
author | jlam <jlam@pkgsrc.org> | 2006-06-03 23:11:42 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2006-06-03 23:11:42 +0000 |
commit | e5eb2c56afcaf66f9ed3c7848573a343132b82b0 (patch) | |
tree | bfe84ef2dbbdd59b31ae6e0df262c47f9ad1b342 /mk/bsd.prefs.mk | |
parent | 318cea5cbda9aa49ead151bb7ecfa2b8c8d51632 (diff) | |
download | pkgsrc-e5eb2c56afcaf66f9ed3c7848573a343132b82b0.tar.gz |
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.
Diffstat (limited to 'mk/bsd.prefs.mk')
-rw-r--r-- | mk/bsd.prefs.mk | 64 |
1 files changed, 6 insertions, 58 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk index 8ba57d28614..112c663759e 100644 --- a/mk/bsd.prefs.mk +++ b/mk/bsd.prefs.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prefs.mk,v 1.220 2006/03/08 01:56:46 minskim Exp $ +# $NetBSD: bsd.prefs.mk,v 1.221 2006/06/03 23:11:42 jlam Exp $ # # Make file, included to get the site preferences, if any. Should # only be included by package Makefiles before any .if defined() @@ -486,63 +486,6 @@ DIGEST_VERSION!= ${DIGEST} -V 2>/dev/null MAKEFLAGS+= DIGEST_VERSION=${DIGEST_VERSION:Q} .endif -# This is the package database directory for the default view. -PKG_DBDIR?= ${DESTDIR}/var/db/pkg - -# _PKG_DBDIR is the actual packages database directory where we register -# packages. -# -.if ${PKG_INSTALLATION_TYPE} == "overwrite" -_PKG_DBDIR= ${PKG_DBDIR} -.elif ${PKG_INSTALLATION_TYPE} == "pkgviews" -_PKG_DBDIR= ${DEPOTBASE} -.endif - -PKG_ADD_CMD?= ${PKG_TOOLS_BIN}/pkg_add -PKG_ADMIN_CMD?= ${PKG_TOOLS_BIN}/pkg_admin -PKG_CREATE_CMD?= ${PKG_TOOLS_BIN}/pkg_create -PKG_DELETE_CMD?= ${PKG_TOOLS_BIN}/pkg_delete -PKG_INFO_CMD?= ${PKG_TOOLS_BIN}/pkg_info -PKG_VIEW_CMD?= ${PKG_TOOLS_BIN}/pkg_view -LINKFARM_CMD?= ${PKG_TOOLS_BIN}/linkfarm - -.if !defined(PKGTOOLS_VERSION) -PKGTOOLS_VERSION!= ${PKG_INFO_CMD} -V 2>/dev/null || echo 20010302 -MAKEFLAGS+= PKGTOOLS_VERSION=${PKGTOOLS_VERSION:Q} -.endif - -# The binary pkg_install tools all need to consistently to refer to the -# correct package database directory. -# -.if ${PKGTOOLS_VERSION} < 20030823 -PKGTOOLS_ENV?= PKG_DBDIR=${_PKG_DBDIR:Q} -PKGTOOLS_ARGS?= # empty -.else -PKGTOOLS_ENV?= # empty -PKGTOOLS_ARGS?= -K ${_PKG_DBDIR:Q} -.endif - -# Views are rooted in ${LOCALBASE}, all packages are depoted in -# ${DEPOTBASE}, and the package database directory for the default view -# is in ${PKG_DBDIR}. -# -PKG_VIEW_ARGS?= -W ${LOCALBASE} -d ${DEPOTBASE} -k ${PKG_DBDIR} - -PKG_ADD?= ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD_CMD} ${PKGTOOLS_ARGS} -PKG_ADMIN?= ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADMIN_CMD} ${PKGTOOLS_ARGS} -PKG_CREATE?= ${SETENV} ${PKGTOOLS_ENV} ${PKG_CREATE_CMD} ${PKGTOOLS_ARGS} -PKG_DELETE?= ${SETENV} ${PKGTOOLS_ENV} ${PKG_DELETE_CMD} ${PKGTOOLS_ARGS} -PKG_INFO?= ${SETENV} ${PKGTOOLS_ENV} ${PKG_INFO_CMD} ${PKGTOOLS_ARGS} -PKG_VIEW?= ${SETENV} ${PKGTOOLS_ENV} ${PKG_VIEW_CMD} ${PKG_VIEW_ARGS} -LINKFARM?= ${LINKFARM_CMD} - -# "${PKG_BEST_EXISTS} pkgpattern" prints out the name of the installed -# package that best matches pkgpattern. Use this instead of -# "${PKG_INFO} -e pkgpattern" if the latter would return more than one -# package name. -# -PKG_BEST_EXISTS?= ${PKG_ADMIN} -b -d ${_PKG_DBDIR} -S lsbest - .if exists(${LOCALBASE}/bsd/share/mk/zoularis.mk) PKG_FAIL_REASON+= 'You appear to have a deprecated Zoularis installation.' PKG_FAIL_REASON+= 'Please update your system to bootstrap-pkgsrc and remove the' @@ -612,6 +555,11 @@ PREPEND_PATH+= ${USE_X11:D${X11BASE}/bin} ${LOCALBASE}/bin # Make variable definitions cache .include "${PKGSRCDIR}/mk/bsd.makevars.mk" +.include "${PKGSRCDIR}/mk/flavor/bsd.flavor-vars.mk" +.include "${PKGSRCDIR}/mk/check/bsd.check-vars.mk" +.include "${PKGSRCDIR}/mk/depends/bsd.depends-vars.mk" +.include "${PKGSRCDIR}/mk/install/bsd.install-vars.mk" + USE_TOOLS+= awk:pkgsrc cut:pkgsrc echo:pkgsrc pwd:pkgsrc \ sed:pkgsrc tr:pkgsrc uname:pkgsrc |