doc/packaging.txt
author Stefan Teleman <stefan.teleman@oracle.com>
Tue, 16 Jun 2015 08:01:42 -0700
branchs11-update
changeset 4487 ec7d06d6b64e
parent 3778 35735ffdda43
child 5632 4056b7992034
permissions -rw-r--r--
15822919 SUNBT7204858 Upgrade UnixODBC to 2.3.1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     1
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     2
                Userland Consolidation Packaging Guidelines.
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     3
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     4
	Each component that integrates into the Userland consolidation must have at
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     5
least one package manifest that describes the content to be delivered.  In some
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     6
cases components *may* deliver through multiple packages.  Canonical component
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     7
package manifests must be placed in the component's build directory.  They also
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     8
must be named *.p5m.
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     9
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    10
    In order to understand what must go in the content of a package manifest,
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    11
it's useful to have an understanding of how a canonical manifest is transformed
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    12
into a final manifest used for package publication.  Manifest transformation
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    13
takes the following basic path:
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    14
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    15
    canonical manifest
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    16
    (.../{component}/{component}.p5m)
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    17
            |
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    18
            v
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    19
    mogrified manifest
166
db8a55996482 6979538 /usr/share/gettext/po/Rules-quot contains garbage
Marcel Telka <marcel.telka@oracle.com>
parents: 151
diff changeset
    20
    (.../{component}/{build-dir}/manifest-$(MACH)-{component}.mogrified)
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    21
            |
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    22
            v
181
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
    23
    mangled manifest file contents
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
    24
    (.../{component}/{build-dir}/manifest-$(ARCH)-{component}.mangled)
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
    25
            |
87e11e685b1f 7003927 userland should postprocess packaged files
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 166
diff changeset
    26
            v
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    27
    dependencies generated
166
db8a55996482 6979538 /usr/share/gettext/po/Rules-quot contains garbage
Marcel Telka <marcel.telka@oracle.com>
parents: 151
diff changeset
    28
    (.../{component}/{build-dir}/manifest-$(MACH)-{component}.depend)
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    29
            |
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    30
            v
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    31
    dependencies resolved
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
    32
    (.../{component}/{build-dir}/manifest-$(MACH)-{component}.depend.res)
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    33
            |
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    34
            v
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    35
    manifest validation
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
    36
    (.../{component}/{build-dir}/.linted-$(MACH))
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    37
            |
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    38
            v
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    39
    publication manifest
166
db8a55996482 6979538 /usr/share/gettext/po/Rules-quot contains garbage
Marcel Telka <marcel.telka@oracle.com>
parents: 151
diff changeset
    40
    (.../{component}/{build-dir}/manifest-$(MACH)-{component}.published)
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    41
            |
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    42
            v
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    43
    publication
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    44
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    45
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    46
Canonical Manifest
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    47
    The canonical manifest contains actions that can't otherwise be generated
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    48
    automatically from the data encapsulated in the component Makefile, gate
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    49
    transformations, build tree, and packaging tools.  This includes actions
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    50
    for license information, some path related attributes, legacy actions, 
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
    51
    non-discoverable dependencies, users, groups, drivers, and others.
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    52
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    53
    Actions that are associated with objects that are specific to a single
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    54
    architecture should be tagged with a 'variant.arch' attribute specific to
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    55
    the architecture that applied to the action.  Ex:
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    56
        file path=/usr/lib/$(MACH64)/libx86onlybits.so variant.arch=i386
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    57
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    58
    Actions for editable files must include an appropriate 'preserve' attribute:
151
f9e42a3f7095 7030982 hgk is delivered 444, breaks 'hg view'
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 46
diff changeset
    59
        file path=etc/gnu/a2ps.cfg preserve=true mode=0644
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    60
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    61
    license actions should be placed in the canonical manifest.
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    62
3476
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    63
Manually generated actions
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    64
    * com.oracle.info.description is a terse description of what utilities,
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    65
      libraries and/or services the package provides.  This should be short,
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    66
      specific, concise text, identifying the technology covered by the
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    67
      associated license(s).  It should fit naturally in the sentence "This
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    68
      package may contain XXX."  For example, "XXX" might be "the tar command"
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    69
      or "bzip2 compression software."  When appropriate, this may begin with
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    70
      "portions of" or another, more specific qualifying clause.
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    71
    * com.oracle.info.tpno is the Oracle 3rd party license number.
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    72
    * info.classification is "org.opensolaris.category.2008:FOO" where FOO
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    73
      varies according to the sorts of utilities, libraries and/or services
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    74
      that the package provides.  Existing packages contain most useful
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    75
      values; check them out to find the closest match.  For a complete
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    76
      list of allowed values, refer to the Solaris system file
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    77
      /usr/share/lib/pkg/opensolaris.org.sections .
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    78
    * org.opensolaris.arc-caseid is typically "PSARC/YYYY/###" and multiple
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    79
      different values are allowed.
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    80
    * pkg.summary is a short synopsis of what the package provides.
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    81
    * org.opensolaris.consolidation is the name of the consolidation delivering
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    82
      the package.  In Userland, this is $(CONSOLIDATION) (which expands to
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    83
      "Userland" during the build).  Manifests in the Userland gate can also
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    84
      decorate this package attribute with an 'incorporate={incorporation-name}'
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    85
      decoration to specify where the package should be incorporated at the end
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    86
      of the userland build.  A special value of 'none' will cause the package
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    87
      to be unincorporated and float freely from the rest of the rest of the
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    88
      packages.  Note that unincorporated packages don't automatically get
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    89
      updated with the rest of the system when 'pkg update' is run unless the
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    90
      unincorporated package(s) are specified on the command line.
