User Commands                                          PKGTOOL(1)



NAME
     pkgtool - Helper Script for pkgbuild(1)


SYNOPSIS
     pkgtool [OPTIONS] command spec...


DESCRIPTION
     pkgtool is  a  helper  script  for  performing  builds  from
     pkgbuild(1) spec files (build recipes).


OPTIONS
  General
     -v or --verbose
          Increase verbosity: the more -v's the  more  diag  mes-
          sages.

     -q or --quiet
          Silent operation.

     --halt-on-errors
          Halt on the first build error, do not attempt  to  con-
          tinue.

     --rcfile=file
          Read  default  configuration   from   file.    Default:
          ./.pkgtoolrc, ~/.pkgtoolrc

     --norc
          Ignore the default rc files.

     --dumprc
          Print the current configuration in  a  format  suitable
          for an rc file, then exit.

     --download
          Automatically download sources  if  not  found  in  the
          local  search paths (requires wget)  Specify your proxy
          servers using the http_proxy and ftp_proxy  environment
          variables.

     --download-to=dir
          Save downloaded files in dir.  By  default,  files  are
          downloaded  to  /storage/pkgs/SOURCES.  Implies --down-
          load.

     --interactive     [EXPERIMENTAL]
          Interactive mode: pkgbuild(1) output  is  displayed  on
          the   standard   output;  pkgbuild(1)  is  executed  in
          interactive mode which makes it start a subshell if the



SunOS 5.10          Last change: May 18, 2010                   1






User Commands                                          PKGTOOL(1)



          build fails

     --ips
          Install IPS packages by  default  to  local  repository
          http://localhost:80/

     --svr4
          Install SVr4 packages by default.

     --rmlog
          Automatically remove the log file with each build

     --dry-run
          (Download mode) test if the Source  urls  in  the  spec
          file(s)  point  to  existing files, but do not download
          them.

  Directories and search paths:
     --specdirs=path or --spec=path
          Specify a colon separated list of directories to search
          for spec files in

     --tarballdirs=path or --tarballs=path or --tar=path
          Specify a colon separated list of directories to search
          for tarballs in

     --sourcedirs=path or --src=path
          Specify a colon separated list of directories to search
          for  additional  source  files  in  --patchdirs=path or
          --patches=path  or   --patch=path   Specify   a   colon
          separated  list  of  directories  to search for patches
          (source diffs) in --topdir=dir Use dir as the rpm  base
          directory (aka %topdir, where the SPECS, SOURCES, RPMS,
          SRPMS, BUILD directories are found).  Default:  ~/pack-
          ages

     --logdir=dir or --log=dir
          Write build logs to dir.


  Options controlling the build:
     --update
          Update  packages  that  are  already  installed.    The
          default bevavior is to skip them.

     --update-if-newer
          Update packages that are already installed only if  the
          version  in  the  spec file (Version tag) is newer than
          the version of the package.  The default bevavior is to
          skip packages that are already installed.

     --nodeps / --deps
          Ignore/verify dependencies before building a component.
          Default: --deps

     --autodeps



SunOS 5.10          Last change: May 18, 2010                   2






User Commands                                          PKGTOOL(1)



          Attempt to find spec files for missing dependencies  in
          spec  file search path (see --specdirs) and add them to
          the build as needed.

     --with foo or --with-foo / --without foo or --without-foo
          These options are passed on to pkgbuild(1) as is.  They
          are   used  for  enabling/disabling  conditional  build
          options.

     --target=arch
          This option is passed on to pkgbuild(1) as is.

     --pkgformat=format
          Create packages in the specified format,  where  format
          is one of:

              ips  Image Packaging System package format (default
                   on IPS-based systems)

              filesystem or fs
                   SVr4 filesystem  package  format  (default  on
                   SVr4-based systems)

              datastream or ds
                   SVr4 datastream package format


  Reporting:
     --notify / --nonotify
          Send desktop notifications when the  build  of  a  spec
          file passes or fails.  Default: --notify

     --mail-errors-to=address
          Send the last few lines of the build log to address  if
          the build fails

     --report=file
          Write  a  build  report  to  file  (in   HTML   format)
          --prodname=string The name of the product as appears in
          the build report

     --full-path
          Print  the  full  path  to  the  package  when  running
          install-order


  Commands:
     build-install
          Build and install the specs listed on the command line.
          The  build  order  is  determined  by  the dependencies
          defined in the spec files.




