Creating and publishing SVR4 and IPS packages

How to Create and Publish an IPS Package

There are different types of IPS packages that can be created. A package is a collection of files, directories, drivers, and dependencies in a defined format. This task shows how to create a package that consists of a directory, a file, a dependency, and a name attribute. The package is then published to the repository using the pkgsend command.


Note – This examples publishes the packages to the default repository,
http://localhost:10000. If you are publishing a package to a repository other than the
default repository, ensure that the repository is created and use the -s option with the
pkgsend command to specify the repository. How to create a new repository, read this blog.


  1. Create a temporary directory on your system.
  2. $ mkdir tmp
  3. Change the directory to the temporary directory.
  4. $ cd tmp
  5. Create a directory called package.
  6. $ mkdir package
  7. Change the directory to package.
  8. $ cd package
  9. Create a text file under the directory package.
  10. $ gedit text_file

    Note - The files can be of any type. This example uses a text file.

  11. Export the directory package. Specify a version number and a sub-version number for the package. In this example, the package has a version number of 0.5.11 and a subversion number of 5.11-0.101. Note the back quotes used in this command.
  12. $ eval ‘pkgsend open package@1.0-1‘

    Note – Specify the package name, version number and subversion number correctly. This cannot be changed afterwards.

  13. Add attributes to the package. In this task you add a directory action with attributes of mode, owner, group, and path. Path is the key attribute for the directory action and has to be specified.
  14. $ pkgsend add dir mode=0555 owner=root group=bin path=/etc/package
  15. Add the file text_file under the package directory.
  16. $ pkgsend add file package/text_file
  17. Add attributes to the file. In this example, you add the file action with the attributes of mode, owner, group, and path. Path is the key attribute for the file action and has to be specified.
  18. $ pkgsend add file package/text_file mode=0555 owner=root group=bin
    path=/etc/package

    Note – Actions can also be included in a file. This file can then be added to the current transaction by using the pkgsend include command.

    Note – The path attribute specifies the directory where the file will be created. This path should exist on the IPS client although it can be different from the file's location on the IPS server.

  19. We have now created a package package consisting of a directory and a file.
  20. We will add a dependency for this package and set a name attribute.
    $ pkgsend add depend fmri=pkg:/depends_on_this_package@0.5.11,5.11-0.101 type=require
    $ pkgsend add set name=description value="Example Package"

    Note – If the resources have been specified in a file, use the pkgsend include resource_filename command instead of the pkgsend add command, to add the resources to the current transaction.

  21. Use the following option to close the transaction.
  22. $ pkgsend close

Creating and Publishing a Simple Package

Example 1

This example uses the pkgsend command to create and publish a package.

$ eval ‘pkgsend open package@0.5.11,5.11-0.101‘
$ pkgsend add file package mode=0555 owner=root group=bin path=/usr bin/package
$ pkgsend close
Example 2

This example shows how to publish installed application nano.

Configure and install nano, e.g. into directory nano. In this directory run:

$ eval `pkgsend open nano@1.0-1`
$ for ITEM in `find .`; do if [ -d "$ITEM" ]; then pkgsend add dir mode=0555 owner=root group=bin path=`echo $ITEM | sed s%\\./%%`; else pkgsend add file "$ITEM" mode=0555 owner=root group=bin path=` echo $ITEM | sed s%\\./%%`;fi;done
$ pkgsend close
  

How to Publish SVR4 Packages to Your Repository

SVR4 packages can be installed directly on your system by using the pkgadd and related commands.

SVR4 packages can be published to the IPS repository by using the pkgsend command.

  1. Open the transaction.
  2. $ eval ‘pkgsend open svr4pkg‘
  3. Include the manifest associated with the SVR4 package.
  4. $ pkgsend include ips-manifest-with-metadata
  5. Import the package.
  6. pkgsend import svr4pkg
  7. Close the transaction.
  8. pkgsend close
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Solaris l10n & i18n, locales, keyboards, fonts and related topics.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today