make-rules/ips.mk
author David Hollister <david.hollister@oracle.com>
Wed, 12 Oct 2016 14:01:13 -0600
changeset 7094 61352b4e5af5
parent 7049 e8d705cba87d
child 7829 2de4f4ace09c
permissions -rw-r--r--
24797203 OpenStack RBAC profiles allow reading too many files 24797238 keystone RBAC and SMF should point at Apache log files 24797256 cinder RBAC and SMF should point at Apache log files 24830959 horizon RBAC and SMF should point at Apache log files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     1
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     2
# CDDL HEADER START
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     3
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     7
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    11
# and limitations under the License.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    12
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    18
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    19
# CDDL HEADER END
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    20
#
1890
5a4ef66c42bf 16808434 Many components probably don't need a PATH line in their Makefiles
david.comay@oracle.com
parents: 1756
diff changeset
    21
5a4ef66c42bf 16808434 Many components probably don't need a PATH line in their Makefiles
david.comay@oracle.com
parents: 1756
diff changeset
    22
#
5339
cf0e8b40a0d4 21480408 sample-manifest COMPONENT_VERSION transforms cause erroneous results (fix build)
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
    23
# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    24
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    25
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    26
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    27
# Rules and Macros for generating an IPS package manifest and publishing an
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    28
# IPS package to a pkg depot.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    29
#
3817
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
    30
# To use these rules, include $(WS_MAKE_RULES)/ips.mk in your Makefile
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    31
# and define an "install" target appropriate to building your component.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    32
# Ex:
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    33
#
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
    34
#	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
    35
#	 		$(BUILD_DIR)/build/$(MACH64)/.installed
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    36
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    37
# This set of rules makes the "publish" target the default target for make(1)
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    38
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    39
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    40
PKGDEPEND =	/usr/bin/pkgdepend
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    41
PKGFMT =	/usr/bin/pkgfmt
181
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
    42
PKGMANGLE =	$(WS_TOOLS)/userland-mangler
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    43
4813
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
    44
GENERATE_HISTORY= $(WS_TOOLS)/generate-history
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
    45
HISTORY=	history
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
    46
3739
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
    47
# pkgfmt has an odd behavior at present where -c means "check validity
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
    48
# against any format" whereas -d means "diffs against latest format" and
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
    49
# no arguments means "update to latest format".  Thus, 'pkgfmt -c' can
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
    50
# run clean on a v1 manifest that actually needs to be updated.  So we
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
    51
# use the explicit format version argument below.  If this behavior is
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
    52
# changed, then the -f argument below can be dropped.
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
    53
PKGFMT_CHECK_ARGS =	-c -fv2
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
    54
3817
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
    55
WS_TRANSFORMS =	$(WS_TOP)/transforms
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
    56
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    57
# 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
    58
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
    59
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
    60
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    61
# order is important
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    62
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
    63
683
c613b3449c36 7079363 gcc-3.p5m package manifest file shouldn't deliver .la files
Rich Burridge <rich.burridge@oracle.com>
parents: 582
diff changeset
    64
PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/libtool-drop
c613b3449c36 7079363 gcc-3.p5m package manifest file shouldn't deliver .la files
Rich Burridge <rich.burridge@oracle.com>
parents: 582
diff changeset
    65
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    66
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
    67
COMPARISON_TRANSFORMS +=	$(PKGMOGRIFY_TRANSFORMS)
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    68
1205
6c6c27bcf9ac 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 1188
diff changeset
    69
LICENSE_TRANSFORMS =		$(WS_TOP)/transforms/license-changes
6c6c27bcf9ac 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 1188
diff changeset
    70
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    71
# order is important
1205
6c6c27bcf9ac 16431724 Adjust how license text and Oracle internal tracking numbers are propagated
Rich Burridge <rich.burridge@oracle.com>
parents: 1188
diff changeset
    72
PUBLISH_TRANSFORMS +=	$(LICENSE_TRANSFORMS)
151
f9e42a3f7095 7030982 hgk is delivered 444, breaks 'hg view'
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 145
diff changeset
    73
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/variant-cleanup
206
a4474882bf60 7010355 python needs to be packaged to separate out non-core dependencies
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 197
diff changeset
    74
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/autopyc
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    75
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
    76
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/actuators
6609
489da5c0d3c5 24429749 improve gnome3 settings dependency tracking
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 5751
diff changeset
    77
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/depends
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    78
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
    79
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
    80
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/locale
3998
5bd484384122 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents: 3817
diff changeset
    81
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/standard-python-libraries
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 1890
diff changeset
    82
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/python-rename
1913
bf893655bc39 15819724 SUNBT7202228 python 3.4 (drop nonexistent group dependencies)
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    83
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/python-3-groups
2060
a9ad5cd0ec29 19492342 Python 3.4 should be built --with-pymalloc
John Beck <John.Beck@Oracle.COM>
parents: 2054
diff changeset
    84
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/python-3-soabi
3998
5bd484384122 PSARC 2015/110 OpenStack service updates for Juno
Danek Duvall <danek.duvall@oracle.com>
parents: 3817
diff changeset
    85
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/python-3-no-32bit
5747
4441137c3e4a 22853886 ruby/gem specs and tests should be faceted out via default transforms
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5661
diff changeset
    86
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/ruby-tests
4441137c3e4a 22853886 ruby/gem specs and tests should be faceted out via default transforms
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5661
diff changeset
    87
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/puppet
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    88
PUBLISH_TRANSFORMS +=	$(PKGMOGRIFY_TRANSFORMS)
2142
813e4817e573 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2060
diff changeset
    89
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/incorporate
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
    90
PUBLISH_TRANSFORMS +=	$(WS_TOP)/transforms/publish-cleanup
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    91
4749
a34fb58473e0 21344772 updates for evaluation packages
John Beck <John.Beck@Oracle.COM>
parents: 4520
diff changeset
    92
# If we are building "evaluation" packages, add the evaluation information
4439
94148b6e4407 20853169 build should support pre-release requirements
John Beck <John.Beck@Oracle.COM>
parents: 4355
diff changeset
    93
# action so that the package(s) display the terms and require acceptance
94148b6e4407 20853169 build should support pre-release requirements
John Beck <John.Beck@Oracle.COM>
parents: 4355
diff changeset
    94
# to install.
4490
5a5296580120 21249474 s/pre-release/evaluation/g + other tweaks
John Beck <John.Beck@Oracle.COM>
parents: 4439
diff changeset
    95
