Print this page
6574 Package print/lp/ipp/ipp-listener disappears when ENABLE_IPP_PRINTING is undefined

@@ -20,10 +20,11 @@
 #
 
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 Gary Mills
 #
 
 include $(SRC)/Makefile.master
 include $(SRC)/Makefile.buildnum
 

@@ -208,35 +209,36 @@
 #
 # All packaging build products should go into $(PDIR), so they don't
 # need to be included separately in CLOBBERFILES.
 #
 CLOBBERFILES= $(PDIR) proto_list_$(PKGMACH) install-$(PKGMACH).out \
-        license-list
+        $(DYN_MANI) license-list
 
 #
 # By default, PKGS will list all manifests.  To build and/or publish a
 # subset of packages, override this on the command line or in the
 # build environment and then reference (implicitly or explicitly) the all
 # or install targets.  Using ls -1 (that's a one) or print or echo to
 # get the list of manifests is a little hackish, but avoids having a
 # 900+ line file to explicitly list them all.
 #
-# We want some manifests to optionally built based on environment
-# options, so those are excluded and optionally added back in.
-# We also want a relatively easy way to add files to the list of
-# manifests given special treatment.  Add any other special ones
-# to the SPECIAL_MANIFESTS vaiable.  It can contain wildcards in
-# regexp form, i.e. SUNW.* as one useful example.
+
 #
-SPECIAL_MANIFESTS = print-lp-ipp-ipp-listener.mf
+# Special manifests are symbolic links to real manifests with
+# either *.mf.obs or *.mf.cur names, depending on the value of
+# the ENABLE_IPP_PRINTING macro.  They are excluded from the
+# MANIFESTS macro because they may not exist when it is set,
+# but are added unconditionally on the next line.
+#
+
+SPECIAL_MANIFESTS = SUNWippl.mf print-lp-ipp-ipp-listener.mf
+DYN_MANI = $(SPECIAL_MANIFESTS:%=manifests/%)
 LIST_MANIFESTS_CMD = (cd manifests ; /usr/bin/ls -1 *.mf |\
         $(SED) $(SPECIAL_MANIFESTS:%=-e '/^%$$/d') )
 MANIFESTS = $(LIST_MANIFESTS_CMD:sh)
+MANIFESTS += $(SPECIAL_MANIFESTS)
 
-# Conditionally add back lp-ipp
-$(ENABLE_IPP_PRINTING) MANIFESTS += print-lp-ipp-ipp-listener.mf
-
 PKGS= $(MANIFESTS:%.mf=%)
 DEP_PKGS= $(PKGS:%=$(PDIR)/%.dep)
 PROC_PKGS= $(PKGS:%=$(PDIR)/%.mog)
 
 #

@@ -363,15 +365,25 @@
 #                                       | pkgdepend
 #                                       |
 #                               processed manifests
 # 
 
-ALL_TARGETS= $(PROC_SYNTH_PKGS) proto_list_$(PKGMACH)
+ALL_TARGETS= $(DYN_MANI) $(PROC_SYNTH_PKGS) proto_list_$(PKGMACH)
 
 all: $(ALL_TARGETS)
 
 #
+# Rule to create symlinks to *.mf.obs or *.mf.cur for special manifests
+# Also removes the previous special manifest
+#
+DYN_TYP = obs
+$(ENABLE_IPP_PRINTING) DYN_TYP = cur
+$(DYN_MANI): $$(@).$(DYN_TYP)
+        $(RM) $(@)
+        $(SYMLINK) $(@F).$(DYN_TYP) $(@)
+
+#
 # This will build the directory to contain the processed manifests
 # and the metadata symlinks.
 #
 $(PDIR):
         @print "Creating $(@)"