xref: /illumos-gate/usr/src/pkg/README.pkg (revision 41c859f9)
1ead1f93eSLiane Praza#
2ead1f93eSLiane Praza# CDDL HEADER START
3ead1f93eSLiane Praza#
4ead1f93eSLiane Praza# The contents of this file are subject to the terms of the
5ead1f93eSLiane Praza# Common Development and Distribution License (the "License").
6ead1f93eSLiane Praza# You may not use this file except in compliance with the License.
7ead1f93eSLiane Praza#
8ead1f93eSLiane Praza# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9ead1f93eSLiane Praza# or http://www.opensolaris.org/os/licensing.
10ead1f93eSLiane Praza# See the License for the specific language governing permissions
11ead1f93eSLiane Praza# and limitations under the License.
12ead1f93eSLiane Praza#
13ead1f93eSLiane Praza# When distributing Covered Code, include this CDDL HEADER in each
14ead1f93eSLiane Praza# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15ead1f93eSLiane Praza# If applicable, add the following below this CDDL HEADER, with the
16ead1f93eSLiane Praza# fields enclosed by brackets "[]" replaced with your own identifying
17ead1f93eSLiane Praza# information: Portions Copyright [yyyy] [name of copyright owner]
18ead1f93eSLiane Praza#
19ead1f93eSLiane Praza# CDDL HEADER END
20ead1f93eSLiane Praza#
21ead1f93eSLiane Praza
22ead1f93eSLiane Praza#
23ebbab6bbSDan Price# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24ead1f93eSLiane Praza#
25ead1f93eSLiane Praza
26ead1f93eSLiane PrazaIntroduction
27ead1f93eSLiane Praza------------
28ead1f93eSLiane Praza
29ead1f93eSLiane PrazaThis README describes some basics about creating, modifying, and
30ead1f93eSLiane Prazabuilding packages in ON.  All package creation in ON is done using
31ead1f93eSLiane Prazatools available to our customers.  If terminology in this document
32bbf21555SRichard Loweis confusing, you may wish to review the pkg(7) manpage.
33ead1f93eSLiane Praza
34ead1f93eSLiane PrazaPackaging Overview
35ead1f93eSLiane Praza------------------
36ead1f93eSLiane Praza
3777c29b8eSRichard Loweusr/src/pkg/ contains the definitions and rules needed to build an IPS
3877c29b8eSRichard Lowerepository which contain the deliverables from an ON build.
39ead1f93eSLiane Praza
40ead1f93eSLiane PrazaThe manifests directory contains all manifests, and has one file
41ead1f93eSLiane Prazaper package.  For most packaging changes you only need to add or
42ead1f93eSLiane Prazachange the packaging manifests themselves.
43ead1f93eSLiane Praza
4477c29b8eSRichard LoweThe build rules create a package repository.  Separate DEBUG and
4577c29b8eSRichard Lowenon-DEBUG versions are built, and are available at:
4677c29b8eSRichard Lowe    $CODEMGR_WS/packages/$MACH/nightly[-nd]/repo.redist
47ead1f93eSLiane Praza
48ead1f93eSLiane PrazaBuilding Packages
49ead1f93eSLiane Praza-----------------
50ead1f93eSLiane Praza
5177c29b8eSRichard LoweThe -p option to nightly will build the IPS repository.
52ead1f93eSLiane Praza
53ead1f93eSLiane PrazaAlternatively, in usr/src/pkg/Makefile there are make targets for:
54ead1f93eSLiane Praza
55ead1f93eSLiane Praza	all
56ead1f93eSLiane Praza	    Process manifests into their final form with unresolved
57ead1f93eSLiane Praza	    dependencies before publication.
58ead1f93eSLiane Praza
59ead1f93eSLiane Praza	install
60ead1f93eSLiane Praza	    Publish packages.
61ead1f93eSLiane Praza
62ead1f93eSLiane Praza	gendeps
63ead1f93eSLiane Praza	    Run `pkgdepend resolve`.  See Dependencies section.
64ead1f93eSLiane Praza
65ead1f93eSLiane Praza	protocmp
66ead1f93eSLiane Praza	    Compare the proto area against package definitions for
67ead1f93eSLiane Praza	    missing or incorrect files.
68ead1f93eSLiane Praza
69ead1f93eSLiane Praza	pmodes
70ead1f93eSLiane Praza	    Check file and directory modes for best practices.
71ead1f93eSLiane Praza
72ead1f93eSLiane Praza	check
73ead1f93eSLiane Praza	    Run protocmp and pmodes.
74ead1f93eSLiane Praza
75ead1f93eSLiane PrazaThe build behavior may modified by the following variables:
76ead1f93eSLiane Praza
77ead1f93eSLiane Praza	SUPPRESSPKGDEP
78ead1f93eSLiane Praza	    If SUPPRESSPKGDEP is set to "true" in your environment,
79ead1f93eSLiane Praza	    package dependencies will not be generated.  This variable
80ead1f93eSLiane Praza	    should not be set in normal builds as it will mask product
81ead1f93eSLiane Praza	    bugs.
82ead1f93eSLiane Praza
83ead1f93eSLiane Praza	PKGDEBUG
84ead1f93eSLiane Praza	    If PKGDEBUG is set in your environment, $MAKE will print
85ead1f93eSLiane Praza	    detailed information about the commands it executes to
86ead1f93eSLiane Praza	    process and publish packages.
87ead1f93eSLiane Praza
88ead1f93eSLiane PrazaA set of intermediate build products are placed in
89ead1f93eSLiane Prazausr/src/pkg/packages.$MACH/.  These can be useful during development.
90ead1f93eSLiane Praza
91ead1f93eSLiane Praza	.mog
92ead1f93eSLiane Praza	    The resulting package manifest after running pkgmogrify(1)
93ead1f93eSLiane Praza	    on the supplied manifest.  See below for details on
94ead1f93eSLiane Praza	    pkgmogrify(1) use in ON.
95ead1f93eSLiane Praza
96ead1f93eSLiane Praza	.dep
97ead1f93eSLiane Praza	    The resulting manifest after running `pkgdepend generate`
98ead1f93eSLiane Praza	    on the .mog manifest.
99ead1f93eSLiane Praza
100ead1f93eSLiane Praza	.res
101ead1f93eSLiane Praza	    The resulting manifest after running `pkgdepend resolve`
102ead1f93eSLiane Praza	    on the .dep manifest.
103ead1f93eSLiane Praza
104ead1f93eSLiane PrazaIncremental Builds
105ead1f93eSLiane Praza------------------
106ead1f93eSLiane Praza
107ead1f93eSLiane Praza   If you want to process a subset of manifests, simply set PKGS on the
108ead1f93eSLiane Praza   make command line and specify the "all" target.  If you want to process
109ead1f93eSLiane Praza   them all, simply specify the "all" target.
110ead1f93eSLiane Praza
11125b05a3eSAndy Fiddaman	% dmake -e PKGS="BRCMbnx BRCMbnxe" all
112ead1f93eSLiane Praza	% dmake -e all
113ead1f93eSLiane Praza
114ead1f93eSLiane Praza   If you want to publish a subset of packages, simply set PKGS on the
115ead1f93eSLiane Praza   make command line and specify the "install" target.  Overriding PKGS
116ead1f93eSLiane Praza   will cause dependency resolution to be limited to PKGS from the
117ead1f93eSLiane Praza   current build, with a fallback to packages installed on the build
118ead1f93eSLiane Praza   system.  If you want to publish them all, simply specify the
119ead1f93eSLiane Praza   "install" target.
120ead1f93eSLiane Praza
12125b05a3eSAndy Fiddaman	% dmake -e PKGS="BRCMbnx BRCMbnxe" install
122ead1f93eSLiane Praza	% dmake -e install
123ead1f93eSLiane Praza
124ead1f93eSLiane Praza   You can also use package names, or package names with ".pub"
125ead1f93eSLiane Praza   extensions, as build targets.  This will cause processing or
126ead1f93eSLiane Praza   publication of the specified package(s).
127ead1f93eSLiane Praza
128ead1f93eSLiane Praza   The on-disk repository will be initialized when it does not exist,
129ead1f93eSLiane Praza   or when you run nightly -p.  If you build incrementally,
130ead1f93eSLiane Praza   packages will simply be added to the existing repository.
131ead1f93eSLiane Praza
132ead1f93eSLiane Praza   To do cross-platform packaging, prefix your target with (for
133*708bde8cSGarrett D'Amore   example) "i386/", as in "dmake i386/install".  Note that we
134ead1f93eSLiane Praza   currently pull some license files directly from a built source
135ead1f93eSLiane Praza   tree, so if you do this in a workspace that had proto area copied
136ead1f93eSLiane Praza   in via nightly -U, then you'll need to set $SRC to point to the
137ead1f93eSLiane Praza   workspace that was actually built.
138ead1f93eSLiane Praza
139ead1f93eSLiane PrazaTesting Packages
140ead1f93eSLiane Praza----------------
141ead1f93eSLiane Praza
14277c29b8eSRichard LoweTo test the generated repository, you should use the "onu" tool
143ead1f93eSLiane Prazaavailable from /opt/onbld/bin or usr/src/tools/scripts/ to setup and
144ead1f93eSLiane Prazaupgrade your system.  A manpage is available in /opt/onbld/man
145ead1f93eSLiane Prazaor usr/src/tools/scripts/onu.1.
146ead1f93eSLiane Praza
147bbf21555SRichard LoweAlternatively, you can manually start a pkg.depot(8) server to
14877c29b8eSRichard Loweserve the generated repository to multiple test machines.
149ead1f93eSLiane Praza
150ead1f93eSLiane Praza	Start up a depot on your build machine.
151ead1f93eSLiane Praza	    cd $CODEMGR_WS/packages/$MACH/nightly[-nd]
152ead1f93eSLiane Praza	    /usr/lib/pkg.depotd -d repo.redist -p <port> &
153ead1f93eSLiane Praza
154ead1f93eSLiane Praza	    Make SURE you choose an unused port and the depot
155ead1f93eSLiane Praza	    starts successfully.
156ead1f93eSLiane Praza
157ead1f93eSLiane Praza	    The depot can be started across NFS as well if you
158ead1f93eSLiane Praza	    have a fast pipe.
159ead1f93eSLiane Praza
160ead1f93eSLiane Praza	Configure your test system.
161ead1f93eSLiane Praza	    pkg set-publisher -P -g http://<your server host>:<port> on-nightly
162ead1f93eSLiane Praza	    pkg set-publisher --non-sticky opensolaris.org
163ead1f93eSLiane Praza	    pkg uninstall entire
164ead1f93eSLiane Praza
165ead1f93eSLiane Praza	pkg image-update your test system.
166ead1f93eSLiane Praza	    pkg image-update will upgrade all packages on your test system
167ead1f93eSLiane Praza
168ead1f93eSLiane PrazaAlways make sure your bits are installed with image-update.
169ead1f93eSLiane Praza	Check your versions.
170ead1f93eSLiane Praza	    pkg info osnet-incorporation
171ead1f93eSLiane Praza
172ead1f93eSLiane Praza	Multiple packages should be updated.
173ead1f93eSLiane Praza	    If you did a full build, all ON packages will be updated.
174ead1f93eSLiane Praza	    When image-update tells you that only one or two packages has
175ead1f93eSLiane Praza	    been updated, you likely did not get the updates you expected.
176ead1f93eSLiane Praza
177ead1f93eSLiane PrazaThere are various tactics for troubleshooting a failed upgrade.
178ead1f93eSLiane Praza	Make sure entire is uninstalled.
179ead1f93eSLiane Praza
180ead1f93eSLiane Praza	pkg install -nv osnet-incorporation@<your version>
181ead1f93eSLiane Praza	    Ask IPS to explicitly check if ON can be installed, and
182ead1f93eSLiane Praza	    if it can't, tell you why not.
183ead1f93eSLiane Praza
184ead1f93eSLiane Praza	Obsolete and renamed packages can cause trouble.
185ead1f93eSLiane Praza	    pkg search -l ::pkg.renamed:true
186ead1f93eSLiane Praza	    pkg search -l ::pkg.obsolete:true
187ead1f93eSLiane Praza
188ebbab6bbSDan Price
189ead1f93eSLiane PrazaMaking Packaging Changes
190ead1f93eSLiane Praza------------------------
191ead1f93eSLiane Praza
192ead1f93eSLiane PrazaPackage definitions are in usr/src/pkg/manifests/, and have one
193ead1f93eSLiane Prazafile per package, including for multi-architecture packages.  For
194ead1f93eSLiane Prazamost packaging changes you only need to add or change the packaging
195ead1f93eSLiane Prazamanifests themselves.  No packaging metadata may be kept outside of the
196ead1f93eSLiane Prazamanifests. If you find yourself needing to modify usr/src/pkg/Makefile,
197ead1f93eSLiane Prazayou're almost certainly doing something wrong.
198ead1f93eSLiane Praza
199ead1f93eSLiane PrazaRemember that the "check" target is available to check many of
200ead1f93eSLiane Prazayour packaging changes.
201ead1f93eSLiane Praza
202ead1f93eSLiane PrazaWe run pkgmogrify(1) over the manifests before publication.  This
203ead1f93eSLiane Prazaallows us to apply a set of macros and package transformations in
204ead1f93eSLiane Prazaorder to make the manifests themselves easier to maintain.
205ead1f93eSLiane Praza
206ead1f93eSLiane PrazaWe supply a set of commonly-used macros for use in package manifests.
207ead1f93eSLiane PrazaThese are the PKGMOG_DEFINES in usr/src/pkg/Makefile.
208ead1f93eSLiane Praza
209ead1f93eSLiane Praza	$(i386_ONLY)
210ead1f93eSLiane Praza	$(ARCH)
211ead1f93eSLiane Praza	$(ARCH32)
212ead1f93eSLiane Praza	$(ARCH64)
213ead1f93eSLiane Praza	$(PKGVERS), which is set to
2144b9a859aSMarcel Telka	   $(PKGVERS_COMPONENT),$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
215ead1f93eSLiane Praza
216ead1f93eSLiane Prazapkgmogrify(1) also allows us to include a set of default transformations.
217ead1f93eSLiane PrazaThe definitions for these transforms are in usr/src/pkg/transforms/.  An
218ead1f93eSLiane Prazaoverview of their use is supplied here, but for a full accounting, please
219ead1f93eSLiane Prazaread pkmogrify(1) and the files themselves.
220ead1f93eSLiane Praza
221ead1f93eSLiane Praza	defaults
222ead1f93eSLiane Praza	    This transform is applied to all manifests.  It specifies
223ead1f93eSLiane Praza	    a set of sensible default permissions, a set of
224ead1f93eSLiane Praza	    directory locations for which the reboot-needed actuator
225ead1f93eSLiane Praza	    is always applied to files, and some other basic defaults.
226ead1f93eSLiane Praza
227ead1f93eSLiane Praza	publish
228ead1f93eSLiane Praza	    This transform is applied to all manifests.  It ensures
229ead1f93eSLiane Praza	    that manifest lines which don't apply to the current
23077c29b8eSRichard Lowe	    architecture are stripped.
231ead1f93eSLiane Praza
232ead1f93eSLiane Praza	restart_fmri
233ead1f93eSLiane Praza	    This transform is applied to all manifests.  It modifies
234ead1f93eSLiane Praza	    all package manifest lines for SMF manifests in standard
235ead1f93eSLiane Praza	    locations to include an actuator which runs manifest-import
236ead1f93eSLiane Praza	    on installation/update/removal, as well as some others.  If
237ead1f93eSLiane Praza	    you're adding a new class of file that would benefit from
238ead1f93eSLiane Praza	    a restart or refresh of a specific SMF service, please add
239ead1f93eSLiane Praza	    it here.
240ead1f93eSLiane Praza
241ead1f93eSLiane Praza	extract_metadata
242ead1f93eSLiane Praza	    This transform is applied to all manifests.  It deals with
243ead1f93eSLiane Praza	    manipulations required for packaging metadata like
24477c29b8eSRichard Lowe	    pkg.renamed, and pkg.obsolete.
245ead1f93eSLiane Praza
246ead1f93eSLiane Praza	hollow_zone_pkg
247ead1f93eSLiane Praza	    This transform is available for explicit inclusion in
248ead1f93eSLiane Praza	    some manifests.  It ensures that all contents of the
249ead1f93eSLiane Praza	    package are not installed within a non-global zone, but the
250ead1f93eSLiane Praza	    package and its metadata are available in order to satisfy
251ead1f93eSLiane Praza	    packaging dependencies.
252ead1f93eSLiane Praza
253ead1f93eSLiane Prazapkgmogrify(1) also allows us to use comments and continuation lines
254ead1f93eSLiane Prazain our manifests.
255ead1f93eSLiane Praza
256ead1f93eSLiane PrazaZones and Packages
257ead1f93eSLiane Praza------------------
258ead1f93eSLiane Praza
259bbf21555SRichard Lowepkg(7) uses variants to implement zones.  If a package is marked
260ead1f93eSLiane Prazawith both global and non-global zone variants, the package contents will
261ead1f93eSLiane Prazabe installed in both global and non-global by default.
262ead1f93eSLiane Praza	set name=variant.opensolaris.zone value=global value=nonglobal
263ead1f93eSLiane Praza
264ead1f93eSLiane PrazaSpecific actions within a package can be tagged as applying to only
265ead1f93eSLiane Prazathe global zone or only the non-global zones.
266ead1f93eSLiane Praza
267ead1f93eSLiane PrazaThe hollow_zone_pkg transform described above is also available to
268ead1f93eSLiane Prazasimplify a common packaging scenario.
269ead1f93eSLiane Praza
270ead1f93eSLiane PrazaDependencies
271ead1f93eSLiane Praza------------
272ead1f93eSLiane Praza
273ead1f93eSLiane PrazaPackage dependencies are automatically calculated during build time
274ead1f93eSLiane Prazausing pkgdepend(1).  After you've done a build, you can verify your
275ead1f93eSLiane Prazadependencies in the <package>.res file described above.  If the
276ead1f93eSLiane Prazafile is missing a dependency that you believe could be auto-detected,
277ead1f93eSLiane Prazaplease file a bug against pkgdepend(1).
278ead1f93eSLiane Praza
279ead1f93eSLiane PrazaDependencies can be added manually using the "depend" action.  Please
280ead1f93eSLiane Prazaadd a comment describing why the dependency is required.
281ead1f93eSLiane Praza
282ead1f93eSLiane PrazaMoving Content Between Packages and Removing Content
283ead1f93eSLiane Praza----------------------------------------------------
284ead1f93eSLiane Praza
285bbf21555SRichard Lowepkg(7) tracks when content is removed from packages, and automatically
286ead1f93eSLiane Prazaremoves it.
287ead1f93eSLiane Praza
288ead1f93eSLiane PrazaIf you need to move content between packages, there are two primary
289ead1f93eSLiane Prazathings to do.
290ead1f93eSLiane Praza
291ead1f93eSLiane Praza	"preserve" files must be marked with original_name.
292ead1f93eSLiane Praza	    The first time a "preserve" file moves between packages,
293ead1f93eSLiane Praza	    you must set original_name=<original package>:<file>
294ead1f93eSLiane Praza	    in that file's action.  Subsequent moves do not require
295ead1f93eSLiane Praza	    modification.
296ead1f93eSLiane Praza
297ead1f93eSLiane Praza	Consider adding a dependency on the new package.
298ead1f93eSLiane Praza	    The only way a system will end up with a new package
299ead1f93eSLiane Praza	    after upgrade is if an existing package depends on it.
300ead1f93eSLiane Praza
301ead1f93eSLiane PrazaRenaming a Package
302ead1f93eSLiane Praza------------------
303ead1f93eSLiane Praza
304ead1f93eSLiane PrazaTo rename a package, leave the old package manifest in place, but
305ead1f93eSLiane Prazaempty it of all delivered content.  The old package should include:
306ead1f93eSLiane Praza
307ead1f93eSLiane Praza	set name=pkg.fmri with the version set explicitly to the
308ead1f93eSLiane Praza	    build you're integrating into.  For example, if you wanted
309ead1f93eSLiane Praza	    to rename SUNWrmodu in build 133 you'd change the pkg.fmri
310ead1f93eSLiane Praza	    line to read
311ead1f93eSLiane Praza	    set name=pkg.fmri value=pkg:/SUNWrmodu@0.5.11,5.11-0.133
312ead1f93eSLiane Praza
313ead1f93eSLiane Praza	set name=pkg.renamed value=true
314ead1f93eSLiane Praza
315ead1f93eSLiane Praza	The architectures and variants you're renaming.  These
316ead1f93eSLiane Praza	    should just be copied from your old package, as you
317ead1f93eSLiane Praza	    must rename a package on all architectures and
318ead1f93eSLiane Praza	    variants simultaneously.
319ead1f93eSLiane Praza
320ead1f93eSLiane Praza	A dependency on the new package.
321ead1f93eSLiane Praza
322ead1f93eSLiane PrazaIf there were "preserve" files in the package you're renaming, make
323ead1f93eSLiane Prazasure to create original_name settings in the new package.
324ead1f93eSLiane Praza
325fe57a5b1SMark J. NelsonIf there was a org.opensolaris.noincorp property in the package being
326fe57a5b1SMark J. Nelsonrenamed, make sure you keep it in both the original and the renamed
327fe57a5b1SMark J. Nelsonpackages.
328fe57a5b1SMark J. Nelson
329ead1f93eSLiane PrazaEOFs and Removals
330ead1f93eSLiane Praza-----------------
331ead1f93eSLiane Praza
332ead1f93eSLiane PrazaTo remove files, directories, drivers, or anything else within a package,
333ead1f93eSLiane Prazasimply stop delivering them in the package.  IPS will manage the removal
334ead1f93eSLiane Prazaof no longer delivered content.
335ead1f93eSLiane Praza
336ead1f93eSLiane PrazaPackage removals have impact on the rest of the system.  Before marking
337ead1f93eSLiane Prazaa package as obsolete, search in the OpenSolaris development
338ead1f93eSLiane Prazarepository (http://pkg.opensolaris.org/dev or http://ipkg.sfbay/dev)
339ead1f93eSLiane Prazato find out if any other packages depend on the software you intend
340ead1f93eSLiane Prazato EOF.  If any packages do, you need to coordinate with those
341ead1f93eSLiane Prazaconsolidations.
342ead1f93eSLiane Praza
343ead1f93eSLiane PrazaThe "slim_install" package may depend on ON packages.  If it does,
344ead1f93eSLiane Prazayou must send a FLAG DAY message for ON users and PIT who test
345ead1f93eSLiane Prazainstall.  You must also file an installation bug to get that package
346ead1f93eSLiane Prazaupdated in the same build or earlier than you intend to integrate.
347ead1f93eSLiane PrazaYou should also test install yourself.  You can do this by replacing
348ead1f93eSLiane Prazathe "slim_install" in your Distro Constructor manifest with the
349ead1f93eSLiane Prazaexplicit list of packages to install.
350ead1f93eSLiane Praza
351ebbab6bbSDan PriceTo remove a package, you must mark it as obsolete.  You must *also* mark
352ebbab6bbSDan Priceas obsolete any packages which are renamed ancestors of this package, and
353ebbab6bbSDan Priceremove their rename dependencies.  Here is what you must do.
354ead1f93eSLiane Praza
355ebbab6bbSDan PriceTo find rename ancestors, select all of the manifests which are renames,
356ebbab6bbSDan Pricethen look for the one which was renamed to the package you care about.
357ebbab6bbSDan PriceFor example, to find rename ancestors of 'system/zones', do the following:
358ebbab6bbSDan Price
359ebbab6bbSDan Price    $ cd usr/src/pkg/manifests
360ebbab6bbSDan Price    $ mypkgname=system/zones
36125b05a3eSAndy Fiddaman    $ grep -l "fmri=pkg:/$mypkgname@" `grep -l pkg.renamed *.p5m` /dev/null
36225b05a3eSAndy Fiddaman    SUNWzone.p5m
363ebbab6bbSDan Price
364ebbab6bbSDan PriceMake sure to check that the package has not undergone multiple renames!
365ebbab6bbSDan Price
366ebbab6bbSDan Price    $ mypkgname=SUNWzone
36725b05a3eSAndy Fiddaman    $ grep -l "fmri=pkg:/$mypkgname@" `grep -l pkg.renamed *.p5m` /dev/null
368ebbab6bbSDan Price    $
369ebbab6bbSDan Price
370ebbab6bbSDan PriceOnce you have the renamed ancestor list, for *each* of the packages (the
371ebbab6bbSDan Pricenewly obsolete package, and its renamed ancestors), edit the package as
372ebbab6bbSDan Pricefollows:
373ebbab6bbSDan Price
374ebbab6bbSDan Price	Update 'set name=pkg.fmri' with the version set explicitly to the
375ead1f93eSLiane Praza	    build you're integrating into.  For example, if you wanted
376ead1f93eSLiane Praza	    to remove SUNWwbsd in build 133 you'd change the pkg.fmri
377ebbab6bbSDan Price	    line to read:
378ebbab6bbSDan Price	    'set name=pkg.fmri value=pkg:/SUNWwbsd@0.5.11,5.11-0.133'
379ead1f93eSLiane Praza
380ebbab6bbSDan Price	Add 'set name=pkg.obsolete value=true'.
381ead1f93eSLiane Praza
382ebbab6bbSDan Price	Maintain the architecture and variant declarations in the
383ebbab6bbSDan Price	    package you are obsoleting.  Note that you must obsolete a
384ebbab6bbSDan Price	    package on all architectures and variants simultaneously.
385ebbab6bbSDan Price
386ebbab6bbSDan Price	Delete everything else.
387ebbab6bbSDan Price
388ebbab6bbSDan Price	If the package is a renamed ancestor, leave a comment behind as
389ebbab6bbSDan Price        follows:
390ebbab6bbSDan Price
391ebbab6bbSDan Price	   # Was renamed to <other-pkg-name>, both now obsolete.
392ebbab6bbSDan Price
393ebbab6bbSDan PriceHere is a complete example.  SUNWfoobar was a package which was renamed
394ebbab6bbSDan Priceto system/foobar in build 140, and then later obsoleted in build 150.
395ebbab6bbSDan PriceNote that in all cases the package FMRI is updated to the obsoletion
396ebbab6bbSDan Pricebuild, 150.
397ebbab6bbSDan Price
39825b05a3eSAndy Fiddaman    SUNWfoobar.p5m:
399ebbab6bbSDan Price        # Was renamed to system/foobar, both now obsolete.
400ebbab6bbSDan Price        set name=pkg.fmri value=pkg:/SUNWfoobar@0.5.11,5.11-0.150
401ebbab6bbSDan Price        set name=pkg.obsolete value=true
402ebbab6bbSDan Price        set name=variant.arch value=$(ARCH)
403ebbab6bbSDan Price
40425b05a3eSAndy Fiddaman    system-foobar.p5m:
405ebbab6bbSDan Price	set name=pkg.fmri value=pkg:/system/foobar@0.5.11,5.11-0.150
406ebbab6bbSDan Price	set name=pkg.obsolete value=true
407ebbab6bbSDan Price	set name=variant.arch value=$(ARCH)
408ead1f93eSLiane Praza
409ead1f93eSLiane PrazaCreating a Package
410ead1f93eSLiane Praza------------------
411ead1f93eSLiane Praza
412ead1f93eSLiane PrazaThe easiest thing is to copy a package similar to the one you're
413ead1f93eSLiane Prazatrying to create.  Note that packages are no longer split on the
414ead1f93eSLiane Praza/usr and / boundary.
415ead1f93eSLiane Praza
416ead1f93eSLiane PrazaThe following actions are required for all packages in ON.
417ead1f93eSLiane Praza	set name=pkg.fmri
418ead1f93eSLiane Praza	    Every package must have an FMRI.  That is the package's
419ead1f93eSLiane Praza	    name.
420ead1f93eSLiane Praza
421ead1f93eSLiane Praza	set name=pkg.summary
422ead1f93eSLiane Praza	    Every package must have a short summary of its purpose.
423ead1f93eSLiane Praza
424ead1f93eSLiane Praza	set name=pkg.description
425ead1f93eSLiane Praza	    Every package must have a one-sentence description of
426ead1f93eSLiane Praza	    its purpose.
427ead1f93eSLiane Praza
428ead1f93eSLiane Praza	set name=variant.arch
429ead1f93eSLiane Praza	    Every package must specify which architectures it delivers.
430ead1f93eSLiane Praza
431ead1f93eSLiane Praza	set name=info.classification
432ead1f93eSLiane Praza	    Every package must specify a category for the packaging GUI.
433ead1f93eSLiane Praza	    You must use an existing category, and may not invent new ones.
434ead1f93eSLiane Praza	    Existing categories and their subcategories are listed
435ead1f93eSLiane Praza	    in /usr/share/package-manager/data/opensolaris.org.sections.
436ead1f93eSLiane Praza
437ead1f93eSLiane Praza	license
4386f0673afSYuri Pankov	    All packages must specify a set of license actions.
439ead1f93eSLiane Praza
440ebbab6bbSDan PriceYou don't need to set the following.  They're taken care of for all OS/Net
441ebbab6bbSDan Pricepackages in the transforms/common_actions file.
442ebbab6bbSDan Price
443ebbab6bbSDan Price	set name=variant.opensolaris.zone
444ebbab6bbSDan Price	    Every package must specify whether it can be installed in
445ebbab6bbSDan Price	    global zones, non-global zones, or both.  All ON packages are
446ebbab6bbSDan Price	    delivered in both global and non-global zones.
447ebbab6bbSDan Price
448ebbab6bbSDan Price	set name=org.opensolaris.consolidation value=osnet
449ebbab6bbSDan Price	    All packages from OS/Net come from OS/Net...
450ebbab6bbSDan Price
451ead1f93eSLiane PrazaDrivers and Packages
452ead1f93eSLiane Praza--------------------
453ead1f93eSLiane Praza
454ead1f93eSLiane PrazaScripting is no longer required to deal with addition or removal of
455ead1f93eSLiane Prazadrivers in ON.  A "driver" action should be specified for each driver,
456ead1f93eSLiane Prazaand IPS will handle updates to all the driver files.
457