80 PKG_OPTIONS += -D COMPONENT_DESCRIPTION=$(COMPONENT_DESCRIPTION) |
80 PKG_OPTIONS += -D COMPONENT_DESCRIPTION=$(COMPONENT_DESCRIPTION) |
81 PKG_OPTIONS += -D COMPONENT_CLASSIFICATION=$(COMPONENT_CLASSIFICATION) |
81 PKG_OPTIONS += -D COMPONENT_CLASSIFICATION=$(COMPONENT_CLASSIFICATION) |
82 |
82 |
83 MANIFEST_BASE = $(COMPONENT_SRC)/manifest-$(MACH) |
83 MANIFEST_BASE = $(COMPONENT_SRC)/manifest-$(MACH) |
84 |
84 |
85 CANONICAL_MANIFESTS = $(wildcard *.ips) |
85 CANONICAL_MANIFESTS = $(wildcard *.p5m) |
86 GENERATED = $(MANIFEST_BASE)-generated |
86 GENERATED = $(MANIFEST_BASE)-generated |
87 COMBINED = $(MANIFEST_BASE)-combined |
87 COMBINED = $(MANIFEST_BASE)-combined |
88 MANIFESTS = $(CANONICAL_MANIFESTS:%=$(MANIFEST_BASE)-%) |
88 MANIFESTS = $(CANONICAL_MANIFESTS:%=$(MANIFEST_BASE)-%) |
89 |
89 |
90 |
90 |
91 MOGRIFIED=$(CANONICAL_MANIFESTS:%.ips=$(MANIFEST_BASE)-%.resolved) |
91 MOGRIFIED=$(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.resolved) |
92 PUBLISHED=$(MOGRIFIED:%.resolved=%.published) |
92 PUBLISHED=$(MOGRIFIED:%.resolved=%.published) |
93 |
93 |
94 COPYRIGHT_FILE = $(COMPONENT_NAME)-$(COMPONENT_VERSION).copyright |
94 COPYRIGHT_FILE = $(COMPONENT_NAME)-$(COMPONENT_VERSION).copyright |
95 ifeq ($(IPS_PKG_NAME),) |
95 ifeq ($(IPS_PKG_NAME),) |
96 IPS_PKG_NAME = $(COMPONENT_NAME) |
96 IPS_PKG_NAME = $(COMPONENT_NAME) |
101 |
101 |
102 .SECONDARY: $(GENERATED).fdeps |
102 .SECONDARY: $(GENERATED).fdeps |
103 |
103 |
104 publish: install $(COMPONENT_SRC)/.published |
104 publish: install $(COMPONENT_SRC)/.published |
105 |
105 |
106 sample-manifest: $(GENERATED).ips |
106 sample-manifest: $(GENERATED).p5m |
107 |
107 |
108 # |
108 # |
109 # Rules for generating a manifest automatically. Generated manifests will |
109 # Rules for generating a manifest automatically. Generated manifests will |
110 # contain the following: |
110 # contain the following: |
111 # copyright - template copyright information |
111 # copyright - template copyright information |
134 |
134 |
135 $(MANIFEST_BASE)-%.depend: $(MANIFEST_BASE)-%.fdeps |
135 $(MANIFEST_BASE)-%.depend: $(MANIFEST_BASE)-%.fdeps |
136 $(PKGDEPEND) resolve -o $< | sed -e '1d' >$@ |
136 $(PKGDEPEND) resolve -o $< | sed -e '1d' >$@ |
137 |
137 |
138 # generate a complete manifest from the pieces |
138 # generate a complete manifest from the pieces |
139 $(GENERATED).ips: $(GENERATED).metadata $(GENERATED).actions \ |
139 $(GENERATED).p5m: $(GENERATED).metadata $(GENERATED).actions \ |
140 $(GENERATED).depend |
140 $(GENERATED).depend |
141 cat $(COPYRIGHT_TEMPLATE) $(GENERATED).metadata $(GENERATED).actions \ |
141 cat $(COPYRIGHT_TEMPLATE) $(GENERATED).metadata $(GENERATED).actions \ |
142 $(GENERATED).depend >$@ |
142 $(GENERATED).depend >$@ |
143 |
143 |
144 # |
144 # |
146 # into the workspace. |
146 # into the workspace. |
147 # |
147 # |
148 |
148 |
149 # Combine the canonical manifest(s) for this component and "normalize" them |
149 # Combine the canonical manifest(s) for this component and "normalize" them |
150 # for comparison. |
150 # for comparison. |
151 $(COMBINED).ips: canonical-manifests |
151 $(COMBINED).p5m: canonical-manifests |
152 cat $(CANONICAL_MANIFESTS) | $(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \ |
152 cat $(CANONICAL_MANIFESTS) | $(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \ |
153 sed -e '/^$$/d' -e '/^#.*$$/d' | sort -u | $(PKGFMT) >$@ |
153 sed -e '/^$$/d' -e '/^#.*$$/d' | sort -u | $(PKGFMT) >$@ |
154 |
154 |
155 $(MANIFEST_BASE)-%.compare: $(MANIFEST_BASE)-%.ips |
155 $(MANIFEST_BASE)-%.compare: $(MANIFEST_BASE)-%.p5m |
156 $(PKGMOGRIFY) $(PKG_OPTIONS) $(COMPARISON_TRANSFORMS) $< >$@ |
156 $(PKGMOGRIFY) $(PKG_OPTIONS) $(COMPARISON_TRANSFORMS) $< >$@ |
157 |
157 |
158 manifest-compare: $(COMBINED).compare $(GENERATED).compare |
158 manifest-compare: $(COMBINED).compare $(GENERATED).compare |
159 @echo "Manifest comparison" |
159 @echo "Manifest comparison" |
160 @pkgdiff $(GENERATED).compare $(COMBINED).compare |
160 @pkgdiff $(GENERATED).compare $(COMBINED).compare |
161 |
161 |
162 # mogrify the canonical manifest(s) |
162 # mogrify the canonical manifest(s) |
163 # |
163 # |
164 $(MANIFEST_BASE)-%.resolved: %.ips manifest-compare |
164 $(MANIFEST_BASE)-%.resolved: %.p5m manifest-compare |
165 $(PKGMOGRIFY) $(PKG_OPTIONS) $< $(PUBLISH_TRANSFORMS) >$@ |
165 $(PKGMOGRIFY) $(PKG_OPTIONS) $< $(PUBLISH_TRANSFORMS) >$@ |
166 |
166 |
167 $(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.resolved |
167 $(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.resolved |
168 $(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \ |
168 $(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \ |
169 -d $(PROTO_DIR) -d . $< |
169 -d $(PROTO_DIR) -d . $< |