ips.mk revision 12
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#
2337N/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#
59N/A# install: $(COMPONENT_SRC)/build-$(MACH32)/.installed \
59N/A# $(COMPONENT_SRC)/build-$(MACH64)/.installed
2N/A#
2N/A# This set of rules makes the "publish" target the default target for make(1)
2N/A#
2N/A
26N/APKGSEND = /usr/bin/pkgsend
26N/APKGMOGRIFY = /usr/bin/pkgmogrify
2N/APKGDEPEND = /usr/bin/pkgdepend
26N/A
2238N/A# Add some default transforms that should apply to everyone
38N/APKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/defaults
2238N/APKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/actuators
2238N/APKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/devel
2238N/APKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/docs
181N/A
26N/AMANIFEST = manifest-$(MACH)
26N/A
26N/A.DEFAULT: publish
26N/A
26N/Apublish: $(COMPONENT_SRC)/.published
26N/A
26N/ACOPYRIGHT_FILE = $(COMPONENT_NAME)-$(COMPONENT_VERSION).copyright
26N/A
700N/A$(PROTO_DIR)/$(COPYRIGHT_FILE): $(COMPONENT_COPYRIGHT)
700N/A $(CP) $< $@
26N/A
26N/A$(COMPONENT_SRC)/$(MANIFEST): install
26N/A pkgsend generate $(PROTO_DIR) >$@
1574N/A
1574N/A$(COMPONENT_SRC)/$(MANIFEST).mog: $(COMPONENT_SRC)/$(MANIFEST) $(PROTO_DIR)/$(COPYRIGHT_FILE)
26N/A echo "set name=pkg.fmri value=pkg:/$(PUBLISHER)/$(COMPONENT_NAME)@$(COMPONENT_VERSION),$(BUILD_VERSION)" >$@
1574N/A echo "set name=pkg.description value=\"$(COMPONENT_DESCRIPTION)\"" >>$@
151N/A echo "set name=pkg.name value=\"$(COMPONENT_DESCRIPTION)\"" >>$@
206N/A echo "set name=org.opensolaris.consolidation value=$(CONSOLIDATION)" >>$@
26N/A echo "license $(COPYRIGHT_FILE) license=$(COPYRIGHT_FILE)" >>$@
26N/A pkgmogrify $(PKGMOGRIFY_MACROS:%=-D %) $(PKGMOGRIFY_TRANSFORMS) $< >>$@
26N/A
26N/A$(COMPONENT_SRC)/$(MANIFEST).fdeps: $(COMPONENT_SRC)/$(MANIFEST).mog
26N/A pkgdepend generate -m $< $(PROTO_DIR) >$@
3778N/A
3778N/A$(COMPONENT_SRC)/$(MANIFEST).fdeps.res: $(COMPONENT_SRC)/$(MANIFEST).fdeps
3778N/A pkgdepend resolve -m $<
26N/A
3468N/A$(COMPONENT_SRC)/.published: $(COMPONENT_SRC)/$(MANIFEST).fdeps.res
26N/A pkgsend -s $(PKG_REPO) publish --fmri-in-manifest \
2N/A -d $(PROTO_DIR) $<
26N/A $(TOUCH) $@
26N/A