Makefile revision 1447
98N/A###############################################################################
98N/A#
98N/A# Makefile for X Consolidation packages
98N/A#
935N/A# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
98N/A#
98N/A# Permission is hereby granted, free of charge, to any person obtaining a
919N/A# copy of this software and associated documentation files (the "Software"),
919N/A# to deal in the Software without restriction, including without limitation
919N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A# and/or sell copies of the Software, and to permit persons to whom the
919N/A# Software is furnished to do so, subject to the following conditions:
919N/A#
919N/A# The above copyright notice and this permission notice (including the next
919N/A# paragraph) shall be included in all copies or substantial portions of the
919N/A# Software.
919N/A#
919N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A# DEALINGS IN THE SOFTWARE.
98N/A#
98N/A###############################################################################
98N/A# Heavily inspired by / borrowed from the ON usr/src/pkg/Makefile
235N/A# Please read the comments in it and the accompanying README in ON for many
156N/A# details omitted here.
156N/A# Major differences in the X implementation:
156N/A# - X only supports building one repo, not redist + extra
156N/A# - X only supports building packages on the same platform as the binaries,
98N/A# no cross-platform packaging
98N/A# - X has no bfu legacy to deal with
98N/A# - ON has all manifests in one directory, X splits into current & legacy
98N/A# - Integrates with X consolidation makefile/build system instead of ON's
493N/A
493N/APWD:sh=pwd
98N/ATOP=$(PWD)/..
911N/A
952N/A### Include common definitions
952N/Ainclude $(TOP)/open-src/common/Makefile.init
911N/A
98N/A.SUFFIXES: .p5m .mog .dep .res .pub
235N/A
493N/A# We don't yet support building packages cross-architecture, but would
98N/A# need this if we ever did. (See "Cross platform packaging notes" in
916N/A# the ON usr/src/pkg/Makefile for what we'd have to do.)
916N/APKGMACH = $(MACH)
916N/A
916N/A# Map X makefile names to the ones used in the rules copied from ON
98N/A# More to be updated if we ever decide to support building cross-platform
98N/APKGROOT = $(PROTODIR)
98N/APKGDEST = $(PROTOTOP)/pkg_$(PKGMACH)
606N/A
98N/A# Map the V=1 style of enabling more verbose build messages used in the
98N/A# X.Org/automake builds to the macro used in the rules copied from ON
98N/A#
606N/A# You can enable verbose output with either V=1 or PKGDEBUG=""
606N/APKGDEBUG_V_0 = @
98N/APKGDEBUG_V_1 =
493N/APKGDEBUG_V_ = $(PKGDEBUG_V_0)
493N/APKGDEBUG = $(PKGDEBUG_V_$(V))
98N/A
98N/A# Commands used in rules copied from ON
98N/ACP= /usr/bin/cp -f
98N/ALN= /usr/bin/ln
908N/AMV= /usr/bin/mv -f
591N/ARM= /usr/bin/rm -f
493N/ASED= /usr/bin/sed
493N/ATOUCH= /usr/bin/touch
493N/A
493N/A#
493N/A# To suppress package dependency generation on any system, regardless
493N/A# of how it was installed, set SUPPRESSPKGDEP=true in the build
493N/A# environment.
493N/A#
493N/ASUPPRESSPKGDEP= false
705N/A
493N/A
557N/A#
557N/A# The packages directory will contain the processed manifests as
493N/A# direct build targets and subdirectories for package metadata extracted
493N/A# incidentally during manifest processing.
965N/A#
965N/A# Nothing underneath $(PDIR) should ever be managed by SCM.
965N/A#
606N/APDIR= build-$(PKGMACH)
606N/A
851N/A$(PDIR):
851N/A mkdir -p $@
851N/A
851N/A#
851N/A# By default, PKGS will list all manifests. To build and/or publish a
851N/A# subset of packages, override this on the command line or in the
851N/A# build environment and then reference (implicitly or explicitly) the all
98N/A# or install targets.
591N/A#
963N/ACURRENT_MANIFESTS :sh= (cd manifests; print *.p5m)
963N/ALEGACY_MANIFESTS :sh= (cd legacy; print *.p5m)
851N/AMANIFESTS = $(CURRENT_MANIFESTS) $(LEGACY_MANIFESTS)
591N/APKGS= $(MANIFESTS:%.p5m=%)
910N/A
910N/A#
910N/A# Track the synthetic manifests separately so we can properly express
910N/A# build rules and dependencies. The synthetic and real packages use
910N/A# different sets of transforms and macros for pkgmogrify.
910N/A#
98N/ASYNTH_PKGS= X-incorporation X-all
98N/ASYNTH_MANIFESTS = $(SYNTH_PKGS:%=%.p5m)
910N/A
910N/A# Special manifest for exceptions to pass to pkglint & validate_pkg
910N/AEXCEPTION_MANIFESTS = exceptions-validate_pkg.p5m
98N/A
606N/A# Manifests are in either manifests or legacy directory - merge in $(PDIR)
98N/A$(PDIR)/%.p5m: manifests/%.p5m
606N/A $(PKGDEBUG)$(LN) -s ../$< $@
98N/A
591N/A$(PDIR)/%.p5m: legacy/%.p5m
851N/A $(PKGDEBUG)$(LN) -s ../$< $@
111N/A
111N/A$(PDIR)/%.p5m: %.p5m
111N/A $(PKGDEBUG)$(LN) -s ../$< $@
111N/A
111N/AALL_MANIFEST_SRCS = $(MANIFESTS) $(SYNTH_MANIFESTS) $(EXCEPTION_MANIFESTS)
606N/AALL_MANIFESTS = $(ALL_MANIFEST_SRCS:%=$(PDIR)/%)
851N/Amanifests: $(ALL_MANIFESTS)
851N/A$(ALL_MANIFESTS): $(PDIR)
851N/A
606N/A### Additional metadata generation
733N/A
733N/A$(PROTOMETA)/%/:
733N/A $(PKGDEBUG)mkdir -p $@
733N/A
733N/A# Generate default copyright notice for packages without contents
963N/A$(PROTOMETA)/%/cr_Oracle: $(PDIR)/%.p5m $(PROTOMETA)/%/
851N/A $(PKGDEBUG)gsed -n -e '/# Copyright .* Oracle/ {' \
963N/A -e 's/^# //' -e 'p' -e 'q' -e'}' $< > $@
98N/A
851N/ASYNTH_LICENSES = $(SYNTH_PKGS:%=$(PROTOMETA)/%/cr_Oracle)
851N/A
851N/A# This should eventually move into pkg publication
851N/A
935N/AFONT_MANIFESTS :sh= (cd manifests; print system-font-*.p5m)
851N/AFONT_METADATA = $(FONT_MANIFESTS:%.p5m=$(PDIR)/%.font)
851N/AFONT_ATTRS = $(FONT_MANIFESTS:%.p5m=$(PDIR)/%.attr)
851N/A
212N/A$(FONT_ATTRS): $(FONT_METADATA)
851N/A
935N/AFONT_LIBS_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR)$(LIBSUBDIR_64):$(PROTODIR)$(X11_DIR)/lib$(LIBSUBDIR_64):$(PROTODIR)/usr/lib$(LIBSUBDIR_64)
606N/A
935N/A$(PDIR)/%.font: $(PDIR)/%.p5m
935N/A @print "## Generating font metadata in $(@F)"
935N/A $(PKGDEBUG)$(RM) $(@)
935N/A $(PKGDEBUG)LD_LIBRARY_PATH=$(FONT_LIBS_PATH) \
212N/A $(PERL) generate_font_metadata.pl \
98N/A -p $(PROTODIR) -m $< > $@ || ( rm $@ ; exit 1 )
98N/A
98N/A### Manifest mogrification
98N/A
182N/APKGMOGRIFY = pkgmogrify
98N/A
908N/A# RELEASE = uname -r for the target release
963N/ARELEASE = 5.11
963N/APKGVERS_BUILTON = $(RELEASE)
963N/A
908N/A# The PKGVERS_BRANCH is determined by the values in the Makefile.buildnum
963N/Ainclude Makefile.buildnum
963N/APKGVERS_BRANCH_MAIN = 0.$(TRUNKID).$(UPDATENUM).$(SRUNUM).$(PLATNUM)
963N/APKGVERS_BRANCH = $(PKGVERS_BRANCH_MAIN).$(BUILDID).$(NIGHTLYID)
963N/A
963N/APKGVERS_BUILD = $(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
963N/A
963N/A# Generate pkgmogrify transform file with correct build version info in
963N/A# Build number is derived from last nv_XXX tag in hg log
963N/A$(PDIR)/versions: transforms/versions.tmpl $(PDIR)
963N/A @print "## Substituting build info in versions transformation template"
963N/A $(PKGDEBUG) HG_ID="$$(hg id)" ; \
963N/A $(PERL) -p -e "s{_PKGVERS_BUILD_}{$(PKGVERS_BUILD)};" \
963N/A -e "s{_HG_ID_}{$${HG_ID}}" transforms/versions.tmpl > $@
963N/A
963N/A# Set variables used by pkgmogrify
963N/A# These are the macros that may be used in package manifests
963N/APKGMOG_DEFINES =
963N/A
963N/A# Most upstream packages provide specific version numbers instead of using
963N/A# the default of $(OSPKGVERS)
963N/A# Some use $(X11PKGVERS) to refer to the X11 katamari version since they
963N/A# bundle together components from multiple upstream packages with individual
963N/A# version numbers
963N/APKGMOG_DEFINES += X11PKGVERS=7.7
963N/APKGMOG_DEFINES += OSPKGVERS=0.$(RELEASE)
963N/A
963N/A# Base URL for ARC cases used in opensolaris.arc_url metadata
963N/APKGMOG_DEFINES += ARC_URL='http://arc.opensolaris.org/caselog/'
963N/A
963N/A# Platform specific choices
963N/APKGMOG_DEFINES += i386_ONLY=$(POUND_SIGN) sparc_ONLY=$(POUND_SIGN)
963N/APKGMOG_DEFINES += $(PKGMACH)_ONLY=
963N/A
# Architecture specific directory names
PKGMOG_DEFINES += ARCH=$(PKGMACH)
PKGMOG_DEFINES += ARCH32=$(SUBDIR32_$(PKGMACH))
PKGMOG_DEFINES += ARCH64=$(SUBDIR64_$(PKGMACH))
# Perl version string used in package names, such as pkg:/runtime/perl-512
PERL_PKG_VERSION_CMD = print $(PERL_VERSION) | tr -d '.'
PKGMOG_DEFINES += PERL_PKG_VERSION=$(PERL_PKG_VERSION_CMD:sh)
# Python version string used in path names, such as /usr/lib/python2.6
PKGMOG_DEFINES += PYTHON_PATH_VERSION=$(PYTHON_VERSION)
# Python version string used in package names, such as pkg:/runtime/python-26
PYTHON_PKG_VERSION_CMD = print $(PYTHON_VERSION) | tr -d '.'
PKGMOG_DEFINES += PYTHON_PKG_VERSION=$(PYTHON_PKG_VERSION_CMD:sh)
# automake version needed for build dependencies
AUTOMAKE_PKG_VERSION_CMD = print $(AUTOMAKE_VERSION) | tr -d '.'
PKGMOG_DEFINES += AUTOMAKE_PKG_VERSION=$(AUTOMAKE_PKG_VERSION_CMD:sh)
# gcc version needed for build dependencies
GCC_PKG_VERSION_CMD = print $(GCC_VERSION) | tr -d '.'
PKGMOG_DEFINES += GCC_PKG_VERSION=$(GCC_PKG_VERSION_CMD:sh)
PROC_PKGS = $(PKGS:%=$(PDIR)/%.mog)
PROC_CURRENT_PKGS = $(CURRENT_MANIFESTS:%.p5m=$(PDIR)/%.mog)
PROC_LEGACY_PKGS = $(LEGACY_MANIFESTS:%.p5m=$(PDIR)/%.mog)
PROC_SYNTH_PKGS = $(SYNTH_MANIFESTS:%.p5m=$(PDIR)/%.mog)
PROC_EXCEPTIONS = $(EXCEPTION_MANIFESTS:%.p5m=$(PDIR)/%.mog)
# Default transformations to apply
PM_TRANSFORMS = $(PKG_BRANDING_TRANSFORMS) \
common_actions publish restart_fmri facets \
$(PDIR)/versions
PM_INC = transforms
# Additional transforms for specific types of packages
$(PROC_CURRENT_PKGS) $(PROC_SYNTH_PKGS) $(PROC_EXCEPTIONS) := \
EXTRA_TRANSFORMS = defaults
mogrify: $(PROC_PKGS) $(PROC_EXCEPTIONS)
$(PROC_PKGS) $(PROC_SYNTH_PKGS): $(PDIR)/versions
# Combine & uniq metadata & license attributes generated during build
$(PDIR)/%.attr:
@print "## Gathering metadata from build for $(@F)"
$(PKGDEBUG)case '$(@F)' in \
system-font-*) ADDITIONAL_ATTRS="$(@:%.attr=%.font)" ;; \
esac ; \
$(PERL) merge-metadata.pl $${ADDITIONAL_ATTRS} \
~(N)$(PROTOMETA)/$(@F:.attr=)/attributes_*.p5m \
~(N)$(PROTOMETA)/$(@F:.attr=)/license_*.p5m /dev/null > $@
$(PDIR)/%.mog: $(PDIR)/%.p5m $(PDIR)/%.attr
@print "## Processing manifest $(@F:.mog=.p5m)"
$(PKGDEBUG)$(RM) $(@) $(@:%.mog=%) \
$(@:%.mog=%.metadata.*) $(@:%.mog=%.synth)
$(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
$(PKGMOG_DEFINES:%=-D %) -O $(@) \
$(@:%.mog=%.p5m) $(@:%.mog=%.attr) \
$(PM_TRANSFORMS) $(EXTRA_TRANSFORMS)
$(PKGDEBUG)$(TOUCH) $(@)
# List of all packages we build, used in open source code release zip files
$(TOP)/pkglist.txt:
@print "## Generating pkglist.txt"
$(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
$(PKGMOG_DEFINES:%=-D %) -O /dev/null \
-I manifests -I legacy $(ALL_MANIFEST_SRCS) extract_names \
| LC_ALL=C sort -u > $(@)
### Dependency detection
# Package manifest containing list of packages to use in dependency
# resolution, and not containing any dependencies to be detected/resolved.
DEP_LIST_PKG = developer-opensolaris-X
DEP_PKGS= $(PKGS:%=$(PDIR)/%.dep)
DEP_CURRENT_PKGS_1 = $(CURRENT_MANIFESTS:%.p5m=$(PDIR)/%.dep)
DEP_CURRENT_PKGS = $(DEP_CURRENT_PKGS_1:$(PDIR)/$(DEP_LIST_PKG).dep=)
DEP_LEGACY_PKGS = $(LEGACY_MANIFESTS:%.p5m=$(PDIR)/%.dep)
DEP_LEGACY_PKGS += $(DEP_LIST_PKG:%=$(PDIR)/%.dep)
DEP_SYNTH_PKGS = $(SYNTH_MANIFESTS:%.p5m=$(PDIR)/%.dep)
PKGDEP_TOKENS_i386= \
'PLATFORM=i86hvm' \
'PLATFORM=i86pc' \
'PLATFORM=i86xpv' \
'ISALIST=amd64' \
'ISALIST=i386'
PKGDEP_TOKENS_sparc= \
'PLATFORM=sun4u' \
'PLATFORM=sun4v' \
'ISALIST=sparcv9' \
'ISALIST=sparc'
PKGDEP_TOKENS= $(PKGDEP_TOKENS_$(PKGMACH))
$(PDIR)/%.dep: $(PDIR)/%.mog
@print "## Generating dependencies for $(<F)"
$(PKGDEBUG)$(RM) $(@)
$(PKGDEBUG)if [[ "$(SUPPRESSPKGDEP)" != "true" ]]; then \
pkgdepend generate -m $(PKGDEP_TOKENS:%=-D %) $(<) \
$(PKGROOT) > $(@); \
else \
$(CP) $(<) $(@); \
fi
$(DEP_SYNTH_PKGS) $(DEP_LEGACY_PKGS): $$(@:%.dep=%.mog)
@print "## Skipping dependency generation for $(@F:%.dep=%)"
$(PKGDEBUG)$(CP) $(@:%.dep=%.mog) $(@)
### Dependency resolution
DEP_RES_PKGS = $(DEP_PKGS:%=%.res)
DEP_RES_CURRENT_PKGS = $(DEP_CURRENT_PKGS:%=%.res)
DEP_RES_LEGACY_PKGS = $(DEP_LEGACY_PKGS:%=%.res)
DEP_RES_SYNTH_PKGS = $(DEP_SYNTH_PKGS:%=%.res)
PKGDEP_VERBOSE_FLAG_0 =
PKGDEP_VERBOSE_FLAG_1 = -v
PKGDEP_VERBOSE_FLAG = $(PKGDEP_VERBOSE_FLAG_$(V))
# Root of pkg image to use for dependency resolution
# Normally / on the machine used to build the binaries
PKGDEP_RESOLVE_IMAGE = /
# File listing packages to consider in dependency resolution.
# Automatically generated from the developer package to ensure they
# stay in sync.
PKGDEP_RESOLVE_LIST = $(PDIR)/resolve.deps
$(PKGDEP_RESOLVE_LIST): $(PDIR)/$(DEP_LIST_PKG).mog
@print "## Generating package list for dependency resolution"
$(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
-O /dev/null -P $(@) $(PDIR)/$(DEP_LIST_PKG).mog extract_depends
# This rule resolves dependencies across all manifests for packages
# currently delivering files.
$(PDIR)/gendeps: $(DEP_CURRENT_PKGS) $(PKGDEP_RESOLVE_LIST)
$(PKGDEBUG)if [[ "$(SUPPRESSPKGDEP)" = "true" ]]; then \
print "## Suppressing dependency resolution"; \
for p in $(DEP_CURRENT_PKGS:%.dep=%); do \
$(CP) $$p.dep $$p.dep.res; \
done; \
else \
print "## Resolving dependencies"; \
pkgdepend -R $(PKGDEP_RESOLVE_IMAGE) resolve -E \
$(PKGDEP_VERBOSE_FLAG) -e $(PKGDEP_RESOLVE_LIST) \
-m $(DEP_CURRENT_PKGS) ; \
fi
$(PKGDEBUG)$(TOUCH) $(@)
gendeps: $(PDIR)/gendeps
$(DEP_RES_CURRENT_PKGS): $(PDIR)/gendeps
$(DEP_RES_SYNTH_PKGS) $(DEP_RES_LEGACY_PKGS): $$(@:%.dep.res=%.dep)
@print "## Skipping dependency generation for $(@F:%.dep.res=%)"
$(PKGDEBUG)$(CP) $(@:%.dep.res=%.dep) $(@)
# Post-processing of manifests after dependency resolution
RES_PKGS = $(PKGS:%=$(PDIR)/%.res)
RES_CURRENT_PKGS = $(CURRENT_MANIFESTS:%.p5m=$(PDIR)/%.res)
RES_LEGACY_PKGS = $(LEGACY_MANIFESTS:%.p5m=$(PDIR)/%.res)
RES_SYNTH_PKGS = $(SYNTH_MANIFESTS:%.p5m=$(PDIR)/%.res)
POST_TRANSFORMS = post-pkgdepend extract_metadata
$(PDIR)/%.res: $(PDIR)/%.dep.res
@print "## Post-processing manifest for $(@F:%.res=%)"
$(PKGDEBUG)if [[ -s $< ]] ; then \
$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
-O $@ -P $(@:%.res=%.synth) $< $(POST_TRANSFORMS) ; \
else \
$(CP) $< $@ ; \
fi
# Generate info for synthetic manifests
$(RES_SYNTH_PKGS): $(RES_PKGS) $$(@:%.res=%.dep.res)
@print "## Gathering package lists for synthetic package $(@F:%.res=%)"
$(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
-O $(@) -P $(@:%.res=%.synth.sed) \
$(@:%.res=%.dep.res) synthetic
$(PKGDEBUG)$(SED) -n -f $(@:%.res=%.synth.sed) $(PDIR)/*.synth >> $(@)
### pkglint checking (pre-publication)
PKGLINT = pkglint
PKGLINTRC = prepub-pkglintrc
#
# This rule runs pkglint across all manifests to be published.
#
# We require that packages be free from lint ERRORs before allowing them
# to be published. Lint WARNINGs are acceptable (though unpleasant)
# The list of packages is the list of packages that did not resolve to
# 0-byte files, $CHECK_PKGS
#
$(PDIR)/checkmf: $(PDIR)/gendeps $(DEP_SYNTH_PKGS) $(DEP_PKGS)
@print "## Checking packages"
@$(RM) $@
@$(TOUCH) $(PDIR)/pkglint-output.txt
-$(PKGDEBUG)for p in $(DEP_SYNTH_PKGS:%.dep=%) $(DEP_PKGS:%.dep=%); do \
if [[ -s $$p.res ]]; then \
CHECK_PKGS="$$p.res $${CHECK_PKGS}"; \
fi; \
done; \
if [[ -n "$${CHECK_PKGS}" ]]; then \
$(PKGLINT) -f $(PKGLINTRC) $${CHECK_PKGS} $(PROC_EXCEPTIONS) \
2> $(PDIR)/pkglint-output.txt; \
fi ; \
if grep '^ERROR' $(PDIR)/pkglint-output.txt; then \
return 1; \
fi
@$(TOUCH) $@
### Repo setup
# Default in developer builds is "xnv-devel"
# X RE cronjob build scripts override to "xnv-nightly"
PKGPUBLISHER = xnv-devel
# Initialize the empty on-disk repositories
$(PKGDEST):
@print "## Initializing $(@F)"
$(PKGDEBUG)pkgrepo create --version 4 $(@)
$(PKGDEBUG)pkgrepo add-publisher -s $(@) $(PKGPUBLISHER)
clean-repo:
$(RM) -r $(PKGDEST)
### Package publication to repo
PUB_PKGS = $(SYNTH_PKGS:%=$(PDIR)/%.pub) $(PKGS:%=$(PDIR)/%.pub)
PUB_SYNTH_PKGS = $(SYNTH_MANIFESTS:%.p5m=$(PDIR)/%.pub)
publish_pkgs: $(PKGDEST) $(PDIR)/gendeps $(PDIR)/checkmf $(PUB_PKGS)
$(PUB_PKGS): $(PKGDEST) $(PDIR)/gendeps $(PDIR)/checkmf
$(PDIR)/%.pub: $(PKGDEST) $(PDIR)/gendeps $(PDIR)/%.res
$(PKGDEBUG) if [ -s $(@:%.pub=%.res) ]; then \
print "## Publishing $(@F:%.pub=%) to proto repository"; \
pkgsend -s $(PKGDEST) publish -d $(PKGROOT) \
-d $(PROTOMETA)/$(@F:%.pub=%) \
--fmri-in-manifest --no-index --no-catalog -T '*.py' \
$(@:%.pub=%.res) > /dev/null; \
fi; \
$(TOUCH) $(@)
$(PUB_SYNTH_PKGS): $(SYNTH_LICENSES)
### Repo finalization
install: repository-metadata
default: install
repository-metadata: $(PUB_PKGS)
@print "## Creating repository metadata"
$(PKGDEBUG)pkgrepo refresh -s $(PKGDEST)
### pkglint checking (post-publication)
LINT_PKGLINTRC = postpub-pkglintrc
#
# Perform a pkglint run on the published repositories. We remove package
# version information from the lint output so that it is comparable across
# lint runs.
#
lint:
@print "## Running pkglint on the $(PKGPUBLISHER) repository"
-$(PKGDEBUG)$(PKGLINT) -f $(LINT_PKGLINTRC) \
-l file://$(PKGDEST) -c /tmp/pkglint_cache.$$$$ \
$(PKGLINT_REFERENCE_REPO:%=-r %) \
> $(PDIR)/pkglint.out 2> $(PDIR)/pkglint.lint ; \
grep '^Error:' $(PDIR)/pkglint.out ; \
$(RM) -rf /tmp/pkglint_cache.$$$$
$(PKGDEBUG)$(SED) -e 's/@[0-9TZ.:,-]*//g' $(PDIR)/pkglint.lint
### Overall rules
all: $(PROC_PKGS) $(PROC_SYNTH_PKGS) $(DEP_PKGS) $(DEP_SYNTH_PKGS) \
$(PDIR)/gendeps
clean:
-$(RM) -r $(PDIR)
clobber: clean clean-repo
.PARALLEL: $(PKGS) $(PROC_PKGS) $(DEP_PKGS) \
$(PROC_SYNTH_PKGS) $(DEP_SYNTH_PKGS) $(PUB_PKGS)
#
# rules to validate proto area against manifests, and check for safe
# file permission modes
#
EXCEPTIONS= $(PWD)/../exception_lists/packaging $(PDIR)/generated-exceptions
# Automatically exclude all pkg-config uninstalled.pc files, since those
# should never be packaged
$(PDIR)/generated-exceptions:
$(PKGDEBUG)(cd $(PKGROOT) ; find . -name '*-uninstalled.pc') > $@
protocmp: $(PROC_PKGS) $(EXCEPTIONS) $(PROC_EXCEPTIONS) fix_perms
$(PKGDEBUG)validate_pkg -a $(PKGMACH) -v $(EXCEPTIONS:%=-e %) \
-m $(PDIR) -p $(PKGROOT)
pmodes: $(PROC_PKGS) fix_perms
$(PKGDEBUG)validate_pkg -a $(PKGMACH) -M -m $(PDIR)
check-pkgfmt: $(ALL_MANIFESTS)
@print "## Checking for manifests not in pkgfmt expected form"
$(PKGDEBUG)$(PKGFMT) -c $(ALL_MANIFESTS) || true
@print ""
check: protocmp pmodes lint check-pkgfmt
# Instead of fixing all the upstream packages to follow our permission rules
# just fix the files in these subdirs of the proto area to match our rules.
FIX_PERMS_IN = /usr /lib /etc/X11 /etc/fonts /etc/hal
fix_perms:
@print "## Fixing proto area permissions"
$(PKGDEBUG)find $(FIX_PERMS_IN:%=$(PKGROOT)%) -type f -exec chmod a-w \{\} \+