ifeq ($(BUILD_TYPE),evaluation)
5a5296580120 21249474 s/pre-release/evaluation/g + other tweaks
John Beck <John.Beck@Oracle.COM>
parents: 4439
diff changeset
    96
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/evaluation
4439
94148b6e4407 20853169 build should support pre-release requirements
John Beck <John.Beck@Oracle.COM>
parents: 4355
diff changeset
    97
endif
94148b6e4407 20853169 build should support pre-release requirements
John Beck <John.Beck@Oracle.COM>
parents: 4355
diff changeset
    98
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
    99
# For items defined as variables or that may contain whitespace, add
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   100
# them to a list to be expanded into PKG_OPTIONS later.
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   101
PKG_VARS += ARC_CASE TPNO
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   102
PKG_VARS += BUILD_VERSION OS_VERSION SOLARIS_VERSION PKG_SOLARIS_VERSION
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   103
PKG_VARS += CONSOLIDATION CONSOLIDATION_CHANGESET CONSOLIDATION_REPOSITORY_URL
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   104
PKG_VARS += COMPONENT_VERSION IPS_COMPONENT_VERSION HUMAN_VERSION
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   105
PKG_VARS += COMPONENT_ARCHIVE_URL COMPONENT_PROJECT_URL COMPONENT_NAME
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   106
PKG_VARS += HG_REPO HG_REV HG_URL
7049
e8d705cba87d 24676533 vim 8.0.0016
Danek Duvall <danek.duvall@oracle.com>
parents: 6991
diff changeset
   107
PKG_VARS += GIT_COMMIT_ID GIT_REPO GIT_TAG
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   108
PKG_VARS += MACH MACH32 MACH64
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   109
PKG_VARS += PUBLISHER PUBLISHER_LOCALIZABLE
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   110
PKG_VARS += SOLARIS_11_ONLY SOLARIS_12_ONLY
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   111
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   112
# Include TPNO_* Makefile variables in PKG_VARS.
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   113
$(foreach macro, $(filter TPNO_%, $(.VARIABLES)), \
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   114
    $(eval PKG_VARS += $(macro)) \
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   115
)
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   116
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   117
# For items that need special definition, add them to PKG_MACROS.
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   118
# IPS_COMPONENT_VERSION suitable for use in regular expressions.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   119
PKG_MACROS +=		IPS_COMPONENT_RE_VERSION=$(subst .,\\.,$(IPS_COMPONENT_VERSION))
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   120
# COMPONENT_VERSION suitable for use in regular expressions.
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   121
PKG_MACROS +=		COMPONENT_RE_VERSION=$(subst .,\\.,$(COMPONENT_VERSION))
5351
3cf5399d1ed8 21480408 sample-manifest COMPONENT_VERSION transforms cause erroneous results (fix tpnos)
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5339
diff changeset
   122
1609
87293f3666a2 17599591 The Python tox module needs to be added to Userland (fix build)
Rich Burridge <rich.burridge@oracle.com>
parents: 1432
diff changeset
   123
PKG_MACROS +=		PYTHON_2.7_ONLY=\#
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 1890
diff changeset
   124
PKG_MACROS +=		PYTHON_3.4_ONLY=\#
4912
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents: 4813
diff changeset
   125
PKG_MACROS +=		PYTHON_3.5_ONLY=\#
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   126
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   127
# Convenience macros for quoting in manifests; necessary because pkgfmt will
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   128
# drop literal quotes in attribute values if they do not contain whitespace
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   129
# since the action parsing in pkg will drop them during action stringification.
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   130
PKG_MACROS +=		SQ=\'
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   131
PKG_MACROS +=		DQ=\"
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   132
PKG_MACROS +=		Q=\"
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   133
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   134
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
   135
181
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
   136
MANGLED_DIR =	$(PROTO_DIR)/mangled
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
   137
4355
918f15f3f728 21137686 grails & unrar Makefiles break when PKG_PROTO_DIRS is extended
John Beck <John.Beck@Oracle.COM>
parents: 4196
diff changeset
   138
# We use += below so anyone wishing to put other directories at the beginning
918f15f3f728 21137686 grails & unrar Makefiles break when PKG_PROTO_DIRS is extended
John Beck <John.Beck@Oracle.COM>
parents: 4196
diff changeset
   139
# of the list can do so, by setting PKG_PROTO_DIRS before including this file.
918f15f3f728 21137686 grails & unrar Makefiles break when PKG_PROTO_DIRS is extended
John Beck <John.Beck@Oracle.COM>
parents: 4196
diff changeset
   140
# So don't change += to = here or components that use this will break.
4490
5a5296580120 21249474 s/pre-release/evaluation/g + other tweaks
John Beck <John.Beck@Oracle.COM>
parents: 4439
diff changeset
   141
PKG_PROTO_DIRS += $(MANGLED_DIR) $(PROTO_DIR) $(@D) $(COMPONENT_DIR) $(COMPONENT_SRC) $(WS_LICENSES)
99
c15c9099bb44 6841644 OpenSolaris Python should support gdbm
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 93
diff changeset
   142
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
   143
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
   144
30
440b6ca0641d Removed $(PUBLISHER) from pkg.fmri package attributes. Renamed package
Danek Duvall <danek.duvall@oracle.com>
parents: 27
diff changeset
   145
CANONICAL_MANIFESTS =	$(wildcard *.p5m)
4813
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   146
ifneq ($(wildcard $(HISTORY)),)
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   147
HISTORICAL_MANIFESTS = $(shell $(NAWK) -v FUNCTION=name -f $(GENERATE_HISTORY) < $(HISTORY))
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   148
endif
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   149
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   150
# Look for manifests which need to be duplicated for each version of python.
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   151
ifeq ($(findstring -PYVER,$(CANONICAL_MANIFESTS)),-PYVER)
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 1890
diff changeset
   152
UNVERSIONED_MANIFESTS = $(filter-out %GENFRAG.p5m,$(filter-out %-PYVER.p5m,$(CANONICAL_MANIFESTS)))
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   153
PY_MANIFESTS = $(filter %-PYVER.p5m,$(CANONICAL_MANIFESTS))
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   154
PYV_MANIFESTS = $(foreach v,$(shell echo $(PYTHON_VERSIONS) | tr -d .),$(shell echo $(PY_MANIFESTS) | sed -e 's/-PYVER.p5m/-$(v).p5m/g'))
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   155
PYNV_MANIFESTS = $(shell echo $(PY_MANIFESTS) | sed -e 's/-PYVER//')
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   156
else
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   157
UNVERSIONED_MANIFESTS = $(CANONICAL_MANIFESTS)
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   158
endif
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   159
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   160
# Look for manifests which need to be duplicated for each version of perl.
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   161
ifeq ($(findstring -PERLVER,$(UNVERSIONED_MANIFESTS)),-PERLVER)
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 1890
diff changeset
   162