SunOS 5.10          Last change: May 18, 2010                   3






User Commands                                          PKGTOOL(1)



     build
          Same as build-install

     build-only
          Build the specs  listed  on  the  command  line,  don't
          install them.

     prep run the %prep section of the spec files listed  on  the
          command line

     spkg create source package(s) only (no build done)

     publish-pkgs
          publish the previously build packages to an IPS reposi-
          tory

     build-order
          Print the build order of the specs listed on  the  com-
          mand line.

     install-order
          Print the rpms in the order they should be installed

     install-pkgs
          install the packages defined by the spec  files  listed
          on  the command line from the PKGS directory.  No build
          is done.  Useful to install packages  previously  built
          using  the  build-only command, or built manually using
          pkgbuild.

     uninstall-pkgs
          Uninstall all packages defined in the spec files listed
          on the command line.

     download
          Download the source files from the  URLs  specified  in
          the  spec  files  listed  on  the command line.  Source
          files found in the local search paths will not be down-
          loaded.       (See     --tarballdirs,     --sourcedirs,
          --download-to)  Use the --dry-run option to test if the
          URLs  point  to  existing files but without downloading
          them.


  Spec Files
     specs...
          List of spec files to build. Either full path names  or
          names of spec files in the spec directory search path.

          Spec files are build  recipes,  similar  to  rpmbuild's
          spec  files  on  Linux  systems.  You can find detailed
          information       about       spec       files       in
          /usr/share/doc/pkgbuild/spec-files.txt




SunOS 5.10          Last change: May 18, 2010                   4






User Commands                                          PKGTOOL(1)



  ENVIRONMENT VARIABLES
     PKGBUILD_IPS_SERVER
          Set this variable to specify the URL for the IPS server
          to publish binary packages to.  Example:
          PKGBUILD_IPS_SERVER=http://myserver:9000/;       export
          PKGBUILD_IPS_SERVER

     PKGBUILD_SRC_IPS_SERVER
          URL for the IPS server to publish source  packages  to.
          Defaults to PKGBUILD_IPS_SERVER.


CONFIGURATION
     All command line options can be configured in the .pkgtoolrc
     configuration  file.   pkgtool  looks  for .pkgtoolrc in the
     current directory first, then in the user's home  directory.
     A  well  documented  configuration file template can be gen-
     erated using the --dumprc option:

     pkgtool --dumprc > ~/.pkgtoolrc

     Lines starting with # are comments.  Configuration  settings
     are colon-separated key-value pairs, for example:

     tarballdirs: /export/tarballs:/net/otherhost/export/tarballs

     Use the --dumprc option to obtain a  list  of  configuration
     options and their documentation.

     Values can use the ${MYDIR} variable to reference the direc-
     tory the .pkgtoolrc file is located in.


EXAMPLES
     Example 1: given a directory full of  spec  files,  download
     all source URLs defined in the spec files:

     pkgtool download *.spec

     Example 2: build and install all spec files in  the  current
     directory:

     pkgtool -v build *.spec

     Example 3: download a sources and build foo.spec with  debug
     options (note: assumes that foo.spec supports --with-debug).
     The resulting package(s) will not be installed.

     pkgtool build-only --download --with-debug foo.spec






SunOS 5.10          Last change: May 18, 2010                   5






User Commands                                          PKGTOOL(1)



EXIT STATUS
     The following exit values are returned:


     0    SUCCESS (command passed for all spec files)

     >0   FAILURE (the number of spec files that failed)


FILES
     /usr/bin/pkgtool
          executable for pkgtool

details
     configuration file for pkgtool, see the CONFIGURATION section for
          %macro_name value


ATTRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:

     __________________________________________
    |   ATTRIBUTE TYPE    |  ATTRIBUTE VALUE  |
    |_____________________|___________________|
    | Availability        |  package/pkgbuild |
    |_____________________|___________________|
    | Interface Stability |  Volatile         |
    |_____________________|___________________|


SEE ALSO
     Spec  file  description   in 
     /usr/share/doc/pkgbuild/spec-files.txt

     attributes(5), pkgbuild(1), spectool(1), pkg(5), pkgmk(1)


NOTES
     Written by Laszlo (Laca) Peter, Oracle Corporation, 2010















SunOS 5.10          Last change: May 18, 2010                   6