ips.mk revision 7
2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
2N/A# Copyright (c) 2010, Oracle and/or it's affiliates. All rights reserved.
2N/A#
2N/A
2N/A#
2N/A# Rules and Macros for generating an IPS package manifest and publishing an
2N/A# IPS package to a pkg depot.
2N/A#
2N/A# To use these rules, include ../make-rules/ips.mk in your Makefile
2N/A# and define an "install" target appropriate to building your component.
2N/A# Ex:
2N/A#
2N/A# install: $(COMPONENT_SRC)/build-32/.installed \
2N/A# $(COMPONENT_SRC)/build-64/.installed
2N/A#
2N/A# This set of rules makes the "publish" target the default target for make(1)
2N/A#
2N/A
2N/APKGSEND = /usr/bin/pkgsend
2N/APKGMOGRIFY = /usr/bin/pkgmogrify
2N/APKGDEPEND = /usr/bin/pkgdepend
2N/A
2N/A# Add some default transforms that should apply to everyone
2N/APKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/defaults
2N/APKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/actuators
4N/APKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/devel
4N/APKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/docs
2N/A
2N/A.DEFAULT: publish
2N/A
2N/Apublish: $(COMPONENT_SRC)/.published
2N/A
7N/ACOPYRIGHT_FILE = $(COMPONENT_NAME)-$(COMPONENT_VERSION).copyright
7N/A
7N/A$(PROTO_DIR)/$(COPYRIGHT_FILE): $(COMPONENT_COPYRIGHT)
7N/A $(CP) $< $@
7N/A
2N/A$(COMPONENT_SRC)/manifest: install
2N/A pkgsend generate $(PROTO_DIR) >$@
2N/A
7N/A$(COMPONENT_SRC)/manifest.mog: $(COMPONENT_SRC)/manifest $(PROTO_DIR)/$(COPYRIGHT_FILE)
2N/A echo "set name=pkg.fmri value=pkg:/$(PUBLISHER)/$(COMPONENT_NAME)@$(COMPONENT_VERSION),$(BUILD_VERSION)" >$@
2N/A echo "set name=pkg.description value=\"$(COMPONENT_DESCRIPTION)\"" >>$@
2N/A echo "set name=pkg.name value=\"$(COMPONENT_DESCRIPTION)\"" >>$@
2N/A echo "set name=org.opensolaris.consolidation value=$(CONSOLIDATION)" >>$@
7N/A echo "license $(COPYRIGHT_FILE) license=$(COPYRIGHT_FILE)" >>$@
2N/A pkgmogrify $(PKGMOGRIFY_MACROS:%=-D %) $(PKGMOGRIFY_TRANSFORMS) $< >>$@
2N/A
2N/A$(COMPONENT_SRC)/manifest.fdeps: $(COMPONENT_SRC)/manifest.mog
2N/A pkgdepend generate -m $< $(PROTO_DIR) >$@
2N/A
2N/A$(COMPONENT_SRC)/manifest.fdeps.res: $(COMPONENT_SRC)/manifest.fdeps
2N/A pkgdepend resolve -m $<
2N/A
2N/A$(COMPONENT_SRC)/.published: $(COMPONENT_SRC)/manifest.fdeps.res
2N/A pkgsend -s $(PKG_REPO) publish --fmri-in-manifest \
2N/A -d $(PROTO_DIR) $<
2N/A $(TOUCH) $@