User Commands PKGTOOL(1)
NAME
spectool - A tool for extracting information from
pkgbuild(1) spec files
SYNOPSIS
spectool [OPTIONS] command spec...
DESCRIPTION
spectool is a tool that parses a given list of pkgbuild(1)
spec files and can be used for extracting information from
them. Its primary purpose is to facilitate scripting and
interfacing with pkgbuild(1).
OPTIONS
General
-v or --verbose
Increase verbosity. Use -v to prefix the output lines
with the name of the spec file they belong to.
-q or --quiet
Silent operation (no diagnostic messages).
--rcfile=file
Read default configuration from file. Default:
./.pkgtoolrc, ~/.pkgtoolrc
--norc
Ignore the default rc files.
--ips
Print IPS package names, even on SVr4 systems, if
pkg(5) is installed.
--svr4
Print SVr4 package names, even on IPS systems.
Directories and search paths:
--specdirs=path or --spec=path
Specify a colon separated list of directories to search
for spec files 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:
--nodeps / --deps
Ignore/verify dependencies before building a component.
Default: --deps
--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.
Commands:
eval expr
Evaluate expr in the context of each given spec file
get_packages
List the packages defined in the given spec files
get_sources
List the sources (defined by Source tags) used by each
given spec file. Sources in %use'd spec files are also
included.
get_public_sources
Same as get_sources but list only the public sources
(omit those listed in a NoSource tag)
get_block block_name
Print the expanded block (sctiptlet) called block_name
from each given spec file. Example:
spectool get_block prep foo.spec
get_files
Print the files sections of each given spec file
get_meta
Print the Meta tags defined in each spec file
get_package_names [-a]
Print the package names defined in each given spec
file. Use --ips or --svr4 to select the package for-
mat, otherwise package names of the native format are
printed. Usage -a to include obsolete/renamed IPS packages.
match_package_names
Display how %package labels map to SVr4 package names
and IPS package names in each given spec file spec
get_patches
Print the patches (defined by Patch tags) used by each
given spec files. The patches in %use'd spec file are
also included.
get_public_patches
Same as get_patches but only prints the public patches
(omits those listed in NoPatch tags)
get_requires package name
Prints the runtime dependencies (Requires tags) belong-
ing to package label package name and defined in each
given spec file. Example:
spectool get_requires SUNWgtk2-devel SUNWgtk2.spec
get_all_requires
Prints all runtime dependencies (Requires tags) belonging to
all packages defined in the given spec file.
get_prereq package_name
Same as get_requires but for PreReq tags.
get_buildrequires
Prints the build-time dependencies of the given spec
files.
get_classes
Print any SVr4 classes (other than "none") in each of
the given spec files.
get_class_script_names
Print any SVr4 class action script names defined in
each of the given spec files.
get_included_files
Print all files included (using the %include directive)
in each given spec file, recursively.
get_used_spec_files [-l]
Print all files referenced using the %use tag in each
given spec file. With the -l option, print the labels
assigned to the %use'd spec files as well.
get_publish_scripts
Print the path to the IPS publishing scripts used for
publishing each IPS package defined by the given spec
files.
get_ips_pkgname file|package_name
Print the IPS package name and version that corresponds
to the given package_name (IPS or SVr4) or file. No
spec files arguments are needed for this command.
get_error
Print any syntax errors in the given spec files.
verify
Parse the given spec files and return 0 if they can be
parsed without errors, or non-0 if any of them have
errors.
Spec Files
specs...
List of spec files to process. 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
EXAMPLES
Example 1: Print the value of the Version tag from each spec
file in the current directory, prefixing with the name of
the spec file (-v option):
spectool -v eval '%version' *.spec
Example 2: Print the build scriptlet of the given spec file,
using debug options:
spectool --with-debug get_block build foo.spec
Example 3: Print the IPS package name of the package that
contains /usr/bin/bash:
spectool get_ips_pkgname /usr/bin/bash
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/spectool
executable for pkgtool
configuration file for pkgtool, see the CONFIGURATION section in
pkgtool(1) for details.
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), pkgtool(1), pkg(5), pkgmk(1)
NOTES
Written by Laszlo (Laca) Peter, Oracle Corporation, 2012
SunOS 5.10 Last change: Feb 14, 2012 5