From 4158c02ccf09e2f646cf2e9e5599f186ec8c7302 Mon Sep 17 00:00:00 2001
From: Norm Jacobs <Norm.Jacobs@Oracle.COM>
Date: Wed, 13 Apr 2011 18:58:06 +0200
Subject: [PATCH] 7003927 userland should postprocess packaged files 7034188 userland should have common lint library rules 7034992 userland packages should include opensolaris.arc_url data 7019309 move ghostscript to userland (fix build)

---
 make-rules/ips.mk |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/make-rules/ips.mk b/make-rules/ips.mk
index 4c1abdd..551d555 100644
--- a/make-rules/ips.mk
+++ b/make-rules/ips.mk
@@ -40,6 +40,7 @@
 PKGMOGRIFY =	/usr/bin/pkgmogrify
 PKGSEND =	/usr/bin/pkgsend
 PKGLINT =	/usr/bin/pkglint
+PKGMANGLE =	$(WS_TOOLS)/userland-mangler
 
 # Package headers should all pretty much follow the same format
 METADATA_TEMPLATE =		$(WS_TOP)/transforms/manifest-metadata-template
@@ -64,7 +65,6 @@
 PKG_MACROS +=		MACH=$(MACH)
 PKG_MACROS +=		MACH32=$(MACH32)
 PKG_MACROS +=		MACH64=$(MACH64)
-PKG_MACROS +=		IPS_PKG_NAME=$(IPS_PKG_NAME)
 PKG_MACROS +=		PUBLISHER=$(PUBLISHER)
 PKG_MACROS +=		CONSOLIDATION=$(CONSOLIDATION)
 PKG_MACROS +=		BUILD_VERSION=$(BUILD_VERSION)
@@ -77,7 +77,9 @@
 
 PKG_OPTIONS +=		$(PKG_MACROS:%=-D %)
 
-PKG_PROTO_DIRS += $(PROTO_DIR) $(@D) $(COMPONENT_DIR) $(COMPONENT_SRC)
+MANGLED_DIR =	$(PROTO_DIR)/mangled
+
+PKG_PROTO_DIRS += $(MANGLED_DIR) $(PROTO_DIR) $(@D) $(COMPONENT_DIR) $(COMPONENT_SRC)
 
 MANIFEST_BASE =		$(BUILD_DIR)/manifest-$(MACH)
 
@@ -117,9 +119,17 @@
 		$(PUBLISH_TRANSFORMS) | \
 		sed -e '/^$$/d' -e '/^#.*$$/d' | uniq >$@
 
+# mangle the file contents
+$(MANGLED_DIR):
+	$(MKDIR) $@
+
+PKGMANGLE_OPTIONS = -D $(MANGLED_DIR) $(PKG_PROTO_DIRS:%=-d %)
+$(MANIFEST_BASE)-%.mangled:	$(MANIFEST_BASE)-%.mogrified $(MANGLED_DIR)
+	$(PKGMANGLE) $(PKGMANGLE_OPTIONS) -m $< >$@
+
 # generate dependencies
 PKGDEPEND_GENERATE_OPTIONS = -m $(PKG_PROTO_DIRS:%=-d %)
-$(MANIFEST_BASE)-%.depend:	$(MANIFEST_BASE)-%.mogrified
+$(MANIFEST_BASE)-%.depend:	$(MANIFEST_BASE)-%.mangled
 	$(PKGDEPEND) generate $(PKGDEPEND_GENERATE_OPTIONS) $< >$@
 
 # resolve dependencies, prepend the mogrified manifest, less the unresolved

--
Gitblit v1.9.3