Makefile revision 0ea64585698b885134cf212069f5ff7ebda376a6
d24d4c5159bcb11c25bb294926cfe7105c789ea9slive# CDDL HEADER START
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd# The contents of this file are subject to the terms of the
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# Common Development and Distribution License (the "License").
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# You may not use this file except in compliance with the License.
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding# See the License for the specific language governing permissions
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding# and limitations under the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# When distributing Covered Code, include this CDDL HEADER in each
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# If applicable, add the following below this CDDL HEADER, with the
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# fields enclosed by brackets "[]" replaced with your own identifying
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# information: Portions Copyright [yyyy] [name of copyright owner]
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# CDDL HEADER END
7db9f691a00ead175b03335457ca296a33ddf31bnd# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
88f76f668542dcd72fc9d71577997967c6bf123bslive# Use is subject to license terms.
88f76f668542dcd72fc9d71577997967c6bf123bslive# Make sure we're getting a consistent execution environment for the
88f76f668542dcd72fc9d71577997967c6bf123bslive# embedded scripts.
88f76f668542dcd72fc9d71577997967c6bf123bslive# On non-OpenSolaris systems, the fallback to the build system to
88f76f668542dcd72fc9d71577997967c6bf123bslive# satisfy interconsolidation dependencies won't work. To avoid that
88f76f668542dcd72fc9d71577997967c6bf123bslive# pitfall, disable package dependency generation on such systems.
88f76f668542dcd72fc9d71577997967c6bf123bslive# For any OpenSolaris system, SUNWcs should be installed, and is not
88f76f668542dcd72fc9d71577997967c6bf123bslive# expected to be renamed soon.
88f76f668542dcd72fc9d71577997967c6bf123bslive# To suppress package dependency generation on any system, regardless
88f76f668542dcd72fc9d71577997967c6bf123bslive# of how it was installed, set SUPPRESSPKGDEP=true in the build
88f76f668542dcd72fc9d71577997967c6bf123bslive# environment.
ed213de6d7481be782a20ecc2675bc57fd4fac69slive PKG_CACHEDIR=$tdir pkg list SUNWcs > /dev/null 2>&1; \
ed213de6d7481be782a20ecc2675bc57fd4fac69slive print "true"; \
ed213de6d7481be782a20ecc2675bc57fd4fac69slive print "false"; \
38677582e6ddf26e810728a68cbe560345486e48slive# Comment this line out or set "PKGDEBUG=" in your build environment
38677582e6ddf26e810728a68cbe560345486e48slive# to get more verbose output from the make processes in usr/src/pkg
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# Cross platform packaging notes
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# By default, we package the proto area from the same architecture as
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# the packaging build. In other words, if you're running nightly or
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# bldenv on an x86 platform, it will take objects from the x86 proto
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# area and use them to create x86 repositories.
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# If you want to create repositories for an architecture that's
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# different from $(uname -p), you do so by setting PKGMACH in your
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# build environment.
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# For this to work correctly, the following must all happen:
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# 1. You need the desired proto area, which you can get either by
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# doing a gatekeeper-style build with the -U option to
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# nightly(1), or by using rsync. If you don't do this, you will
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# get packaging failures building all packages, because pkgsend
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# is unable to find the required binaries.
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# 2. You need the desired tools proto area, which you can get in the
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# same ways as the normal proto area. If you don't do this, you
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# will get packaging failures building SUNWonbld, because pkgsend is
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# unable to find the tools binaries.
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# 3. You need to have built the appropriate third party license
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# files in $SRC, which generally means you should override SRC in
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# your build environment. If you don't do this, you will get
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# packaging failures because pkgsend is unable to find various
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# THIRDPARTYLICENSE files.
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# 4. The remainder of this Makefile should never refer directly to
7647551a51db086eef1f5b651b2d6f174dffb8b3slive# $(MACH). Instead, $(PKGMACH) should be used whenever an
7647551a51db086eef1f5b651b2d6f174dffb8b3slive# architecture-specific path or token is needed. If this is done
7647551a51db086eef1f5b651b2d6f174dffb8b3slive# incorrectly, then packaging will fail, and you will see the
88f76f668542dcd72fc9d71577997967c6bf123bslive# value of $(uname -p) instead of the value of $(PKGMACH) in the
88f76f668542dcd72fc9d71577997967c6bf123bslive# commands that fail.
88f76f668542dcd72fc9d71577997967c6bf123bslive# 5. Each time a rule in this Makefile invokes $(MAKE), it should
67a715b4352c3e25bff32fccad48350180393f5end# pass PKGMACH=$(PKGMACH) explicitly on the command line. If
67a715b4352c3e25bff32fccad48350180393f5end# this is done incorrectly, then packaging will fail, and you
88f76f668542dcd72fc9d71577997967c6bf123bslive# will see the value of $(uname -p) instead of the value of
88f76f668542dcd72fc9d71577997967c6bf123bslive# $(PKGMACH) in the commands that fail.
88f76f668542dcd72fc9d71577997967c6bf123bslive# Refer also to the convenience targets defined later in this
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# ROOT, TOOLS_PROTO, and PKGARCHIVE should be set by nightly or
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# bldenv. These macros translate them into terms of $PKGMACH, instead
67a715b4352c3e25bff32fccad48350180393f5endPKGROOT.cmd= print $(ROOT) | sed -e s:/root_$(MACH):/root_$(PKGMACH):
67a715b4352c3e25bff32fccad48350180393f5endTOOLSROOT.cmd= print $(TOOLS_PROTO) | sed -e s:/root_$(MACH):/root_$(PKGMACH):
0222f4c188bbd414e293e0b78a8e350e3054322anilgunPKGDEST.cmd= print $(PKGARCHIVE) | sed -e s:/$(MACH)/:/$(PKGMACH)/:
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# The publish transforms, EXCEPTIONS list, and some manifests need to
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# know when we're building open-only and when we're using internal
88f76f668542dcd72fc9d71577997967c6bf123bslive# crypto bits.
67a715b4352c3e25bff32fccad48350180393f5end# We only use internal crypto when we're doing a closed build, the
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# CODESIGN_USER env variable is not set, and ON_CRYPTO_BINS is not set.
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# This matches the conditions under which the internal key and cert
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# are needed for the packaged objects.
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# We use X_FLAG, as exported by nightly and bldenv, to decide when we
88f76f668542dcd72fc9d71577997967c6bf123bslive# need IHV-related exceptions for protocmp.
88f76f668542dcd72fc9d71577997967c6bf123bslive# Always build the redistributable repository, but only build the
88f76f668542dcd72fc9d71577997967c6bf123bslive# nonredistributable bits if we have access to closed source.
88f76f668542dcd72fc9d71577997967c6bf123bslive# Some objects that result from the closed build are still
88f76f668542dcd72fc9d71577997967c6bf123bslive# redistributable, and should be packaged as part of an open-only
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# build. Access to those objects is provided via the closed-bins
88f76f668542dcd72fc9d71577997967c6bf123bslive# tarball. See usr/src/tools/scripts/bindrop.sh for details.
88f76f668542dcd72fc9d71577997967c6bf123bslive# The packages directory will contain the processed manifests as
88f76f668542dcd72fc9d71577997967c6bf123bslive# direct build targets and subdirectories for package metadata extracted
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# incidentally during manifest processing.
030108b1816bcda3d925df65357feabdce83bc94slive# Nothing underneath $(PDIR) should ever be managed by SCM.
88f76f668542dcd72fc9d71577997967c6bf123bslive# The tools proto must be specified for dependency generation.
67a715b4352c3e25bff32fccad48350180393f5end# Publication from the tools proto area is managed in the
67a715b4352c3e25bff32fccad48350180393f5end# publication rule.
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier$(PKGDEST)/repo.extra:= PKGPUBLISHER= $(PKGPUBLISHER_NONREDIST)
aa997d6b651a6ac262d708b7f807a080d57c3844slive# To get these defaults, manifests should simply refer to $(PKGVERS).
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirierPKGVERS= $(PKGVERS_COMPONENT),$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# The ARCH32 and ARCH64 macros are used in the manifests to express
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# architecture-specific subdirectories in the installation paths
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# for isaexec'd commands.
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# We can't simply use $(MACH32) and $(MACH64) here, because they're
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# only defined for the build architecture. To do cross-platform
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# packaging, we need both values.
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# macros and transforms needed by pkgmogrify
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# If you append to this list using target-specific assignments (:=),
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# be very careful that the targets are of the form $(PDIR)/pkgname. If
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# you use a higher level target, or a package list, you'll trigger a
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# complete reprocessing of all manifests because they'll fail command
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# dependency checking.
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirierPM_TRANSFORMS= publish restart_fmri defaults extract_metadata
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier 'PLATFORM=i86hvm' \
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier 'PLATFORM=i86pc' \
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier 'PLATFORM=i86xpv' \
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier 'ISALIST=amd64' \
88f76f668542dcd72fc9d71577997967c6bf123bslive 'ISALIST=i386'
88f76f668542dcd72fc9d71577997967c6bf123bslive 'PLATFORM=sun4u' \
88f76f668542dcd72fc9d71577997967c6bf123bslive 'PLATFORM=sun4v' \
88f76f668542dcd72fc9d71577997967c6bf123bslive 'ISALIST=sparcv9' \
88f76f668542dcd72fc9d71577997967c6bf123bslive 'ISALIST=sparc'
88f76f668542dcd72fc9d71577997967c6bf123bslive# The package lists are generated with $(PKGDEP_TYPE) as their
88f76f668542dcd72fc9d71577997967c6bf123bslive# dependency types, so that they can be included by either an
88f76f668542dcd72fc9d71577997967c6bf123bslive# incorporation or a group package.
88f76f668542dcd72fc9d71577997967c6bf123bslive$(PDIR)/osnet-redist.mog $(PDIR)/osnet-extra.mog:= PKGDEP_TYPE= require
82fedb7a2164fa01fe2870f080aeac6344503148slive$(PDIR)/osnet-incorporation.mog:= PKGDEP_TYPE= incorporate
aa997d6b651a6ac262d708b7f807a080d57c3844slive depend fmri=consolidation/osnet/osnet-incorporation type=require
e32abf00422bf50d92c28c448f60b951c8fa42earbowen# All packaging build products should go into $(PDIR), so they don't
e32abf00422bf50d92c28c448f60b951c8fa42earbowen# need to be included separately in CLOBBERFILES.
82fedb7a2164fa01fe2870f080aeac6344503148slive# By default, PKGS will list all manifests. To build and/or publish a
82fedb7a2164fa01fe2870f080aeac6344503148slive# subset of packages, override this on the command line or in the
82fedb7a2164fa01fe2870f080aeac6344503148slive# build environment and then reference (implicitly or explicitly) the all
88f76f668542dcd72fc9d71577997967c6bf123bslive# or install targets.
88f76f668542dcd72fc9d71577997967c6bf123bslive# Track the synthetic manifests separately so we can properly express
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# build rules and dependencies. The synthetic and real packages use
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# different sets of transforms and macros for pkgmogrify.
1dc8b93510d9b89f686e98b98a18cc436cefa7f2slive# For each package, we determine the target repository based on
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# manifest-embedded metadata. Because we make that determination on
1dc8b93510d9b89f686e98b98a18cc436cefa7f2slive# the fly, the publication target cannot be expressed as a
1dc8b93510d9b89f686e98b98a18cc436cefa7f2slive# subdirectory inside the unknown-by-the-makefile target repository.
88f76f668542dcd72fc9d71577997967c6bf123bslive# In order to limit the target set to real files in known locations,
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# we use a ".pub" file in $(PDIR) for each processed manifest, regardless
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# of content or target repository.
0222f4c188bbd414e293e0b78a8e350e3054322anilgunPUB_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.pub) $(PKGS:%=$(PDIR)/%.pub)
88f76f668542dcd72fc9d71577997967c6bf123bslive# Any given repository- and status-specific package list may be empty,
67a715b4352c3e25bff32fccad48350180393f5end# but we can only determine that dynamically, so we always generate all
88f76f668542dcd72fc9d71577997967c6bf123bslive# lists for each repository we're building.
88f76f668542dcd72fc9d71577997967c6bf123bslive# The meanings of each package status are as follows:
88f76f668542dcd72fc9d71577997967c6bf123bslive# PKGSTAT meaning
88f76f668542dcd72fc9d71577997967c6bf123bslive# ---------- ----------------------------------------------------
88f76f668542dcd72fc9d71577997967c6bf123bslive# noincorp Do not include in incorporation or group package
88f76f668542dcd72fc9d71577997967c6bf123bslive# obsolete Include in incorporation, but not group package
88f76f668542dcd72fc9d71577997967c6bf123bslive# renamed Include in incorporation, but not group package
88f76f668542dcd72fc9d71577997967c6bf123bslive# current Include in incorporation and group package
88f76f668542dcd72fc9d71577997967c6bf123bslive# Since the semantics of the "noincorp" package status dictate that
88f76f668542dcd72fc9d71577997967c6bf123bslive# such packages are not included in the incorporation or group packages,
88f76f668542dcd72fc9d71577997967c6bf123bslive# there is no need to build noincorp package lists.
88f76f668542dcd72fc9d71577997967c6bf123bslive# Since packages depend on their incorporation, noincorp necessarily
88f76f668542dcd72fc9d71577997967c6bf123bslive# implies nodepend, or it would inadvertently pull in other packages.
67a715b4352c3e25bff32fccad48350180393f5end# XXX Once we can publish in parallel, we can add $(PUB_PKGS) here.
67a715b4352c3e25bff32fccad48350180393f5end# And then we can also remove the leading "all .WAIT" from the
88f76f668542dcd72fc9d71577997967c6bf123bslive# install target, which currently allows us to at least process in
bd63a8c7b38d0af10e7c9d891a245913daabd352rbowen# For a single manifest, the dependency chain looks like this:
88f76f668542dcd72fc9d71577997967c6bf123bslive# raw manifest (mypkg.mf)
88f76f668542dcd72fc9d71577997967c6bf123bslive# | use pkgmogrify to process raw manifest
88f76f668542dcd72fc9d71577997967c6bf123bslive# processed manifest (mypkg.mog)
15ba1801088da1aad6d20609cf3f7b0b1eefce8aslive# * | use pkgdepend generate to generate dependencies
67a715b4352c3e25bff32fccad48350180393f5end# manifest with TBD dependencies (mypkg.dep)
88f76f668542dcd72fc9d71577997967c6bf123bslive# % | use pkgdepend resolve to resolve dependencies
88f76f668542dcd72fc9d71577997967c6bf123bslive# manifest with dependencies resolved (mypkg.res)
88f76f668542dcd72fc9d71577997967c6bf123bslive# | use pkgsend to publish the package
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# placeholder to indicate successful publication (mypkg.pub)
88f76f668542dcd72fc9d71577997967c6bf123bslive# * This may be suppressed via SUPPRESSPKGDEP. The resulting
88f76f668542dcd72fc9d71577997967c6bf123bslive# packages will install correctly, but care must be taken to
88f76f668542dcd72fc9d71577997967c6bf123bslive# install all dependencies, because pkg will not have the input
88f76f668542dcd72fc9d71577997967c6bf123bslive# it needs to determine this automatically.
67a715b4352c3e25bff32fccad48350180393f5end# % This is included in this diagram to make the picture complete, but
67a715b4352c3e25bff32fccad48350180393f5end# this is a point of synchronization in the build process.
ffe8ed2cd88be2c415ddef11f50394c52df9190ctrawick# Dependency resolution is actually done once on the entire set of
67a715b4352c3e25bff32fccad48350180393f5end# manifests, not on a per-package basis.
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# The full dependency chain for generating everything that needs to be
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# published, without actually publishing it, looks like this:
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# processed synthetic packages
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# package lists synthetic package manifests
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# processed real packages
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# package dir real package manifests
88f76f668542dcd72fc9d71577997967c6bf123bslive# Here, each item is a set of real or synthetic packages. For this
88f76f668542dcd72fc9d71577997967c6bf123bslive# portion of the build, no reference is made to the proto area. It is
88f76f668542dcd72fc9d71577997967c6bf123bslive# therefore suitable for the "all" target, as opposed to "install."
88f76f668542dcd72fc9d71577997967c6bf123bslive# Since each of these steps is expressed explicitly, "all" need only
88f76f668542dcd72fc9d71577997967c6bf123bslive# depend on the head of the chain.
88f76f668542dcd72fc9d71577997967c6bf123bslive# From the end of manifest processing, the publication dependency
88f76f668542dcd72fc9d71577997967c6bf123bslive# chain looks like this:
88f76f668542dcd72fc9d71577997967c6bf123bslive# repository metadata (catalogs and search indices)
88f76f668542dcd72fc9d71577997967c6bf123bslive# published packages
88f76f668542dcd72fc9d71577997967c6bf123bslive# | | pkgsend publish
88f76f668542dcd72fc9d71577997967c6bf123bslive# repositories resolved dependencies
88f76f668542dcd72fc9d71577997967c6bf123bslive# pkgsend | | pkgdepend resolve
88f76f668542dcd72fc9d71577997967c6bf123bslive# create-repository |
67a715b4352c3e25bff32fccad48350180393f5end# | generated dependencies
88f76f668542dcd72fc9d71577997967c6bf123bslive# repo directories |
88f76f668542dcd72fc9d71577997967c6bf123bslive# | pkgdepend
88f76f668542dcd72fc9d71577997967c6bf123bslive# processed manifests
88f76f668542dcd72fc9d71577997967c6bf123bslive# Due to limitations in pkgdepend, we cannot simply treat synthetic
88f76f668542dcd72fc9d71577997967c6bf123bslive# and real manifests identically. But we don't really want to
88f76f668542dcd72fc9d71577997967c6bf123bslive# maintain a separate chain for synthetic manifests, so for the left
88f76f668542dcd72fc9d71577997967c6bf123bslive# side of this diagram, we actually do faux dependency generation and
88f76f668542dcd72fc9d71577997967c6bf123bslive# resolution, so we end up with the expected set of files in $(PDIR),
88f76f668542dcd72fc9d71577997967c6bf123bslive# per the individual file chain described above: mf, mog, dep, res,
88f76f668542dcd72fc9d71577997967c6bf123bslive# and pub files for each manifest.
67a715b4352c3e25bff32fccad48350180393f5end# This will build the directory to contain the processed manifests
88f76f668542dcd72fc9d71577997967c6bf123bslive# and the metadata symlinks.
88f76f668542dcd72fc9d71577997967c6bf123bslive# This rule resolves dependencies across all published manifests.
aa997d6b651a6ac262d708b7f807a080d57c3844slive# We should be able to do this with
aa997d6b651a6ac262d708b7f807a080d57c3844slive# pkgdepend resolve -m $(PUB_PKGS:%.pub=%.dep)
88f76f668542dcd72fc9d71577997967c6bf123bslive# but until 14113 is fixed, the incorporations confuse pkgdepend, so we
67a715b4352c3e25bff32fccad48350180393f5end# just create the .res file for DEP_SYNTH_PKGS directly.
67a715b4352c3e25bff32fccad48350180393f5end# We also shouldn't have to ignore the error from pkgdepend, but
88f76f668542dcd72fc9d71577997967c6bf123bslive# until at least 14110 is resolved, pkgdepend will always exit with
aa997d6b651a6ac262d708b7f807a080d57c3844slive -$(PKGDEBUG)if [ "$(SUPPRESSPKGDEP)" = "true" ]; then \
aa997d6b651a6ac262d708b7f807a080d57c3844slive print "Suppressing dependency resolution"; \
aa997d6b651a6ac262d708b7f807a080d57c3844slive print "Resolving dependencies"; \
e54ed2ca7730f513417f7ddbb2c85a49a8063cdbpctony @print "Creating repository metadata"
aa997d6b651a6ac262d708b7f807a080d57c3844slive# Since we create zero-length processed manifests for a graceful abort
aa997d6b651a6ac262d708b7f807a080d57c3844slive# from pkgmogrify, we need to detect that here and make no effort to
aa997d6b651a6ac262d708b7f807a080d57c3844slive# publish the package.
aa997d6b651a6ac262d708b7f807a080d57c3844slive# For all other packages, we publish them regardless of status. We
48981ff8ae4c9f2d7ac18c320727de9c36480d0fslive# derive the target repository as a component of the metadata-derived
48981ff8ae4c9f2d7ac18c320727de9c36480d0fslive# symlink for each package.
48981ff8ae4c9f2d7ac18c320727de9c36480d0fslivepublish_pkgs: $(REPOS:%=$(PKGDEST)/repo.%) $(PDIR)/gendeps .WAIT $(PUB_PKGS)
48981ff8ae4c9f2d7ac18c320727de9c36480d0fslive# Initialize the empty on-disk repositories
88f76f668542dcd72fc9d71577997967c6bf123bslive# rule to process real manifests
88f76f668542dcd72fc9d71577997967c6bf123bslive# To allow redistributability and package status to change, we must
88f76f668542dcd72fc9d71577997967c6bf123bslive# remove not only the actual build target (the processed manifest), but
88f76f668542dcd72fc9d71577997967c6bf123bslive# also the incidental ones (the metadata-derived symlinks).
67a715b4352c3e25bff32fccad48350180393f5end# If pkgmogrify exits cleanly but fails to create the specified output
67a715b4352c3e25bff32fccad48350180393f5end# file, it means that it encountered an abort directive. That means
88f76f668542dcd72fc9d71577997967c6bf123bslive# that this package should not be published for this particular build
88f76f668542dcd72fc9d71577997967c6bf123bslive# environment. Since we can't prune such packages from $(PKGS)
88f76f668542dcd72fc9d71577997967c6bf123bslive# retroactively, we need to create an empty target file to keep make
88f76f668542dcd72fc9d71577997967c6bf123bslive# from trying to rebuild it every time. For these empty targets, we
88f76f668542dcd72fc9d71577997967c6bf123bslive# do not create metadata symlinks.
0222f4c188bbd414e293e0b78a8e350e3054322anilgun# Automatic dependency resolution to files is also done at this phase of
030108b1816bcda3d925df65357feabdce83bc94slive# processing. The skipped packages are skipped due to existing bugs
88f76f668542dcd72fc9d71577997967c6bf123bslive# in pkgdepend.
88f76f668542dcd72fc9d71577997967c6bf123bslive# The incorporation dependency is tricky: it needs to go into all
88f76f668542dcd72fc9d71577997967c6bf123bslive# current and renamed manifests (ie all incorporated packages), but we
88f76f668542dcd72fc9d71577997967c6bf123bslive# don't know which those are until after we run pkgmogrify. So
67a715b4352c3e25bff32fccad48350180393f5end# instead of expressing it as a transform, we tack it on ex post facto.
67a715b4352c3e25bff32fccad48350180393f5end# Implementation notes:
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# - The first $(RM) must not match other manifests, or we'll run into
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# race conditions with parallel manifest processing.
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# - The make macros [ie $(MACRO)] are evaluated when the makefile is
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# read in, and will result in a fixed, macro-expanded rule for each
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# target enumerated in $(PROC_PKGS).
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# - The shell variables (ie $$VAR) are assigned on the fly, as the rule
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# is executed. The results may only be referenced in the shell in
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# which they are assigned, so from the perspective of make, all code
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# that needs these variables needs to be part of the same line of
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# code. Hence the use of command separators and line continuation
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# characters.
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# - The extract_metadata transforms are designed to spit out shell
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# variable assignments to stdout. So the eval statement should
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# begin with the default values, and any output from pkgmogrify
c700b3b19086d0d0d52e74fd51e54864e3a11bbbpoirier# should be in the form of a variable assignment to override those
88f76f668542dcd72fc9d71577997967c6bf123bslive# - When this rule completes execution, it must leave an updated
88f76f668542dcd72fc9d71577997967c6bf123bslive# target file ($@) in place, or make will reprocess the package
88f76f668542dcd72fc9d71577997967c6bf123bslive# every time it encounters it as a dependency. Hence the "touch"
88f76f668542dcd72fc9d71577997967c6bf123bslive# statement to ensure that the target is created, even when
# The full chain implies that there should be a .dep.res suffix rule,
# repo/pkgstat-specific subdir, in hopes of maybe giving some
} while ((e == 1) && (f !~ /name=pkg.fmri/)); \
FRC:
XMOD_PKGS= \
BRCMbnx \
BRCMbnxe \
SUNWkdc \
SUNWspwr \
SUNWsvvs \