author | Norm Jacobs <Norm.Jacobs@Sun.COM> |
Fri, 16 Jul 2010 00:58:56 -0500 | |
changeset 26 | 8a9f4e791832 |
parent 22 | b89eb90ac9c5 |
child 27 | 4daa72fdac4c |
permissions | -rw-r--r-- |
2 | 1 |
# |
2 |
# CDDL HEADER START |
|
3 |
# |
|
4 |
# The contents of this file are subject to the terms of the |
|
5 |
# Common Development and Distribution License (the "License"). |
|
6 |
# You may not use this file except in compliance with the License. |
|
7 |
# |
|
8 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
# or http://www.opensolaris.org/os/licensing. |
|
10 |
# See the License for the specific language governing permissions |
|
11 |
# and limitations under the License. |
|
12 |
# |
|
13 |
# When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
# If applicable, add the following below this CDDL HEADER, with the |
|
16 |
# fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
# |
|
19 |
# CDDL HEADER END |
|
20 |
# |
|
21 |
# Copyright (c) 2010, Oracle and/or it's affiliates. All rights reserved. |
|
22 |
# |
|
23 |
||
24 |
# |
|
25 |
# Rules and Macros for generating an IPS package manifest and publishing an |
|
26 |
# IPS package to a pkg depot. |
|
27 |
# |
|
28 |
# To use these rules, include ../make-rules/ips.mk in your Makefile |
|
29 |
# and define an "install" target appropriate to building your component. |
|
30 |
# Ex: |
|
31 |
# |
|
12
41aeb1fd8c2d
Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
7
diff
changeset
|
32 |
# install: $(COMPONENT_SRC)/build-$(MACH32)/.installed \ |
41aeb1fd8c2d
Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
7
diff
changeset
|
33 |
# $(COMPONENT_SRC)/build-$(MACH64)/.installed |
2 | 34 |
# |
35 |
# This set of rules makes the "publish" target the default target for make(1) |
|
36 |
# |
|
37 |
||
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
38 |
PKGDEPEND = /usr/bin/pkgdepend |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
39 |
PKGFMT = /usr/bin/pkgfmt |
2 | 40 |
PKGMOGRIFY = /usr/bin/pkgmogrify |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
41 |
PKGSEND = /usr/bin/pkgsend |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
42 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
43 |
# Package headers should all pretty much follow the same format |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
44 |
METADATA_TEMPLATE = $(WS_TOP)/transforms/manifest-metadata-template |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
45 |
COPYRIGHT_TEMPLATE = $(WS_TOP)/transforms/copyright-template |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
46 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
47 |
# order is important |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
48 |
GENERATE_TRANSFORMS += $(WS_TOP)/transforms/generate-cleanup |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
49 |
GENERATE_TRANSFORMS += $(WS_TOP)/transforms/variant.arch |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
50 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
51 |
COMPARISON_TRANSFORMS += $(WS_TOP)/transforms/comparison-cleanup |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
52 |
COMPARISON_TRANSFORMS += $(PKGMOGRIFY_TRANSFORMS) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
53 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
54 |
# order is important |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
55 |
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/defaults |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
56 |
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/actuators |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
57 |
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/devel |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
58 |
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/docs |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
59 |
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/locale |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
60 |
PUBLISH_TRANSFORMS += $(PKGMOGRIFY_TRANSFORMS) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
61 |
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/publish-cleanup |
2 | 62 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
63 |
PKG_MACROS += MACH=$(MACH) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
64 |
PKG_MACROS += ARCH=$(MACH) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
65 |
PKG_MACROS += MACH32=$(MACH32) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
66 |
PKG_MACROS += MACH64=$(MACH64) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
67 |
PKG_MACROS += IPS_PKG_NAME=$(IPS_PKG_NAME) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
68 |
PKG_MACROS += PUBLISHER=$(PUBLISHER) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
69 |
PKG_MACROS += CONSOLIDATION=$(CONSOLIDATION) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
70 |
PKG_MACROS += BUILD_VERSION=$(BUILD_VERSION) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
71 |
PKG_MACROS += SOLARIS_VERSION=$(SOLARIS_VERSION) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
72 |
PKG_MACROS += OS_VERSION=$(OS_VERSION) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
73 |
PKG_MACROS += IPS_COMPONENT_VERSION=$(IPS_COMPONENT_VERSION) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
74 |
PKG_MACROS += COMPONENT_PROJECT_URL=$(COMPONENT_PROJECT_URL) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
75 |
PKG_MACROS += COMPONENT_ARCHIVE_URL=$(COMPONENT_ARCHIVE_URL) |
2 | 76 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
77 |
PKG_OPTIONS += $(PKG_MACROS:%=-D %) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
78 |
# multi-word macros get broken up, so we handle them "specially" |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
79 |
PKG_OPTIONS += -D COMPONENT_SUMMARY=\"$(COMPONENT_SUMMARY)\" |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
80 |
PKG_OPTIONS += -D COMPONENT_DESCRIPTION=\"$(COMPONENT_DESCRIPTION)\" |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
81 |
PKG_OPTIONS += -D COMPONENT_CLASSIFICATION=\"$(COMPONENT_CLASSIFICATION)\" |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
82 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
83 |
MANIFEST_BASE = $(COMPONENT_SRC)/manifest-$(MACH) |
12
41aeb1fd8c2d
Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
7
diff
changeset
|
84 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
85 |
CANONICAL_MANIFESTS = $(wildcard *.ips) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
86 |
GENERATED = $(MANIFEST_BASE)-generated |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
87 |
COMBINED = $(MANIFEST_BASE)-combined |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
88 |
MANIFESTS = $(CANONICAL_MANIFESTS:%=$(MANIFEST_BASE)-%) |
2 | 89 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
90 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
91 |
MOGRIFIED=$(CANONICAL_MANIFESTS:%.ips=$(MANIFEST_BASE)-%.resolved) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
92 |
PUBLISHED=$(MOGRIFIED:%.resolved=%.published) |
2 | 93 |
|
7
d42300cb8715
add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
4
diff
changeset
|
94 |
COPYRIGHT_FILE = $(COMPONENT_NAME)-$(COMPONENT_VERSION).copyright |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
95 |
IPS_PKG_NAME = $(COMPONENT_NAME) |
21
e651c453e960
forgot a couple of changes while breaking up bits
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
12
diff
changeset
|
96 |
IPS_COMPONENT_VERSION = $(COMPONENT_VERSION) |
7
d42300cb8715
add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
4
diff
changeset
|
97 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
98 |
.DEFAULT: publish |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
99 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
100 |
.SECONDARY: $(GENERATED).fdeps |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
101 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
102 |
publish: install $(COMPONENT_SRC)/.published |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
103 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
104 |
sample-manifest: $(GENERATED).ips |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
105 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
106 |
# |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
107 |
# Rules for generating a manifest automatically. Generated manifests will |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
108 |
# contain the following: |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
109 |
# copyright - template copyright information |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
110 |
# metadata - mogrified template metadata |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
111 |
# actions - "normalized" actions for the paths to be installed. |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
112 |
# depends - automatically generated dependencies |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
113 |
# |
7
d42300cb8715
add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
4
diff
changeset
|
114 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
115 |
# transform template metadata into slightly more package specific metadata. |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
116 |
$(GENERATED).metadata: $(METADATA_TEMPLATE) install |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
117 |
$(PKGMOGRIFY) -D IPS_PKG_NAME=$(IPS_PKG_NAME) $< | \ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
118 |
sed -e '/^$$/d' -e '/^#.*$$/d' | $(PKGFMT) >$@ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
119 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
120 |
# generate actions from the proto dir |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
121 |
$(GENERATED).generate: install |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
122 |
$(PKGSEND) generate $(PKG_HARDLINKS:%=--target %) $(PROTO_DIR) >$@ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
123 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
124 |
# convert actions to a "normalized" format |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
125 |
$(GENERATED).actions: $(GENERATED).generate |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
126 |
$(PKGMOGRIFY) $(PKG_OPTIONS) $< $(GENERATE_TRANSFORMS) | \ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
127 |
sed -e '/^$$/d' -e '/^#.*$$/d' | $(PKGFMT) >$@ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
128 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
129 |
# generate dependencies |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
130 |
$(MANIFEST_BASE)-%.fdeps: $(MANIFEST_BASE)-%.generate |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
131 |
$(PKGDEPEND) generate $(PKG_OPTIONS) $< $(PROTO_DIR) >$@ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
132 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
133 |
$(MANIFEST_BASE)-%.depend: $(MANIFEST_BASE)-%.fdeps |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
134 |
$(PKGDEPEND) resolve -o $< | sed -e '1d' >$@ |
2 | 135 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
136 |
# generate a complete manifest from the pieces |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
137 |
$(GENERATED).ips: $(GENERATED).metadata $(GENERATED).actions \ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
138 |
$(GENERATED).depend |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
139 |
cat $(COPYRIGHT_TEMPLATE) $(GENERATED).metadata $(GENERATED).actions \ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
140 |
$(GENERATED).depend >$@ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
141 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
142 |
# |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
143 |
# Rules to generate a combined manifest from the canonical manifest(s) checked |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
144 |
# into the workspace. |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
145 |
# |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
146 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
147 |
# Combine the canonical manifest(s) for this component and "normalize" them |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
148 |
# for comparison. |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
149 |
$(COMBINED).ips: canonical-manifests |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
150 |
cat $(CANONICAL_MANIFESTS) | $(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
151 |
sed -e '/^$$/d' -e '/^#.*$$/d' | sort -u | $(PKGFMT) >$@ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
152 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
153 |
$(MANIFEST_BASE)-%.compare: $(MANIFEST_BASE)-%.ips |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
154 |
$(PKGMOGRIFY) $(PKG_OPTIONS) $(COMPARISON_TRANSFORMS) $< >$@ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
155 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
156 |
manifest-compare: $(COMBINED).compare $(GENERATED).compare |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
157 |
@echo "Manifest comparison" |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
158 |
@pkgdiff $(GENERATED).compare $(COMBINED).compare |
2 | 159 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
160 |
# mogrify the canonical manifest(s) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
161 |
# |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
162 |
$(MANIFEST_BASE)-%.resolved: %.ips manifest-compare |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
163 |
$(PKGMOGRIFY) $(PKG_OPTIONS) $< $(PUBLISH_TRANSFORMS) >$@ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
164 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
165 |
$(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.resolved |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
166 |
$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \ |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
167 |
-d $(PROTO_DIR) -d . $< |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
168 |
$(TOUCH) $@ |
2 | 169 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
170 |
$(COMPONENT_SRC)/.published: manifest-compare $(PUBLISHED) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
171 |
$(TOUCH) $@ |
2 | 172 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
173 |
canonical-manifests: $(CANONICAL_MANIFESTS) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
174 |
ifeq ($(strip $(CANONICAL_MANIFESTS)),) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
175 |
# If there were no canonical manifests in the workspace, nothing will |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
176 |
# be published and we should fail. A sample manifest can be generated |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
177 |
# with |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
178 |
# $ gmake sample-manifest |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
179 |
# Once created, it will need to be reviewed, edited, and added to the |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
180 |
# workspace. |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
181 |
$(error Missing canonical manifest(s)) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
182 |
endif |