RPMTOOL(1)

NAME
rpmtool - RPM Auxiliary Tool

SYNOPSIS
rpmtool command [command-options]

DESCRIPTION
This is an auxiliary tool to the RedHat Package Manager (RPM). It provides additional functionality for use in RPM spec files while building packages. The following commands are available:

platform
    This command outputs a unique platform id in the format "<architecture>-<system><release>". For instance, the output on a FreeBSD platform can be "i386-freebsd4.2", the output on a Linux platform can be "i686-linux2.2.16", the output on a Solaris platform can be "sun4u-sunos5.8", etc.

    Example:

     case `rpmtool platform`; in
         *-freebsd[34].* ) ... ;;
         *-sunos5.[678]  ) ... ;;
         *-linux2.[24].* ) ... ;;
     esac

flags [-m] [-c] [-O] tool
    This command outputs additional flags for make (-m) or compiler (-c) for use with the program tool. For -m it provides only standard flags which always can be used. In conjunction with -O (optimization), it also provides reasonable job control for use on multi-processor platforms (for instance it outputs "-j4" on an SMP system with 2 CPUs if GNU make or BSD pmake is used). For -c it provides only standard flags which always can be used. In conjunction with -O it provides also optimization flags (for instance it outputs "-O2 -pipe" for GNU C/C++ compiler).

    Example:

     CC="$CC" CFLAGS=`rpmtool -c -O $CC` ./configure ...

files [-v] [-o outfile] [-r build-root] [entry ...]
    This is a dynamic variant of the RPM %files section, i.e., it dynamically creates the contents of the %files section for use with the %files -f command. For this the file list entries are read from the command line (or from stdin if no arguments are given or a single argument - is given) and written to stdout (if no -o option is given or its outfile argument is -) or to outfile.

    The trick of this approach is to be able to use additional features in the file list which RPM does not provide. The following features are provided:

Trailing Tags
    RPM requires that all tags (like %attr(...) or %dir) preceed the path in a file list entry. This sometimes leads to ugly and unreadable file lists, because all paths cannot be left-aligned. With rpmtool(1) tags in the input file list can be at leading and trailing positions. The output file list will nevertheless have all tags in leading positions for RPM.

Syntactical Set Pattern
    RPM supports simple wildcard patterns like /path/* or /path/[a-z], etc. Sometimes it is convienient, to also have (in addition to character sets) string sets like /path/{foo,bar,quux}. rpmtool(1) provides this by syntactically (without checking the filesystem) expanding those string sets.

Overriding Entries
    This is the most important feature and the reason why shtool(1)'s files command was implemented. Although RPM allows one to specify a directory in a file list and then implicitly expands this recursively into its contents, it unfortunately does not allow one to later explcitly override particular entries (usually if an individual %attr(...) tag is required). rpmtool(1) now supports overriding entries, i.e., if a path occurs multiple times, only the last occurance is kept.

Negation Tag
    This provides an additional tag %not which can be used to explicitly exclude a previously implicitly added entry.

    Example:

     %install
       :
     rpmtool files -o files -r$RPM_BUILD_ROOT \
         '%defattr(-,foo,foo)' \
         '%{prefix}' \
         '%attr(1755,root,foo) %{prefix}/bin/bar' \
         '%not %dir {%{prefix},%{prefix}/*,%{prefix}/man/*}' \
         '%not %{prefix}/info/dir'
     %files -f files

user [-a] [-r] [-p passwd] [-n realname] [-d homedir] [-s shell] [-u min-uid] username
    This adds (-a) or removes (-r) the user username in the system database.

group [-a] [-r] [-g min-gid] groupname [username ...]
    This adds (-a) or removes (-r) the group groupname in the system database.

msg [-b]
    This displays the contents of stdin as a boxed message. If option -b is given it additionally beeps once before displaying the box.

HISTORY
This tool was created in November 2000 for use in OpenPKG, the cross-platform RPM-based Unix software packaging facility.

AUTHOR

 Ralf S. Engelschall
 rse@engelschall.com
 www.engelschall.com