TSRPM man page
NAME
tsrpm − TimeSys RPM Package Manager
SYNOPSIS
BUILDING PACKAGES:
tsrpm --target=TARGET {--build|-b?} [build-options] PACKAGE_FILE ...
INSTALLING AND REMOVING PACKAGES:
tsrpm --target=TARGET {--install|--install-cross} [install-options] PACKAGE_FILE ...
tsrpm --target=TARGET {--erase|-e} PACKAGE_FILE ...
CONVERTING PACKAGES:
tsrpm --target=TARGET {--repackage=TYPE|--convert-to-host} PACKAGE_FILE ...
QUERYING PACKAGES:
tsrpm --target=TARGET {--info|--query|-q|--eval} [--host|--target] PACKAGE_FILE ...
MISCELLANEOUS:
tsrpm --target=TARGET [--cross-tool] [--export] --dumpenv [TSRPM-ENVIRONMENT-VARIABLE]
tsrpm --target=TARGET [--cross-tool] --makepatch PACKAGE_FILE ...
tsrpm --target=TARGET [--cross-tool] --run-tool "SHELL-COMMAND"
tsrpm --target=TARGET --extract SOURCERPM ...
DESCRIPTION
tsrpm is used to manipulate source and binary RPMs for a cross-build environment. It controls the extraction of source rpms for manipulation, the building of packages from spec files, the installation of packages in a separate target root filesystem, and the extraction of library and header files to a cross compiler environment. It also has the ability to manipulate rpm dependency information and to generate IPKG files.
PACKAGE_FILE may be a source rpm file, a path to an RPM spec file, or a package name (for example, glibc), depending on the operation.
OPTIONS
- −−build
- Build a binary package. Performs the equivalent of an rpmbuild -ba (for spec files).
- −−release=(append|prepend|replace):N
- Changes the Release field of a spec file. The keyword denotes how N should be
applied to the release number. This option only works
with --build. - −b[pcilabs]
- Use the corresponding rpmbuild option when building a package.
- −-short-circuit
- Skip straight to specified build stage (i.e., skip all stages leading up to the specified stage). Only valid with -bc and -bi.
- --clean
- Remove the build tree after the packages are made.
- --buildroot DIRECTORY
- When building a package, override the BuildRoot tag with directory DIRECTORY.
- --install
- Install binary packages in a new root location specified by −−root.
This options takes either package names (e.g., binutils) where the correct
rpm package is found for the given target, or a path spec pointing to a binary rpm (e.g.,
./build/ppc85xx/RPM/ppc85xx/binutils-1.2.3.4-1.ppc85xx.rpm). When a package name is
specified the appropriate rpm for installation is selected from the package build directory
as specified by --dir and --target.
Note that this command produces standard rpm databases at <root>/var/lib/rpm and at <root>/../rpmdb (by default, however, see --dbpath). The rpm database in <root>/var/lib/rpm contains files which reflect installation for a running system, the rpmdb database contains files whose paths reflect where the installation occurred on the build system. See the query option for more information on this.
Use caution when exercising this option as improper setting of −−root could cause installation of rpm packages in system locations on your host system. For this reason, this command should never be run as root.
- --dbpath DIRECTORY
- Use the host database in DIRECTORY rather than the default path <root>/../rpmdb.
The location of the target database
(<root>/var/lib/rpm) is unchanged. - --excludedocs
- Don’t install any files which are marked as documentation (which includes man pages and texinfo documents).
- −−excludepath OLDPATH
- Don’t install files whose name begins with OLDPATH.
- −−justdb
- Update only the database, not the filesystem.
- −−query [−−] [--target|--build]
- Invokes rpm with the -q option. Extra arguments may be specified
after
“--”, for example:
tsrpm --target=ppc7xx --query -- -al
Specify --target or --build (default) after the option to reference the target’s rpm database (which shows file paths as if packages were installed in the root) or the hosts’s rpm database (which shows file paths where they actually live on the host).
Note that the -q option is probably more convenient to use.
- −−q[...] [--target|--build]
- Invokes rpm with the -q option. Anything following the -q is
sent directly to rpm, for example:
tsrpm --target=ppc7xx -qa -l
Specify --target or --build (default) after the option to reference the target’s rpm database (which shows file paths as if packages were installed in the root) or the hosts’s rpm database (which shows file paths where they actually exist on the host).
Example:
tsrpm --target=ppc7xx -qa -l --target tsrpm --target=ppc7xx -qa -l --build
The first use lists all files installed in the root file system for ppc7xx, providing a view as if the files were installed at root level. The second use provides a listing of all files where they actually live on the host system.
- −−convert-to-host
- Converts given target rpm(s) for use as host rpm cross library.
-
Example:
-
tsrpm --target=ppc7xx --convert-to-host ppc7xx/RPMS/krb5-libs*
This converts the rpms in ppc7xx/RPMS/ with the prefix krb5-libs.
- −−cust=PATH
- Search PATH for *.patch and *.tshint files, adding them to the spec file if they are found. If path does not contain slashes, it is assumed to be a subdirectory of the directory holding the rpm spec file.
- −−run-tool
- Takes remainder of arguments as a tool to run in the context of tsrpm.
Useful for debugging.
Example:
tsrpm --run-tool ’cd ppc7xx/BUILD/gcc*; exec bash’
This runs cd and bash in the context of tsrpm.
- -e, −−erase
- Erase rpm packages from the target root location. Use “--” to pass more options to rpm.
- −−exclude=<regex>
- Adds <regex> to list of exclusion patterns applied when building or repackaging an rpm.
- −−install-cross
- Install headers and libraries appropriate for a cross-compiler into the directory specified
by −−root.This command produces "manifest" files in "manifest" directories. These files contain a listing of all files created by rpm and can be used to remove packages later.
- −−extract
- Extract source rpms to a subdirectory of −−dir, named similarly
to the source rpm package.
Example:
tsrpm --extract binutils-1.2-3.src.rpm
Installs the contents of the binutils-1.2.src.rpm source rpm to rpm-sources/binutils-1.2-3.
- −−eval="%macro"
- Ask rpm to evaluate macro and print it on stdout.
- −−target=CPU
- Specify the target cpu type. This option is required for --build, --convert-to-host, --install,
--run-tool, and --install-cross. The CPU option
is used as a key for the settings in tsrpm/lib/target_specs.
Examples:
tsrpm --target=ppc7xx --build rpm-source/binutils-1.2-3/binutils.spec tsrpm --target=ppc7xx --install --root=/var/tmp/ppc binutils
Note: If the file $HOME/.tsrpm_target exists this file will be updated with the latest tsrpm target argument. Then, subsequent invocations of tsrpm will use this value if --target is omitted.
- −−cross-tool
- Build a package to run on the host but produce target binaries. Currently only useful for binutils, gcc, and uClibc.
- −−deps=(error|warn)
- Controls what to do with build-time dependencies (currently not implemented).
- −−makedeps
- Produces a makefile for build-time dependencies of given spec files (currently not implemented).
- −−dir=DIR
- Override default directory. Default is ./rpm-sources for −−extract and ./build/<target> for −−build, −−install, and −−install-cross.
- −−nodeps
- Don’t do a dependency check before installing a package.
- −−noscripts
- Don’t execute the scriptlet of the same name. The --noscripts option
is equivalent to
--nopre --nopost --nopreun --nopostun
and turns off the execution of the corresponding %pre, %post, %preun, and %postun scriptlet(s).
- −−repackage=(targetipkg|targetrpm|hostrpm|targetspec)
- This option is used to repackage an rpm into another format.
- targetipkg produces an ipkg from the rpm suitable for installation on the target.
- targetrpm repackages an rpm for the target (presumably winnowing away files which match the --exclude option).
- hostrpm is equivalent to --convert-to-host. It is intended to create an rpm which can be installed on the host in the default installation path. This option strips out any files which would not be appropriate for the host such as executable files which are intended to be run on the host.
- targetspec unpacks all of the rpms into the <target>/tmp-root directory and creates a simplified spec file, removing any files specified via --exclude from the spec file.
- −−scripts
- When used with -q, lists the package-specific scriptlet(s) that are used
as part of the installation and uninstallation processes.
When used with --repackage or --convert-to-host, implies that these scripts are to be included in the new package.
- −−host=<arch>
- Pass a value as the --host option to configure scripts for generating cross compiler on another host.
Implies --cross-tool.
Example:
tsrpm --target=ppc7xx --host=i686-cygwin --build gcc
See --cross-tool as a comparison.
- −−log
- Generates log file of build in <target>/LOGS.
- −−force
- Forces gcc to create dummy *configtest* executables if compilation and linkage of a script succeeds. This will allow a configuration which assumes that it can run programs with a dummy script, fooling the configuration script into thinking that a test has succeeded. Obviously, this is only useful for tests that really should succeed for the target system and, so, this option should only be used as a last resort.
- −−force-configtest
- Build a binary package. Performs the equivalent of.
- −−fromsource (currently not implemented)
- This option is used with --build. If a subdirectory is found in the same directory as the target spec file, it is scanned for *.orig files. A diff is made between the .orig and the new file, a temporary patch is added to the spec file, and a new source tarball is generated from the directory.
- −−dumpenv [env [...]]
- Displays tsrpm environment variables in sourceable form. Displays all tsrpm environment variables if no argument provided.
CAVEATS
tsrpm relies on the tsrpmhelper.so helper library when installing packages. Without this library, some versions of rpm will not be able to use the --install or --install-cross options unless run as root regardless of the protections on the target root directory. While tsrpm should work correctly when run as root, it is strongly recommended that, for safety reasons, the program should always be run as a nonprivileged user – even when installing a new root directory. For this reason it is best that this library be installed in the same location as the tsrpm program itself.
FILES
tsrpmhelper.so - helper library which allows non-root installation of target root filesystem
tsrpm/lib/shutils - helper functions for tsrpm scripts
tsrpm/lib/target_specs - used for overriding --target CPU default settings
tsrpm/lib/override/* - front-end scripts which are used to force a cross-compilation environment on packages which are not expecting it
./<target>/BUILD - location for target builds
./<target>/RPMS/* - location for created binary rpms
./<target>SPECS/<arch> - temporary residence of rpm spec files during build.
./<target>/SRPMS - location for created source rpms
./<target>/LOGS - location for output from --log option
./<target>/root - location for any generated root file systems
./<target>/root/var/lib/rpm - location of rpm package database for the root filesystem
$HOME/.tsrpm_target - default target for tsrpm, if it exists.