NOPERL_MANIFESTS = $(filter-out %GENFRAG.p5m,$(filter-out %-PERLVER.p5m,$(UNVERSIONED_MANIFESTS)))
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   163
PERL_MANIFESTS = $(filter %-PERLVER.p5m,$(UNVERSIONED_MANIFESTS))
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   164
PERLV_MANIFESTS = $(foreach v,$(shell echo $(PERL_VERSIONS) | tr -d .),$(shell echo $(PERL_MANIFESTS) | sed -e 's/-PERLVER.p5m/-$(v).p5m/g'))
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   165
PERLNV_MANIFESTS = $(shell echo $(PERL_MANIFESTS) | sed -e 's/-PERLVER//')
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   166
else
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   167
NOPERL_MANIFESTS = $(UNVERSIONED_MANIFESTS)
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   168
endif
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   169
2054
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   170
# Look for manifests which need to be duplicated for each version of ruby.
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   171
# NOPERL_MANIFESTS represents the manifests that are not Python or
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   172
# Perl manifests.  Extract the Ruby Manifests from NOPERL_MANIFESTS.
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   173
# Any remaining manifests are stored in NONRUBY_MANIFESTS
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   174
ifeq ($(findstring -RUBYVER,$(NOPERL_MANIFESTS)),-RUBYVER)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   175
NORUBY_MANIFESTS = $(filter-out %GENFRAG.p5m,\
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   176
		   $(filter-out %-RUBYVER.p5m,$(NOPERL_MANIFESTS)))
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   177
RUBY_MANIFESTS = $(filter %-RUBYVER.p5m,$(NOPERL_MANIFESTS))
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   178
RUBYV_MANIFESTS = $(foreach v,$(shell echo $(RUBY_VERSIONS)),\
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   179
                      $(shell echo $(RUBY_MANIFESTS) |\
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   180
                      sed -e 's/-RUBYVER.p5m/-$(shell echo $(v) |\
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   181
                      cut -d. -f1,2 | tr -d .).p5m/g'))
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   182
RUBYNV_MANIFESTS = $(shell echo $(RUBY_MANIFESTS) | sed -e 's/-RUBYVER//')
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   183
else
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   184
NORUBY_MANIFESTS = $(NOPERL_MANIFESTS)
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   185
endif
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   186
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   187
VERSIONED_MANIFESTS = \
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   188
	$(PYV_MANIFESTS) $(PYNV_MANIFESTS) \
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   189
	$(PERLV_MANIFESTS) $(PERLNV_MANIFESTS) \
2054
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   190
	$(RUBYV_MANIFESTS) $(RUBYNV_MANIFESTS) \
4813
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   191
	$(NORUBY_MANIFESTS) $(HISTORICAL_MANIFESTS)
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   192
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   193
GENERATED =		$(MANIFEST_BASE)-generated
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   194
COMBINED =		$(MANIFEST_BASE)-combined
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   195
MANIFESTS =		$(VERSIONED_MANIFESTS:%=$(MANIFEST_BASE)-%)
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   196
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   197
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   198
DEPENDED=$(VERSIONED_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.depend)
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   199
RESOLVED=$(VERSIONED_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.depend.res)
185
773dda89f186 7036473 dependency resolution should happen in one step for all component's packages
Danek Duvall <danek.duvall@oracle.com>
parents: 181
diff changeset
   200
PUBLISHED=$(RESOLVED:%.depend.res=%.published)
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   201
255
52abf74b9323 7037058 Move fetchmail to Userland
Marcel Telka <marcel.telka@oracle.com>
parents: 206
diff changeset
   202
COPYRIGHT_FILE ?=	$(COMPONENT_NAME)-$(COMPONENT_VERSION).copyright
145
1e2390f5555e 7020836 revert workaround in 7014413 now that pkglint doesn't complain
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 117
diff changeset
   203
IPS_COMPONENT_VERSION ?=	$(COMPONENT_VERSION)
7
d42300cb8715 add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 4
diff changeset
   204
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   205
.DEFAULT:		publish
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   206
38
cd00ea74156e package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 32
diff changeset
   207
.SECONDARY:
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   208
197
fd801ec0737c 7038707 move acpidump to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 196
diff changeset
   209
# allow publishing to be overridden, such as when
fd801ec0737c 7038707 move acpidump to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 196
diff changeset
   210
# a package is for one architecture only.
fd801ec0737c 7038707 move acpidump to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 196
diff changeset
   211
PUBLISH_STAMP ?= $(BUILD_DIR)/.published-$(MACH)
fd801ec0737c 7038707 move acpidump to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 196
diff changeset
   212
fd801ec0737c 7038707 move acpidump to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 196
diff changeset
   213
publish:		build install $(PUBLISH_STAMP)
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   214
30
440b6ca0641d Removed $(PUBLISHER) from pkg.fmri package attributes. Renamed package
Danek Duvall <danek.duvall@oracle.com>
parents: 27
diff changeset
   215
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
   216
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 38
diff changeset
   217
$(GENERATED).p5m:	install
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 38
diff changeset
   218
	$(PKGSEND) generate $(PKG_HARDLINKS:%=--target %) $(PROTO_DIR) | \
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 38
diff changeset
   219
	$(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
   220
		sed -e '/^$$/d' -e '/^#.*$$/d' | $(PKGFMT) | \
a4b12971cf99 7014330 has userland lost its mapfile mind?
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 59
diff changeset
   221
		cat $(METADATA_TEMPLATE) - >$@
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   222
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 38
diff changeset
   223
# 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
   224
$(MANIFEST_BASE)-%.generate:	%.p5m canonical-manifests
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 38
diff changeset
   225
	cat $(METADATA_TEMPLATE) $< >$@
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   226
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   227
# The text of a transform that will emit a dependency conditional on the
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   228
# presence of a particular version of a runtime, which will then draw in the
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   229
# runtime-version-specific version of the package we're operating on.  $(1) is
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   230
# the name of the runtime package, and $(2) is the version suffix.
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   231
mkgeneric = \
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 1890
diff changeset
   232
	echo "<transform set name=pkg.fmri value=(?:pkg:/)?(.+)-\#\#\#PYV\#\#\#@(.*)" \
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   233
		"-> emit depend nodrop=true type=conditional" \
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   234
		"predicate=$(1)-$(2) fmri=%<1>-$(2)@%<2>>" >> $@;
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   235
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   236
# Define and execute a macro that generates a rule to create a manifest for a
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   237
# python module specific to a particular version of the python runtime.
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 1890
diff changeset
   238
# Creates build/manifest-*-modulename-##.p5m file where ## is replaced with
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 1890
diff changeset
   239
# the version number.
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   240
define python-manifest-rule
1609
87293f3666a2 17599591 The Python tox module needs to be added to Userland (fix build)
Rich Burridge <rich.burridge@oracle.com>
parents: 1432
diff changeset
   241
$(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).mogrified: PKG_MACROS += PYTHON_$(1)_ONLY=
87293f3666a2 17599591 The Python tox module needs to be added to Userland (fix build)
Rich Burridge <rich.burridge@oracle.com>
parents: 1432
diff changeset
   242
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   243
$(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).p5m: %-PYVER.p5m
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 1890
diff changeset
   244
	if [ -f $$*-$(shell echo $(1) | tr -d .)GENFRAG.p5m ]; then cat $$*-$(shell echo $(1) | tr -d .)GENFRAG.p5m >> $$@; fi
3739
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
   245
	$(PKGFMT) $(PKGFMT_CHECK_ARGS) $(CANONICAL_MANIFESTS)
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   246
	$(PKGMOGRIFY) -D PYVER=$(1) -D MAYBE_PYVER_SPACE="$(1) " \
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   247
		-D MAYBE_SPACE_PYVER=" $(1)" \
5661
69b9e8724bb3 22992910 pep8 needs bypass on S11 but not S12
John Beck <John.Beck@Oracle.COM>
parents: 5438
diff changeset
   248
		-D SOLARIS_11_ONLY="$(SOLARIS_11_ONLY)" \
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   249
		-D PYV=$(shell echo $(1) | tr -d .) $$< > $$@
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   250
endef
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   251
$(foreach ver,$(PYTHON_VERSIONS),$(eval $(call python-manifest-rule,$(ver))))
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   252
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   253
# A rule to create a helper transform package for python, that will insert the
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   254
# appropriate conditional dependencies into a python library's
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   255
# runtime-version-generic package to pull in the version-specific bits when the
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   256
# corresponding version of python is on the system.
3817
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   257
$(BUILD_DIR)/mkgeneric-python: $(WS_MAKE_RULES)/shared-macros.mk
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   258
	$(RM) $@
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   259
	$(foreach ver,$(shell echo $(PYTHON_VERSIONS) | tr -d .), \
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   260
		$(call mkgeneric,runtime/python,$(ver)))
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   261
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   262
# Build Python version-wrapping manifests from the generic version.
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 1890
diff changeset
   263
# Creates build/manifest-*-modulename.p5m file.
2208
393dee918e3c 20026411 library/perl-5/database package dependencies got dropped
John Beck <John.Beck@Oracle.COM>
parents: 2142
diff changeset
   264
# Note that the mkgeneric transform uses the literal string "###PYV###"
393dee918e3c 20026411 library/perl-5/database package dependencies got dropped
John Beck <John.Beck@Oracle.COM>
parents: 2142
diff changeset
   265
# as the place-holder for the Python version (for mkgeneric-python) and
393dee918e3c 20026411 library/perl-5/database package dependencies got dropped
John Beck <John.Beck@Oracle.COM>
parents: 2142
diff changeset
   266
# the Perl version (for mkgeneric-perl below) and the Ruby version (for
393dee918e3c 20026411 library/perl-5/database package dependencies got dropped
John Beck <John.Beck@Oracle.COM>
parents: 2142
diff changeset
   267
# mkgeneric-ruby further below).  The authors did not anticipate that this
393dee918e3c 20026411 library/perl-5/database package dependencies got dropped
John Beck <John.Beck@Oracle.COM>
parents: 2142
diff changeset
   268
# mechanism would be extended beyond Python when they wrote it; something
393dee918e3c 20026411 library/perl-5/database package dependencies got dropped
John Beck <John.Beck@Oracle.COM>
parents: 2142
diff changeset
   269
# more generic like LANGVER might make more sense, but for now we are
393dee918e3c 20026411 library/perl-5/database package dependencies got dropped
John Beck <John.Beck@Oracle.COM>
parents: 2142
diff changeset
   270
# sticking with something known to work.
1430
24f4aebfd6a5 17300973 ips.mk is a little racey
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 1428
diff changeset
   271
$(MANIFEST_BASE)-%.p5m: %-PYVER.p5m $(BUILD_DIR)/mkgeneric-python
3739
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
   272
	$(PKGFMT) $(PKGFMT_CHECK_ARGS) $(CANONICAL_MANIFESTS)
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   273
	$(PKGMOGRIFY) -D PYV=###PYV### -D MAYBE_PYVER_SPACE= \
5661
69b9e8724bb3 22992910 pep8 needs bypass on S11 but not S12
John Beck <John.Beck@Oracle.COM>
parents: 5438
diff changeset
   274
		-D SOLARIS_11_ONLY="$(SOLARIS_11_ONLY)" \
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   275
		-D MAYBE_SPACE_PYVER= $(BUILD_DIR)/mkgeneric-python \
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   276
		$(WS_TOP)/transforms/mkgeneric $< > $@
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   277
	if [ -f $*-GENFRAG.p5m ]; then cat $*-GENFRAG.p5m >> $@; fi
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   278
1152
96d423311191 16292975 perl_modules should build and deliver perl 5.16 versions
Craig Mohrman <craig.mohrman@oracle.com>
parents: 1151
diff changeset
   279
# Define and execute a macro that generates a rule to create a manifest for a
96d423311191 16292975 perl_modules should build and deliver perl 5.16 versions
Craig Mohrman <craig.mohrman@oracle.com>
parents: 1151
diff changeset
   280
# perl module specific to a particular version of the perl runtime.
96d423311191 16292975 perl_modules should build and deliver perl 5.16 versions
Craig Mohrman <craig.mohrman@oracle.com>
parents: 1151
diff changeset
   281
define perl-manifest-rule
96d423311191 16292975 perl_modules should build and deliver perl 5.16 versions
Craig Mohrman <craig.mohrman@oracle.com>
parents: 1151
diff changeset
   282
$(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).p5m: %-PERLVER.p5m
3739
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
   283
	$(PKGFMT) $(PKGFMT_CHECK_ARGS) $$<
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   284
	$(PKGMOGRIFY) -D PERLVER=$(1) -D MAYBE_PERLVER_SPACE="$(1) " \
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   285
		-D MAYBE_SPACE_PERLVER=" $(1)" \
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   286
		-D PLV=$(shell echo $(1) | tr -d .) \
1152
96d423311191 16292975 perl_modules should build and deliver perl 5.16 versions
Craig Mohrman <craig.mohrman@oracle.com>
parents: 1151
diff changeset
   287
		-D PERL_ARCH=$(call PERL_ARCH_FUNC,$(PERL.$(1))) $$< > $$@
96d423311191 16292975 perl_modules should build and deliver perl 5.16 versions
Craig Mohrman <craig.mohrman@oracle.com>
parents: 1151
diff changeset
   288
endef
96d423311191 16292975 perl_modules should build and deliver perl 5.16 versions
Craig Mohrman <craig.mohrman@oracle.com>
parents: 1151
diff changeset
   289
$(foreach ver,$(PERL_VERSIONS),$(eval $(call perl-manifest-rule,$(ver))))
96d423311191 16292975 perl_modules should build and deliver perl 5.16 versions
Craig Mohrman <craig.mohrman@oracle.com>
parents: 1151
diff changeset
   290
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   291
# A rule to create a helper transform package for perl, that will insert the
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   292
# appropriate conditional dependencies into a perl library's
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   293
# runtime-version-generic package to pull in the version-specific bits when the
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   294
# corresponding version of perl is on the system.
3817
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   295
$(BUILD_DIR)/mkgeneric-perl: $(WS_MAKE_RULES)/shared-macros.mk
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   296
	$(RM) $@
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   297
	$(foreach ver,$(shell echo $(PERL_VERSIONS) | tr -d .), \
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   298
		$(call mkgeneric,runtime/perl,$(ver)))
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   299
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   300
# Build Perl version-wrapping manifests from the generic version.
2208
393dee918e3c 20026411 library/perl-5/database package dependencies got dropped
John Beck <John.Beck@Oracle.COM>
parents: 2142
diff changeset
   301
# See the block comment above about why "###PYV###" is used here even
393dee918e3c 20026411 library/perl-5/database package dependencies got dropped
John Beck <John.Beck@Oracle.COM>
parents: 2142
diff changeset
   302
# though this is for Perl rather than Python.
1430
24f4aebfd6a5 17300973 ips.mk is a little racey
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 1428
diff changeset
   303
$(MANIFEST_BASE)-%.p5m: %-PERLVER.p5m $(BUILD_DIR)/mkgeneric-perl
3739
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
   304
	$(PKGFMT) $(PKGFMT_CHECK_ARGS) $(CANONICAL_MANIFESTS)
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   305
	$(PKGMOGRIFY) -D PLV=###PYV### -D MAYBE_PERLVER_SPACE= \
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   306
		-D MAYBE_SPACE_PERLVER= $(BUILD_DIR)/mkgeneric-perl \
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   307
		$(WS_TOP)/transforms/mkgeneric $< > $@
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   308
	if [ -f $*-GENFRAG.p5m ]; then cat $*-GENFRAG.p5m >> $@; fi
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   309
2054
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   310
# Define and execute a macro that generates a rule to create a manifest for a
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   311
# ruby module specific to a particular version of the ruby runtime.
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   312
# Creates build/manifest-*-modulename-##.p5m file where ## is replaced with
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   313
# the version number.
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   314
define ruby-manifest-rule
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   315
$(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).mogrified: \
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   316
	PKG_MACROS += RUBY_VERSION=$(1) RUBY_LIB_VERSION=$(2) \
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   317
	    RUBYV=$(subst .,,$(1))
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   318
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   319
$(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).p5m: %-RUBYVER.p5m
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   320
	if [ -f $$*-$(shell echo $(1) | tr -d .)GENFRAG.p5m ]; then \
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   321
		cat $$*-$(shell echo $(1) | tr -d .)GENFRAG.p5m >> $$@; \
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   322
	fi
3739
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
   323
	$(PKGFMT) $(PKGFMT_CHECK_ARGS) $(CANONICAL_MANIFESTS)
2054
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   324
	$(PKGMOGRIFY) -D RUBY_VERSION=$(1) -D RUBY_LIB_VERSION=$(2) \
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   325
	    -D MAYBE_RUBY_VERSION_SPACE="$(1) " \
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   326
	    -D MAYBE_SPACE_RUBY_VERSION=" $(1)" \
2054
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   327
	    -D RUBYV=$(shell echo $(1) | tr -d .) $$< > $$@
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   328
endef
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   329
$(foreach ver,$(RUBY_VERSIONS),\
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   330
	$(eval $(call ruby-manifest-rule,$(shell echo $(ver) | \
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   331
	    cut -d. -f1,2),$(ver))))
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   332
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   333
# A rule to create a helper transform package for ruby, that will insert the
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   334
# appropriate conditional dependencies into a ruby library's
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   335
# runtime-version-generic package to pull in the version-specific bits when the
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   336
# corresponding version of ruby is on the system.
3817
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   337
$(BUILD_DIR)/mkgeneric-ruby: $(WS_MAKE_RULES)/shared-macros.mk
2054
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   338
	$(RM) $@
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   339
	$(foreach ver,$(RUBY_VERSIONS),\
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   340
		$(call mkgeneric,runtime/ruby,$(shell echo $(ver) | \
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   341
		    cut -d. -f1,2 | tr -d .)))
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   342
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   343
# Build Ruby version-wrapping manifests from the generic version.
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   344
# Creates build/manifest-*-modulename.p5m file.
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   345
#
2208
393dee918e3c 20026411 library/perl-5/database package dependencies got dropped
John Beck <John.Beck@Oracle.COM>
parents: 2142
diff changeset
   346
# See the block comment above about why "###PYV###" is used here even
393dee918e3c 20026411 library/perl-5/database package dependencies got dropped
John Beck <John.Beck@Oracle.COM>
parents: 2142
diff changeset
   347
# though this is for Ruby rather than Python.
2054
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   348
$(MANIFEST_BASE)-%.p5m: %-RUBYVER.p5m $(BUILD_DIR)/mkgeneric-ruby
3739
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
   349
	$(PKGFMT) $(PKGFMT_CHECK_ARGS) $(CANONICAL_MANIFESTS)
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   350
	$(PKGMOGRIFY) -D RUBYV=###PYV### -D MAYBE_RUBY_VERSION_SPACE= \
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   351
		-D MAYBE_SPACE_RUBY_VERSION= $(BUILD_DIR)/mkgeneric-ruby \
2054
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   352
		$(WS_TOP)/transforms/mkgeneric $< > $@
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   353
	if [ -f $*-GENFRAG.p5m ]; then cat $*-GENFRAG.p5m >> $@; fi
5f403d9bcaad PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 1948
diff changeset
   354
4813
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   355
# Rule to generate historical manifests from the $(HISTORY) file.
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   356
define history-manifest-rule
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   357
$(MANIFEST_BASE)-$(1): $(HISTORY) $(BUILD_DIR)
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   358
	$(NAWK) -v TARGET=$(1) -v FUNCTION=manifest -f $(GENERATE_HISTORY) < \
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   359
	    $(HISTORY) > $$@
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   360
endef
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   361
$(foreach mfst,$(HISTORICAL_MANIFESTS),$(eval $(call history-manifest-rule,$(mfst))))
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   362
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   363
# mogrify non-parameterized manifests
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   364
$(MANIFEST_BASE)-%.mogrified:	%.p5m $(BUILD_DIR)
3739
1ad120fc17bb 20475288 enforce pkgfmt cleanliness at 'gmake publish' step
John Beck <John.Beck@Oracle.COM>
parents: 2208
diff changeset
   365
	$(PKGFMT) $(PKGFMT_CHECK_ARGS) $<
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   366
	$(PKGMOGRIFY) $(PKG_OPTIONS) $< \
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   367
		$(PUBLISH_TRANSFORMS) | \
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   368
		sed -e '/^$$/d' -e '/^#.*$$/d' | uniq >$@
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   369
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   370
# mogrify parameterized manifests
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   371
$(MANIFEST_BASE)-%.mogrified:	$(MANIFEST_BASE)-%.p5m $(BUILD_DIR)
53
e398cb2c4b45 7004049 SUNWa2ps should move to userland with a2ps
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 49
diff changeset
   372
	$(PKGMOGRIFY) $(PKG_OPTIONS) $< \
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 38
diff changeset
   373
		$(PUBLISH_TRANSFORMS) | \
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 38
diff changeset
   374
		sed -e '/^$$/d' -e '/^#.*$$/d' | uniq >$@
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   375
181
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
   376
# mangle the file contents
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents: 255
diff changeset
   377
$(BUILD_DIR) $(MANGLED_DIR):
181
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
   378
	$(MKDIR) $@
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
   379
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
   380
PKGMANGLE_OPTIONS = -D $(MANGLED_DIR) $(PKG_PROTO_DIRS:%=-d %)
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
   381
$(MANIFEST_BASE)-%.mangled:	$(MANIFEST_BASE)-%.mogrified $(MANGLED_DIR)
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
   382
	$(PKGMANGLE) $(PKGMANGLE_OPTIONS) -m $< >$@
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
   383
76
a084497ff237 7016379 migrate elinks to userland (fix pkglint)
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 75
diff changeset
   384
# generate dependencies
99
c15c9099bb44 6841644 OpenSolaris Python should support gdbm
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 93
diff changeset
   385
PKGDEPEND_GENERATE_OPTIONS = -m $(PKG_PROTO_DIRS:%=-d %)
181
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
   386
$(MANIFEST_BASE)-%.depend:	$(MANIFEST_BASE)-%.mangled
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 1890
diff changeset
   387
	$(ENV) $(COMPONENT_PUBLISH_ENV) $(PKGDEPEND) generate \
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 1890
diff changeset
   388
	    $(PKGDEPEND_GENERATE_OPTIONS) $< >$@
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   389
3817
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   390
# pkgdepend resolve builds a map of all installed packages by default.  This
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   391
# makes dependency resolution particularly slow.  We can dramatically improve
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   392
# performance here by creating a file with a list of packages that we know
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   393
# are needed, dramatically reducing the overhead involved in creating and
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   394
# searching this map.
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   395
#
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   396
# Generate a resolve.deps file from the dependencies in the Makefile and
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   397
# fragments that it uses.
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   398
RESOLVE_DEPS=$(BUILD_DIR)/resolve.deps
1235
413599fe2d31 15960689 pkgdepend resolve takes longer than it might
Danek Duvall <danek.duvall@oracle.com>
parents: 1205
diff changeset
   399
3817
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   400
$(RESOLVE_DEPS):	$(MAKEFILE_PREREQ) $(BUILD_DIR)
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   401
	@for pkg in $(REQUIRED_PACKAGES:%=/%) ; do \
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   402
	    echo $${pkg} ; \
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   403
	done | sort -u >$@
1235
413599fe2d31 15960689 pkgdepend resolve takes longer than it might
Danek Duvall <danek.duvall@oracle.com>
parents: 1205
diff changeset
   404
185
773dda89f186 7036473 dependency resolution should happen in one step for all component's packages
Danek Duvall <danek.duvall@oracle.com>
parents: 181
diff changeset
   405
# resolve the dependencies all at once
3817
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   406
$(BUILD_DIR)/.resolved-$(MACH):	$(DEPENDED) $(RESOLVE_DEPS)
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   407
	$(PKGDEPEND) resolve $(RESOLVE_DEPS:%=-e %) -m $(DEPENDED)
145
1e2390f5555e 7020836 revert workaround in 7014413 now that pkglint doesn't complain
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 117
diff changeset
   408
	$(TOUCH) $@
1e2390f5555e 7020836 revert workaround in 7014413 now that pkglint doesn't complain
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 117
diff changeset
   409
3817
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   410
#
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   411
# Generate a set of REQUIRED_PACKAGES based on what is needed to for pkgdepend
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   412
# to resolve properly.  Automatically append this to your Makefile for the truly
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   413
# lazy among us.  This is only a piece of the REQUIRED_PACKAGES puzzle.
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   414
# You must still include packages for tools you build and test with.
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   415
#
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   416
REQUIRED_PACKAGES::	$(RESOLVED)
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   417
	$(GMAKE) RESOLVE_DEPS= $(BUILD_DIR)/.resolved-$(MACH)
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   418
	@echo "# Auto-generated contents below.  Please manually verify and remove this comment" >>Makefile
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   419
	@$(PKGMOGRIFY) $(WS_TRANSFORMS)/$@ $(RESOLVED) | \
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   420
		$(GSED) -e '/^[\t ]*$$/d' -e '/^#/d' | sort -u >>Makefile
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   421
	@echo "*** Please edit your Makefile and verify the new content at the end ***"
30b42c38bbc4 15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 3739
diff changeset
   422
145
1e2390f5555e 7020836 revert workaround in 7014413 now that pkglint doesn't complain
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 117
diff changeset
   423
# lint the manifests all at once
1e2390f5555e 7020836 revert workaround in 7014413 now that pkglint doesn't complain
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 117
diff changeset
   424
$(BUILD_DIR)/.linted-$(MACH):	$(BUILD_DIR)/.resolved-$(MACH)
1e2390f5555e 7020836 revert workaround in 7014413 now that pkglint doesn't complain
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 117
diff changeset
   425
	@echo "VALIDATING MANIFEST CONTENT: $(RESOLVED)"
117
8f634eb6f66b 7023683 userland pkglint checks should look in more places for content
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 99
diff changeset
   426
	$(ENV) PYTHONPATH=$(WS_TOOLS)/python PROTO_PATH="$(PKG_PROTO_DIRS)"\
1756
3579365335ef 17591620 ruby 1.9 should not have its *.rb text files under amd64/sparcv9 directories
April Chin <april.chin@oracle.com>
parents: 1609
diff changeset
   427
		SOLARIS_VERSION=$(SOLARIS_VERSION)\
84
b80cfd4e0a16 7000952 Userland package validation needs some love
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 76
diff changeset
   428
		$(PKGLINT) $(CANONICAL_REPO:%=-c $(WS_LINT_CACHE)) \
145
1e2390f5555e 7020836 revert workaround in 7014413 now that pkglint doesn't complain
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 117
diff changeset
   429
			-f $(WS_TOOLS)/pkglintrc $(RESOLVED)
1e2390f5555e 7020836 revert workaround in 7014413 now that pkglint doesn't complain
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 117
diff changeset
   430
	$(TOUCH) $@
1e2390f5555e 7020836 revert workaround in 7014413 now that pkglint doesn't complain
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 117
diff changeset
   431
1138
6e1f85fa0151 15801420 SUNBT7180909 tag the Userland consolidation binaries for ASLR
April Chin <april.chin@oracle.com>
parents: 1056
diff changeset
   432
lintme: FRC
6e1f85fa0151 15801420 SUNBT7180909 tag the Userland consolidation binaries for ASLR
April Chin <april.chin@oracle.com>
parents: 1056
diff changeset
   433
	@echo "VALIDATING MANIFEST CONTENT: $(RESOLVED)"
6e1f85fa0151 15801420 SUNBT7180909 tag the Userland consolidation binaries for ASLR
April Chin <april.chin@oracle.com>
parents: 1056
diff changeset
   434
	$(ENV) PYTHONPATH=$(WS_TOOLS)/python PROTO_PATH="$(PKG_PROTO_DIRS)"\
1756
3579365335ef 17591620 ruby 1.9 should not have its *.rb text files under amd64/sparcv9 directories
April Chin <april.chin@oracle.com>
parents: 1609
diff changeset
   435
		SOLARIS_VERSION=$(SOLARIS_VERSION)\
1138
6e1f85fa0151 15801420 SUNBT7180909 tag the Userland consolidation binaries for ASLR
April Chin <april.chin@oracle.com>
parents: 1056
diff changeset
   436
		$(PKGLINT) $(CANONICAL_REPO:%=-c $(WS_LINT_CACHE)) \
6e1f85fa0151 15801420 SUNBT7180909 tag the Userland consolidation binaries for ASLR
April Chin <april.chin@oracle.com>
parents: 1056
diff changeset
   437
			-f $(WS_TOOLS)/pkglintrc $(RESOLVED)
6e1f85fa0151 15801420 SUNBT7180909 tag the Userland consolidation binaries for ASLR
April Chin <april.chin@oracle.com>
parents: 1056
diff changeset
   438
6e1f85fa0151 15801420 SUNBT7180909 tag the Userland consolidation binaries for ASLR
April Chin <april.chin@oracle.com>
parents: 1056
diff changeset
   439
FRC:
6e1f85fa0151 15801420 SUNBT7180909 tag the Userland consolidation binaries for ASLR
April Chin <april.chin@oracle.com>
parents: 1056
diff changeset
   440
38
cd00ea74156e package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 32
diff changeset
   441
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 38
diff changeset
   442
# published
1416
a87a9e85090e 17231570 full userland build sporadically fails during 'pkgsend publish'
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 1238
diff changeset
   443
PKGSEND_PUBLISH_OPTIONS = -s $(PKG_REPO) publish --fmri-in-manifest
a87a9e85090e 17231570 full userland build sporadically fails during 'pkgsend publish'
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 1238
diff changeset
   444
PKGSEND_PUBLISH_OPTIONS += --no-catalog
99
c15c9099bb44 6841644 OpenSolaris Python should support gdbm
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 93
diff changeset
   445
PKGSEND_PUBLISH_OPTIONS += $(PKG_PROTO_DIRS:%=-d %)
196
816e398e992c 6907515 mercurial 1.8.2
Danek Duvall <danek.duvall@oracle.com>
parents: 185
diff changeset
   446
PKGSEND_PUBLISH_OPTIONS += -T \*.py
1416
a87a9e85090e 17231570 full userland build sporadically fails during 'pkgsend publish'
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 1238
diff changeset
   447
5438
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5427
diff changeset
   448
# PKGREPO_REMOVE_BEFORE_PUBLISH remove previously published versions of this package
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5427
diff changeset
   449
# before publishing the new build
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5427
diff changeset
   450
PKGREPO_REMOVE_BEFORE_PUBLISH ?= no
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5427
diff changeset
   451
185
773dda89f186 7036473 dependency resolution should happen in one step for all component's packages
Danek Duvall <danek.duvall@oracle.com>
parents: 181
diff changeset
   452
$(MANIFEST_BASE)-%.published:	$(MANIFEST_BASE)-%.depend.res $(BUILD_DIR)/.linted-$(MACH)
5438
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5427
diff changeset
   453
ifeq ($(PKGREPO_REMOVE_BEFORE_PUBLISH),yes)
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5427
diff changeset
   454
	-$(PKGREPO) -s $(PKG_REPO) remove \
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5427
diff changeset
   455
			$(shell $(CAT) $< $(WS_TOP)/transforms/print-pkgs | \
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5427
diff changeset
   456
				$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5427
diff changeset
   457
				sed -e '/^$$/d' -e '/^#.*$$/d' | sort -u)
c068f8c677e8 PSARC/2016/016 Rename/Refactor Puppet and Puppet Module Packages
Shawn Ferry <shawn.ferry@oracle.com>
parents: 5427
diff changeset
   458
endif
99
c15c9099bb44 6841644 OpenSolaris Python should support gdbm
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 93
diff changeset
   459
	$(PKGSEND) $(PKGSEND_PUBLISH_OPTIONS) $<
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 38
diff changeset
   460
	$(PKGFMT) <$< >$@
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   461
145
1e2390f5555e 7020836 revert workaround in 7014413 now that pkglint doesn't complain
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 117
diff changeset
   462
$(BUILD_DIR)/.published-$(MACH):	$(PUBLISHED)
1416
a87a9e85090e 17231570 full userland build sporadically fails during 'pkgsend publish'
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 1238
diff changeset
   463
ifndef DISABLE_IPS_CATALOG_AND_INDEX_UPDATES
a87a9e85090e 17231570 full userland build sporadically fails during 'pkgsend publish'
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 1238
diff changeset
   464
	$(PKGREPO) refresh -s $(PKG_REPO)
a87a9e85090e 17231570 full userland build sporadically fails during 'pkgsend publish'
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 1238
diff changeset
   465
endif
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   466
	$(TOUCH) $@
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   467
32
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 30
diff changeset
   468
print-package-names:	canonical-manifests
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   469
	@cat $(VERSIONED_MANIFESTS) $(WS_TOP)/transforms/print-pkgs | \
32
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 30
diff changeset
   470
		$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 30
diff changeset
   471
 		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
   472
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 30
diff changeset
   473
print-package-paths:	canonical-manifests
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   474
	@cat $(VERSIONED_MANIFESTS) $(WS_TOP)/transforms/print-paths | \
32
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 30
diff changeset
   475
		$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 30
diff changeset
   476
 		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
   477
38
cd00ea74156e package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 32
diff changeset
   478
install-packages:	publish
cd00ea74156e package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 32
diff changeset
   479
	@if [ $(IS_GLOBAL_ZONE) = 0 -o x$(ROOT) != x ]; then \
1056
b2ec61db2a04 15845939 versionless python manifests
Danek Duvall <danek.duvall@oracle.com>
parents: 944
diff changeset
   480
	    cat $(VERSIONED_MANIFESTS) $(WS_TOP)/transforms/print-paths | \
38
cd00ea74156e package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 32
diff changeset
   481
		$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \
cd00ea74156e package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 32
diff changeset
   482
 		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
   483
		(cd $(PROTO_DIR) ; pfexec /bin/cpio -dump $(ROOT)) ; \
cd00ea74156e package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 32
diff changeset
   484
	else ; \
cd00ea74156e package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 32
diff changeset
   485
	    echo "unsafe to install package(s) automatically" ; \
cd00ea74156e package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 32
diff changeset
   486
        fi
cd00ea74156e package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 32
diff changeset
   487
145
1e2390f5555e 7020836 revert workaround in 7014413 now that pkglint doesn't complain
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 117
diff changeset
   488
$(RESOLVED):	install
38
cd00ea74156e package audits should pass pkglint
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 32
diff changeset
   489
6991
cddc7c0c4e9d 24751721 secondary source patches are not getting applied
Danek Duvall <danek.duvall@oracle.com>
parents: 6609
diff changeset
   490
canonical-manifests:	$(CANONICAL_MANIFESTS) $(MAKEFILE_PREREQ) $(ALL_PATCHES) \
4813
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents: 4749
diff changeset
   491
    $(HISTORY)
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   492
ifeq	($(strip $(CANONICAL_MANIFESTS)),)
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   493
	# 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
   494
	# 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
   495
	# with
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   496
	#   $ gmake sample-manifest
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   497
	# 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
   498
	# workspace.
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 22
diff changeset
   499
	$(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
   500
endif
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   501
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   502
# Add component-specific variables and export to PKG_OPTIONS.
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   503
COMP_SUFFIXES = $(subst COMPONENT_NAME_,, \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   504
		$(filter COMPONENT_NAME_%, $(.VARIABLES)))
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   505
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   506
# Component variables are expanded directly to PKG_OPTIONS instead of via
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   507
# PKG_MACROS since the values may contain whitespace.
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   508
mkdefine = -D $(1)="$(2)"
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   509
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   510
# Expand PKG_VARS into defines via PKG_OPTIONS.
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   511
$(foreach var, $(PKG_VARS), \
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   512
    $(eval PKG_OPTIONS += $(call mkdefine,$(var),$$($(var)))) \
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   513
)
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   514
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   515
# Expand any variables ending in component _$(suffix) via PKG_OPTIONS excluding
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   516
# variables known to always be irrelevant and TPNO_% variables as those have
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   517
# already been processed.
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   518
$(foreach suffix, $(COMP_SUFFIXES), \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   519
    $(eval COMPONENT_RE_VERSION_$(suffix) ?= $(subst .,\\.,$$(COMPONENT_VERSION_$(suffix)))) \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   520
    $(eval IPS_COMPONENT_VERSION_$(suffix) ?= $$(COMPONENT_VERSION_$(suffix))) \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   521
    $(eval IPS_COMPONENT_RE_VERSION_$(suffix) ?= $(subst .,\\.,$$(IPS_COMPONENT_VERSION_$(suffix)))) \
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   522
    $(eval COMP_VARS=$(filter %_$(suffix), $(.VARIABLES))) \
5351
3cf5399d1ed8 21480408 sample-manifest COMPONENT_VERSION transforms cause erroneous results (fix tpnos)
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5339
diff changeset
   523
    $(eval COMP_VARS=$(filter-out COMPONENT_POST_UNPACK_%, $(COMP_VARS))) \
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   524
    $(eval COMP_VARS=$(filter-out TPNO_%, $(COMP_VARS))) \
5339
cf0e8b40a0d4 21480408 sample-manifest COMPONENT_VERSION transforms cause erroneous results (fix build)
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5331
diff changeset
   525
    $(eval COMP_VARS=$(filter-out UNPACK_ARGS_%, $(COMP_VARS))) \
5427
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   526
    $(foreach macro, $(COMP_VARS), \
25b736152081 15814060 SUNBT7196216 userland build mangles PKG_MACROS containing whitespace
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5351
diff changeset
   527
        $(eval PKG_OPTIONS += $(call mkdefine,$(macro),$$($(macro)))) \
5331
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   528
    ) \
9c955076ffe3 PSARC/2015/203 Google Go version 1.5
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 5125
diff changeset
   529
)