author | Norm Jacobs <Norm.Jacobs@Oracle.COM> |
Thu, 10 Feb 2011 19:16:15 -0800 | |
changeset 84 | b80cfd4e0a16 |
parent 76 | a084497ff237 |
child 93 | b579c7b1bb44 |
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 |
# |
|
59
7500d63edb42
7012375 userland build and proto areas should be outside of unpacked source dirs
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
53
diff
changeset
|
21 |
# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
# |
|
59
7500d63edb42
7012375 userland build and proto areas should be outside of unpacked source dirs
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
53
diff
changeset
|
32 |
# install: $(BUILD_DIR)/build/$(MACH32)/.installed \ |
7500d63edb42
7012375 userland build and proto areas should be outside of unpacked source dirs
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
53
diff
changeset
|
33 |
# $(BUILD_DIR)/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 |
38
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
42 |
PKGLINT = /usr/bin/pkglint |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
43 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
44 |
# 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
|
45 |
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
|
46 |
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
|
47 |
|
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
48 |
# order is important |
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/generate-cleanup |
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 += PUBLISHER=$(PUBLISHER) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
68 |
PKG_MACROS += CONSOLIDATION=$(CONSOLIDATION) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
69 |
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
|
70 |
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
|
71 |
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
|
72 |
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
|
73 |
PKG_MACROS += COMPONENT_ARCHIVE_URL=$(COMPONENT_ARCHIVE_URL) |
2 | 74 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
75 |
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
|
76 |
|
59
7500d63edb42
7012375 userland build and proto areas should be outside of unpacked source dirs
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
53
diff
changeset
|
77 |
MANIFEST_BASE = $(BUILD_DIR)/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
|
78 |
|
30
440b6ca0641d
Removed $(PUBLISHER) from pkg.fmri package attributes. Renamed package
Danek Duvall <danek.duvall@oracle.com>
parents:
27
diff
changeset
|
79 |
CANONICAL_MANIFESTS = $(wildcard *.p5m) |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
80 |
GENERATED = $(MANIFEST_BASE)-generated |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
81 |
COMBINED = $(MANIFEST_BASE)-combined |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
82 |
MANIFESTS = $(CANONICAL_MANIFESTS:%=$(MANIFEST_BASE)-%) |
2 | 83 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
84 |
|
30
440b6ca0641d
Removed $(PUBLISHER) from pkg.fmri package attributes. Renamed package
Danek Duvall <danek.duvall@oracle.com>
parents:
27
diff
changeset
|
85 |
MOGRIFIED=$(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.resolved) |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
86 |
PUBLISHED=$(MOGRIFIED:%.resolved=%.published) |
2 | 87 |
|
7
d42300cb8715
add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
4
diff
changeset
|
88 |
COPYRIGHT_FILE = $(COMPONENT_NAME)-$(COMPONENT_VERSION).copyright |
27
4daa72fdac4c
work around "Bug 16570 - pkgmogrify(1) drops quoting"
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
26
diff
changeset
|
89 |
ifeq ($(IPS_PKG_NAME),) |
4daa72fdac4c
work around "Bug 16570 - pkgmogrify(1) drops quoting"
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
26
diff
changeset
|
90 |
IPS_PKG_NAME = $(COMPONENT_NAME) |
4daa72fdac4c
work around "Bug 16570 - pkgmogrify(1) drops quoting"
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
26
diff
changeset
|
91 |
endif |
21
e651c453e960
forgot a couple of changes while breaking up bits
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
12
diff
changeset
|
92 |
IPS_COMPONENT_VERSION = $(COMPONENT_VERSION) |
7
d42300cb8715
add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
4
diff
changeset
|
93 |
|
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
94 |
.DEFAULT: publish |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
95 |
|
38
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
96 |
.SECONDARY: |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
97 |
|
59
7500d63edb42
7012375 userland build and proto areas should be outside of unpacked source dirs
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
53
diff
changeset
|
98 |
publish: install $(BUILD_DIR)/.published |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
99 |
|
30
440b6ca0641d
Removed $(PUBLISHER) from pkg.fmri package attributes. Renamed package
Danek Duvall <danek.duvall@oracle.com>
parents:
27
diff
changeset
|
100 |
sample-manifest: $(GENERATED).p5m |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
101 |
|
46
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
102 |
$(GENERATED).p5m: install |
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
103 |
$(PKGSEND) generate $(PKG_HARDLINKS:%=--target %) $(PROTO_DIR) | \ |
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
104 |
$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 $(GENERATE_TRANSFORMS) | \ |
64
a4b12971cf99
7014330 has userland lost its mapfile mind?
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
59
diff
changeset
|
105 |
sed -e '/^$$/d' -e '/^#.*$$/d' | $(PKGFMT) | \ |
a4b12971cf99
7014330 has userland lost its mapfile mind?
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
59
diff
changeset
|
106 |
cat $(METADATA_TEMPLATE) - >[email protected] |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
107 |
|
46
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
108 |
# copy the canonical manifest(s) to the build tree |
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
109 |
$(MANIFEST_BASE)-%.generate: %.p5m canonical-manifests |
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
110 |
cat $(METADATA_TEMPLATE) $< >[email protected] |
2 | 111 |
|
46
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
112 |
# mogrify the manifest |
53
e398cb2c4b45
7004049 SUNWa2ps should move to userland with a2ps
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
49
diff
changeset
|
113 |
$(MANIFEST_BASE)-%.mogrified: %.p5m canonical-manifests |
e398cb2c4b45
7004049 SUNWa2ps should move to userland with a2ps
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
49
diff
changeset
|
114 |
$(PKGMOGRIFY) $(PKG_OPTIONS) $< \ |
46
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
115 |
$(PUBLISH_TRANSFORMS) | \ |
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
116 |
sed -e '/^$$/d' -e '/^#.*$$/d' | uniq >[email protected] |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
117 |
|
76
a084497ff237
7016379 migrate elinks to userland (fix pkglint)
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
75
diff
changeset
|
118 |
# generate dependencies |
46
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
119 |
$(MANIFEST_BASE)-%.depend: $(MANIFEST_BASE)-%.mogrified |
53
e398cb2c4b45
7004049 SUNWa2ps should move to userland with a2ps
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
49
diff
changeset
|
120 |
$(PKGDEPEND) generate -m $< $(PROTO_DIR) >[email protected] |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
121 |
|
46
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
122 |
# resolve dependencies, prepend the mogrified manifest, less the unresolved |
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
123 |
# dependencies to the result. |
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
124 |
$(MANIFEST_BASE)-%.resolved: $(MANIFEST_BASE)-%.depend |
53
e398cb2c4b45
7004049 SUNWa2ps should move to userland with a2ps
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
49
diff
changeset
|
125 |
($(PKGMOGRIFY) $(@:%.resolved=%.mogrified) \ |
46
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
126 |
$(WS_TOP)/transforms/drop-unresolved-dependencies | \ |
53
e398cb2c4b45
7004049 SUNWa2ps should move to userland with a2ps
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
49
diff
changeset
|
127 |
sed -e '/^$$/d' -e '/^#.*$$/d' ; \ |
e398cb2c4b45
7004049 SUNWa2ps should move to userland with a2ps
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
49
diff
changeset
|
128 |
$(PKGDEPEND) resolve -o $< | sed -e '1d') | uniq >[email protected] |
2 | 129 |
|
46
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
130 |
# lint the manifest before we publish with it. |
38
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
131 |
$(MANIFEST_BASE)-%.linted: $(MANIFEST_BASE)-%.resolved |
46
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
132 |
@echo "VALIDATING MANIFEST CONTENT: $<" |
84
b80cfd4e0a16
7000952 Userland package validation needs some love
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
76
diff
changeset
|
133 |
$(ENV) PYTHONPATH=$(WS_TOOLS)/python PROTO_DIR=$(PROTO_DIR) \ |
b80cfd4e0a16
7000952 Userland package validation needs some love
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
76
diff
changeset
|
134 |
$(PKGLINT) $(CANONICAL_REPO:%=-c $(WS_LINT_CACHE)) \ |
b80cfd4e0a16
7000952 Userland package validation needs some love
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
76
diff
changeset
|
135 |
-f $(WS_TOOLS)/pkglintrc $< |
46
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
136 |
$(PKGFMT) <$< >[email protected] |
38
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
137 |
|
46
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
138 |
# published |
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
139 |
$(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.linted |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
140 |
$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \ |
48
1bb7f3eccdd6
a2ps license needs to match
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
46
diff
changeset
|
141 |
-d $(PROTO_DIR) -d $(@D) -d . $< |
46
d4d60962c33f
generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
38
diff
changeset
|
142 |
$(PKGFMT) <$< >[email protected] |
2 | 143 |
|
59
7500d63edb42
7012375 userland build and proto areas should be outside of unpacked source dirs
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
53
diff
changeset
|
144 |
$(BUILD_DIR)/.published: $(PUBLISHED) |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
145 |
$(TOUCH) [email protected] |
2 | 146 |
|
32
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
147 |
print-package-names: canonical-manifests |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
148 |
@cat $(CANONICAL_MANIFESTS) $(WS_TOP)/transforms/print-pkgs | \ |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
149 |
$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \ |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
150 |
sed -e '/^$$/d' -e '/^#.*$$/d' | sort -u |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
151 |
|
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
152 |
print-package-paths: canonical-manifests |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
153 |
@cat $(CANONICAL_MANIFESTS) $(WS_TOP)/transforms/print-paths | \ |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
154 |
$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \ |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
155 |
sed -e '/^$$/d' -e '/^#.*$$/d' | sort -u |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
156 |
|
38
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
157 |
install-packages: publish |
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
158 |
@if [ $(IS_GLOBAL_ZONE) = 0 -o x$(ROOT) != x ]; then \ |
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
159 |
cat $(CANONICAL_MANIFESTS) $(WS_TOP)/transforms/print-paths | \ |
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
160 |
$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \ |
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
161 |
sed -e '/^$$/d' -e '/^#.*$$/d' -e 's;/;;' | sort -u | \ |
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
162 |
(cd $(PROTO_DIR) ; pfexec /bin/cpio -dump $(ROOT)) ; \ |
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
163 |
else ; \ |
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
164 |
echo "unsafe to install package(s) automatically" ; \ |
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
165 |
fi |
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
166 |
|
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
167 |
$(MOGRIFIED): install |
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
168 |
|
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
169 |
canonical-manifests: $(CANONICAL_MANIFESTS) Makefile $(PATCHES) |
26
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
170 |
ifeq ($(strip $(CANONICAL_MANIFESTS)),) |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
171 |
# 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
|
172 |
# 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
|
173 |
# with |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
174 |
# $ gmake sample-manifest |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
175 |
# 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
|
176 |
# workspace. |
8a9f4e791832
packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
22
diff
changeset
|
177 |
$(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
|
178 |
endif |
32
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
179 |
|
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
180 |
# This converts required paths to containing package names for be able to |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
181 |
# properly setup the build environment for a component. |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
182 |
required-pkgs.mk: Makefile |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
183 |
@echo "generating [email protected] from Makefile REQUIRED_* data" |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
184 |
@pkg search -H -l '<$(DEPENDS:%=% OR) /bin/true>' \ |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
185 |
| sed -e 's/pkg:\/\(.*\)@.*/REQUIRED_PKGS += \1/g' >[email protected] |
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
186 |
|
38
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
187 |
pre-prep: required-pkgs.mk |
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
188 |
|
cd00ea74156e
package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
32
diff
changeset
|
189 |
|
32
280a7444e782
automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
30
diff
changeset
|
190 |
CLEAN_PATHS += required-pkgs.mk |