c35c8f1a6df1 18139749 userland-incorporator should allow generation of multiple incorporations
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents: 2584
diff changeset
    91
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    92
Mogrified Manifest
166
db8a55996482 6979538 /usr/share/gettext/po/Rules-quot contains garbage
Marcel Telka <marcel.telka@oracle.com>
parents: 151
diff changeset
    93
    The canonical manifest is combined with a set of the transforms
db8a55996482 6979538 /usr/share/gettext/po/Rules-quot contains garbage
Marcel Telka <marcel.telka@oracle.com>
parents: 151
diff changeset
    94
    in $(WS_TOP)/transforms, and a set of macros to more complete
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    95
    package manifest using pkgmogrify(1).  The transforms apply default
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    96
    attributes to the various actions in the canonical manifest(s).  More
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    97
    detail about the attributes can be found in the transform file themselves.
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    98
    The macros applied at the time of mogrification are as follows:
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    99
        $(MACH)
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   100
        $(MACH32)
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   101
        $(MACH64)
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   102
        $(PUBLISHER)
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   103
        $(CONSOLIDATION)
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   104
        $(BUILD_VERSION)
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   105
        $(SOLARIS_VERSION)
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   106
        $(OS_VERSION)
166
db8a55996482 6979538 /usr/share/gettext/po/Rules-quot contains garbage
Marcel Telka <marcel.telka@oracle.com>
parents: 151
diff changeset
   107
        $(IPS_COMPONENT_VERSION)
db8a55996482 6979538 /usr/share/gettext/po/Rules-quot contains garbage
Marcel Telka <marcel.telka@oracle.com>
parents: 151
diff changeset
   108
        $(COMPONENT_VERSION)
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   109
        $(COMPONENT_PROJECT_URL)
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   110
        $(COMPONENT_ARCHIVE_URL)
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   111
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   112
Dependencies Generated
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   113
    The mogrified manifest and the prototype install tree are passed through
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   114
    pkgdepend(1) to generate a set of dependencies for the package content.
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   115
    These dependencies are only those that "pkgdepend generate" can determine
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
   116
    on its own.  Additional dependencies that cannot be automatically
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   117
    determined by pkgdepend(1) should be placed in the canonical manifest.
166
db8a55996482 6979538 /usr/share/gettext/po/Rules-quot contains garbage
Marcel Telka <marcel.telka@oracle.com>
parents: 151
diff changeset
   118
    Statically defined dependencies should be described in a canonical manifest
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   119
    in an unresolved form (ie. the form generated by "pkgdepend generate").
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   120
    Ex:
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   121
	    depend fmri=__TBD pkg.debug.depend.file=etc/passwd \
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   122
		        pkg.debug.reason=usr/bin/vipw type=require
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   123
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   124
        depend fmri=__TBD pkg.debug.depend.file=sh \
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   125
                pkg.debug.depend.path=usr/bin \
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   126
                pkg.debug.depend.reason=usr/bin/psmandup \
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   127
                pkg.debug.depend.type=script type=require
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   128
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   129
    This will allow the next step to resolve all dependencies to their proper
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   130
    package(s).
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   131
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   132
Dependencies Resolved
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
   133
    The manifest with unresolved dependencies is passed through pkgdepend(1)
