145N/A#
145N/A# CDDL HEADER START
145N/A#
145N/A# The contents of this file are subject to the terms of the
145N/A# Common Development and Distribution License (the "License").
145N/A# You may not use this file except in compliance with the License.
145N/A#
145N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
145N/A# or http://www.opensolaris.org/os/licensing.
145N/A# See the License for the specific language governing permissions
145N/A# and limitations under the License.
145N/A#
145N/A# When distributing Covered Code, include this CDDL HEADER in each
145N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
145N/A# If applicable, add the following below this CDDL HEADER, with the
145N/A# fields enclosed by brackets "[]" replaced with your own identifying
145N/A# information: Portions Copyright [yyyy] [name of copyright owner]
145N/A#
145N/A# CDDL HEADER END
145N/A#
5630N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
145N/A#
145N/A
145N/Ainclude ../../../make-rules/shared-macros.mk
187N/A
3996N/A# $(WS_MAKE_RULES)/ips.mk really isn't set up to allow you to bypass all
187N/A# the automatic (and lengthy) manifest manipulation that it does, which we
187N/A# really don't need to do for these static, uninteresting packages. So we just
187N/A# write a simple set of publication rules to get the packages into the repo.
145N/A
187N/APKGSEND = /usr/bin/pkgsend
187N/APKGLINT = /usr/bin/pkglint
187N/APKGMOGRIFY = /usr/bin/pkgmogrify
145N/A
1273N/ACOMPONENT_NAME= "Package History"
1273N/ACOMPONENT_BUGDB= gate-stuff/userland
1273N/A
5630N/AGENERATE_HISTORY= $(WS_TOOLS)/generate-history
5630N/AHISTORY= history
5630N/A
5630N/AMANIFEST_BASE = $(BUILD_DIR)/manifest-$(MACH)
5630N/A
187N/ACANONICAL_MANIFESTS = $(wildcard *.p5m)
7034N/AHISTORICAL_MANIFESTS = $(shell $(NAWK) -v FUNCTION=name -v MACH=$(MACH) -f $(GENERATE_HISTORY) < $(HISTORY))
197N/AARCH_MANIFESTS = $(wildcard *.p5m.$(MACH))
197N/AGENERATED_ARCH_MANIFESTS = $(ARCH_MANIFESTS:%.p5m.$(MACH)=%.p5m)
197N/ACANONICAL_MANIFESTS += $(GENERATED_ARCH_MANIFESTS)
197N/A
187N/AMOGRIFIED = $(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.mogrified)
5630N/AHISTOGRIFIED = $(HISTORICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.histogrified)
187N/APUBLISHED = $(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.published)
5630N/APUBLISHED += $(HISTORICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.published)
5630N/A
5630N/A# Rule to generate historical manifests from the $(HISTORY) file.
5630N/Adefine history-manifest-rule
5630N/A$(MANIFEST_BASE)-$(1): $(HISTORY) $(BUILD_DIR)
7034N/A $(NAWK) -v FUNCTION=manifest -v MACH=$(MACH) -v TARGET=$1 -f $(GENERATE_HISTORY) < \
5630N/A $(HISTORY) > $$@
5630N/Aendef
5630N/A$(foreach mfst,$(HISTORICAL_MANIFESTS),$(eval $(call history-manifest-rule,$(mfst))))
145N/A
4409N/APKG_MACROS = CONSOLIDATION=$(CONSOLIDATION)
4409N/APKG_MACROS += BUILD_VERSION=$(BUILD_VERSION)
4409N/APKG_MACROS += OS_VERSION=$(OS_VERSION)
4409N/A
4409N/APKG_OPTIONS += $(PKG_MACROS:%=-D %)
4409N/A
192N/Adownload prep build install:
192N/A @echo "nothing to be done for $@"
192N/A
145N/A$(BUILD_DIR):
145N/A $(MKDIR) $@
145N/A
187N/A$(MANIFEST_BASE)-%.mogrified: %.p5m $(BUILD_DIR)
4409N/A $(PKGMOGRIFY) $(PKG_OPTIONS) $< \
3468N/A $(WS_TOP)/transforms/incorporate > $@
187N/A
5630N/A$(MANIFEST_BASE)-%.histogrified: $(MANIFEST_BASE)-%.p5m $(BUILD_DIR)
5630N/A $(PKGMOGRIFY) $(PKG_OPTIONS) $< \
5630N/A $(WS_TOP)/transforms/incorporate > $@
5630N/A
187N/A$(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.mogrified $(BUILD_DIR)
1900N/A $(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest --no-catalog $<
191N/A $(CP) $< $@
145N/A
5630N/A$(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.histogrified $(BUILD_DIR)
5630N/A $(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest --no-catalog $<
5630N/A $(CP) $< $@
5630N/A
5630N/A$(BUILD_DIR)/.linted-$(MACH): $(MOGRIFIED) $(HISTOGRIFIED) $(BUILD_DIR)
187N/A $(ENV) PYTHONPATH=$(WS_TOOLS)/python \
2541N/A SOLARIS_VERSION=$(SOLARIS_VERSION) \
187N/A $(PKGLINT) $(CANONICAL_REPO:%=-c $(WS_LINT_CACHE)) \
187N/A -f $(WS_TOOLS)/pkglintrc $(MOGRIFIED)
187N/A $(TOUCH) $@
187N/A
187N/A$(BUILD_DIR)/.published-$(MACH): $(BUILD_DIR)/.linted-$(MACH) $(PUBLISHED)
1900N/Aifndef DISABLE_IPS_CATALOG_AND_INDEX_UPDATES
1900N/A $(PKGREPO) refresh -s $(PKG_REPO)
1900N/Aendif
187N/A $(TOUCH) $@
187N/A
187N/Apublish: $(BUILD_DIR)/.published-$(MACH)
145N/A
197N/A%.p5m: %.p5m.$(MACH)
197N/A $(CP) $< $@
197N/A
145N/Aclobber clean:
197N/A $(RM) -r $(BUILD_DIR) $(GENERATED_ARCH_MANIFESTS)