author Norm Jacobs <Norm.Jacobs@Sun.COM>
Wed, 19 May 2010 00:08:03 -0500
changeset 12 41aeb1fd8c2d
parent 7 d42300cb8715
child 21 e651c453e960
permissions -rw-r--r--
Fix MACH32/MACH64 so more than one architecture can build in the same workspace
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or
# See the License for the specific language governing permissions
# and limitations under the License.
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
# Copyright (c) 2010, Oracle and/or it's affiliates.  All rights reserved.

# Rules and Macros for generating an IPS package manifest and publishing an
# IPS package to a pkg depot.
# To use these rules, include ../make-rules/ in your Makefile
# and define an "install" target appropriate to building your component.
# Ex:
#	install:	$(COMPONENT_SRC)/build-$(MACH32)/.installed \
#	 		$(COMPONENT_SRC)/build-$(MACH64)/.installed
# This set of rules makes the "publish" target the default target for make(1)

PKGSEND =	/usr/bin/pkgsend
PKGMOGRIFY =	/usr/bin/pkgmogrify
PKGDEPEND =	/usr/bin/pkgdepend

# Add some default transforms that should apply to everyone
PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/defaults
PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/actuators
PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/devel
PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/docs

MANIFEST =	manifest-$(MACH)

.DEFAULT:	publish

publish:	$(COMPONENT_SRC)/.published


	$(CP) $< [email protected]

	pkgsend generate $(PROTO_DIR) >[email protected]

	echo "set name=pkg.fmri value=pkg:/$(PUBLISHER)/$(COMPONENT_NAME)@$(COMPONENT_VERSION),$(BUILD_VERSION)" >[email protected]
	echo "set name=pkg.description value=\"$(COMPONENT_DESCRIPTION)\"" >>[email protected]
	echo "set value=\"$(COMPONENT_DESCRIPTION)\"" >>[email protected]
	echo "set name=org.opensolaris.consolidation value=$(CONSOLIDATION)" >>[email protected]
	echo "license $(COPYRIGHT_FILE) license=$(COPYRIGHT_FILE)" >>[email protected]
	pkgmogrify $(PKGMOGRIFY_MACROS:%=-D %) $(PKGMOGRIFY_TRANSFORMS) $< >>[email protected]

	pkgdepend generate -m $< $(PROTO_DIR) >[email protected]

	pkgdepend resolve -m $<

$(COMPONENT_SRC)/.published:	$(COMPONENT_SRC)/$(MANIFEST).fdeps.res
	pkgsend -s $(PKG_REPO) publish --fmri-in-manifest \
		-d $(PROTO_DIR) $<
	$(TOUCH) [email protected]