2584
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   134
    again to resolve dependencies against the package repositories.  The result
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   135
    is a manifest that is suitable for publication.  All these manifests are
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   136
    processed together in a single step, which is more efficient than resolving
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   137
    dependencies in each manifest separately.  While each manifest ends up with
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   138
    a .depend.res copy in the build directory, the umbrella dependency
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   139
    resolution target is {build-dir}/.resolved-$(MACH).
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   140
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   141
    The resolution step is also set up to use the -e flag to pkgdepend resolve,
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   142
    which limits the set of packages it looks at to resolve the dependencies it
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   143
    generated in the previous step.  This makes the resolution step a great deal
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   144
    faster, but requires that you keep a static list of these packages checked
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   145
    into the workspace, and update it when packages are added to it.  Having
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   146
    extra packages in there is safe.
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   147
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   148
    In order to create this list, build and publish your component (or at least
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   149
    through the resolution stage) without a file "resolve.deps" in the component
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   150
    directory, and run "gmake sample-resolve.deps".  If the file is empty (that
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   151
    is, no computed dependencies were found), a warning will be emitted and the
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   152
    file will be removed, as pkgdepend currently errors out in that case.
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   153
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   154
    To test, run "gmake clean" and re-publish.
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   155
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   156
    Don't forget to "hg add resolve.deps"!
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   157
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   158
    Note that there is a possibility the list of dependencies will be different
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   159
    on different architectures, so you should run this on both sparc and x86,
ad7971db6ec0 15960689 pkgdepend resolve takes longer than it might
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents: 255
diff changeset
   160
    and combine the two lists.  Please keep the files sorted.
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   161
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   162
Manifest Validation
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   163
    The resolved manifest(s) and prototype install tree are passed through
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   164
    a set of validations.  This includes running pkglint(1), comparing the
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   165
    manifest content to the prototype install tree, and validation of the file
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
   166
    content of the prototype install tree.  Any anomalies are reported.
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   167
    Content validation is performed by extension to pkglint(1) in
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   168
    $(WS_TOP)/tools/python/userland-lint
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   169
3778
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   170
    Note that when integrating new packages, and one or more of them depends
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   171
    on or more of the others, then this may result:
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   172
        WARNING pkglint.action005.1      obsolete dependency check skipped:
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   173
            unable to find dependency (target pkg) for (source pkg)
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   174
    This means that the target package was not found in the reference repo,
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   175
    which was the source of the pkglint cache that was created when 'gmake
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   176
    setup' was run after the workspace was created; thus the warning is
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   177
    harmless and can be ignored in this circumstance.
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   178
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   179
Publication.
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   180
    Once manifest validation has occurred, the package(s) is/are finally
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   181
    published to the workspace package repository.
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   182
3778
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   183
Renames
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   184
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   185
    Renames in IPS are tricky.  We will use a case study to illustrate how
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   186
    this needs to work.
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   187
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   188
    All of the library/python-2/FOO modules that we had in Userland at the
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   189
    time were renamed to library/python/FOO in s12_41.  This involved:
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   190
    * changing the FMRI to drop the "-2"
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   191
    * adding an optional dependency on the old name at the version and build
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   192
      in which the rename occurred; this forces the rename
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   193
      * depend type=optional fmri=library/python-2/FOO-$(PYV)@VERSION,BUILD
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   194
      where FOO is the component name (e.g., "alembic", "amqp", etc.),
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   195
      "$(PYV)" is that literal string, VERSION was the expanded value of
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   196
      COMPONENT_VERSION from each component's Makefile (e.g., "0.6.0"
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   197
      for alembic, "1.0.12" for amqp, etc.), and BUILD was set to
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   198
      "5.12-5.12.0.0.0.41.0".  Note that BUILD needs to be set to
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   199
      the value of the build you are integrating into.
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   200
    * one or more new manifests (typically one for the versionless package,
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   201
      plus one for each versioned instance of the package) with actions:
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   202
      * set name=pkg.fmri value=pkg:/library/python-2/FOO@VERSION,BUILD
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   203
      * set name=pkg.renamed value=true
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   204
      * set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   205
      * depend fmri=library/python/FOO type=require
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   206
      where FOO, VERSION and BUILD are all as above.
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   207
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   208
    So far, not too bad.  This gets slightly more complicated when back-
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   209
    porting in that BUILD needs to be set to the back-port build (e.g.,
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   210
    "5.11-0.175.3.0.0.8.0", as was the case for tkinter-27) rather than
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   211
    the S12 build.
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   212
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   213
    If the component is at the same version as when the rename was done, then
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   214
    that's it.  But if the component has since been upgraded, then care must
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   215
    be taken to set VERSION in both places above to the value that it was in
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   216
    s12_41 when the rename was originally done.  In particular, the latest
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   217
    version of a package name in an earlier release branch must not be greater
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   218
    than the latest version of that same package name in the newer release
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   219
    branch.  Otherwise the audits from Release Engineering will complain and
35735ffdda43 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents: 3476
diff changeset
   220
    our gatekeeper will make you do a follow-up push to fix this.
46
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   221
d4d60962c33f generate detectable dependencies at build time
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   222
# vi:set fdm=marker expandtab ts=4: