7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley#
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley# CDDL HEADER START
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley#
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley# The contents of this file are subject to the terms of the
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley# Common Development and Distribution License (the "License").
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley# You may not use this file except in compliance with the License.
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley#
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley# or http://www.opensolaris.org/os/licensing.
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley# See the License for the specific language governing permissions
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley# and limitations under the License.
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley#
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley# When distributing Covered Code, include this CDDL HEADER in each
7270737ca9bfa3c5f067e6377068aa597687d094Bob Halley# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# If applicable, add the following below this CDDL HEADER, with the
f41f183f628a148860a6d1f0070208cddd45b0c6Bob Halley# fields enclosed by brackets "[]" replaced with your own identifying
f41f183f628a148860a6d1f0070208cddd45b0c6Bob Halley# information: Portions Copyright [yyyy] [name of copyright owner]
f41f183f628a148860a6d1f0070208cddd45b0c6Bob Halley#
f41f183f628a148860a6d1f0070208cddd45b0c6Bob Halley# CDDL HEADER END
62a933c45b1c1028f45f8f720588d1ec3cfd6e54Michael Graff#
62a933c45b1c1028f45f8f720588d1ec3cfd6e54Michael Graff
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley#
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halleyinclude ../../../make-rules/shared-macros.mk
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley
378344fdcee521a2e2fd3f4a61bee15e8a6bd23eBob Halley# $(WS_MAKE_RULES)/ips.mk really isn't set up to allow you to bypass all
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# the automatic (and lengthy) manifest manipulation that it does, which we
694c897b20f06f8a5349fd9ac5df93947f6f5a2aBob Halley# really don't need to do for these static, uninteresting packages. So we just
694c897b20f06f8a5349fd9ac5df93947f6f5a2aBob Halley# write a simple set of publication rules to get the packages into the repo.
694c897b20f06f8a5349fd9ac5df93947f6f5a2aBob HalleyCOMPONENT_SRC=
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halleyinclude $(WS_MAKE_RULES)/prep.mk
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob HalleyCOMPONENT_NAME= "Package History"
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob HalleyCOMPONENT_BUGDB= gate-stuff/userland
GENERATE_HISTORY= $(WS_TOOLS)/generate-history
HISTORY= history
MANIFEST_BASE = $(BUILD_DIR)/manifest-$(MACH)
CANONICAL_MANIFESTS = $(wildcard *.p5m)
HISTORICAL_MANIFESTS = $(shell $(NAWK) -v FUNCTION=name -f $(GENERATE_HISTORY) < $(HISTORY))
ARCH_MANIFESTS = $(wildcard *.p5m.$(MACH))
GENERATED_ARCH_MANIFESTS = $(ARCH_MANIFESTS:%.p5m.$(MACH)=%.p5m)
CANONICAL_MANIFESTS += $(GENERATED_ARCH_MANIFESTS)
MOGRIFIED = $(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.mogrified)
HISTOGRIFIED = $(HISTORICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.histogrified)
PUBLISHED = $(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.published)
PUBLISHED += $(HISTORICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.published)
# Rule to generate historical manifests from the $(HISTORY) file.
define history-manifest-rule
$(MANIFEST_BASE)-$(1): $(HISTORY) $(BUILD_DIR)
$(NAWK) -v FUNCTION=manifest -v TARGET=$1 -f $(GENERATE_HISTORY) < \
$(HISTORY) > $$@
endef
$(foreach mfst,$(HISTORICAL_MANIFESTS),$(eval $(call history-manifest-rule,$(mfst))))
ASLR_MODE = $(ASLR_NOT_APPLICABLE)
PKG_MACROS = CONSOLIDATION=$(CONSOLIDATION)
PKG_MACROS += BUILD_VERSION=$(BUILD_VERSION)
PKG_MACROS += OS_VERSION=$(OS_VERSION)
PKG_OPTIONS += $(PKG_MACROS:%=-D %)
build install test system-test:
@echo "nothing to be done for $@"
$(BUILD_DIR):
$(MKDIR) $@
$(MANIFEST_BASE)-%.mogrified: %.p5m $(BUILD_DIR)
$(PKGMOGRIFY) $(PKG_OPTIONS) $< \
$(WS_TOP)/transforms/incorporate > $@
$(MANIFEST_BASE)-%.histogrified: $(MANIFEST_BASE)-%.p5m $(BUILD_DIR)
$(PKGMOGRIFY) $(PKG_OPTIONS) $< \
$(WS_TOP)/transforms/incorporate > $@
$(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.mogrified $(BUILD_DIR)
$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest --no-catalog $<
$(CP) $< $@
$(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.histogrified $(BUILD_DIR)
$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest --no-catalog $<
$(CP) $< $@
$(BUILD_DIR)/.linted-$(MACH): $(MOGRIFIED) $(HISTOGRIFIED) $(BUILD_DIR)
$(ENV) PYTHONPATH=$(WS_TOOLS)/python \
SOLARIS_VERSION=$(SOLARIS_VERSION) \
$(PKGLINT) $(CANONICAL_REPO:%=-c $(WS_LINT_CACHE)) \
-f $(WS_TOOLS)/pkglintrc $(MOGRIFIED)
$(TOUCH) $@
$(BUILD_DIR)/.published-$(MACH): $(BUILD_DIR)/.linted-$(MACH) $(PUBLISHED)
ifndef DISABLE_IPS_CATALOG_AND_INDEX_UPDATES
$(PKGREPO) refresh -s $(PKG_REPO)
endif
$(TOUCH) $@
publish: $(BUILD_DIR)/.published-$(MACH)
%.p5m: %.p5m.$(MACH)
$(CP) $< $@
clobber clean::
$(RM) -r $(BUILD_DIR) $(GENERATED_ARCH_MANIFESTS)