michael@13: ## michael@13: ## rpmtool.pod -- OpenPKG RPM Auxiliary Tool (Manual Page) michael@13: ## michael@428: ## Copyright (c) 2000-2012 OpenPKG GmbH michael@13: ## michael@428: ## This software is property of the OpenPKG GmbH, DE MUC HRB 160208. michael@428: ## All rights reserved. Licenses which grant limited permission to use, michael@428: ## copy, modify and distribute this software are available from the michael@428: ## OpenPKG GmbH. michael@428: ## michael@428: ## THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED michael@13: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@13: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@13: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@13: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@13: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@13: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@13: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@13: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@13: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@13: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@13: ## SUCH DAMAGE. michael@13: ## michael@13: michael@13: =pod michael@13: michael@13: =head1 NAME michael@13: michael@13: B - RPM Auxiliary Tool michael@13: michael@13: =head1 SYNOPSIS michael@13: michael@13: B michael@13: I michael@13: [I] michael@13: michael@13: =head1 DESCRIPTION michael@13: michael@13: This is an auxiliary tool to the RedHat Package Manager (RPM). It michael@13: provides additional functionality for use in RPM I files while michael@13: building packages. The following Is are available: michael@13: michael@13: =over 4 michael@13: michael@13: =item B michael@13: michael@13: This command outputs a unique platform id in the format michael@13: "-". For instance, the output on a michael@13: FreeBSD platform can be "i386-freebsd4.2", the output on a Linux michael@13: platform can be "i686-linux2.2.16", the output on a Solaris platform can michael@13: be "sun4u-sunos5.8", etc. michael@13: michael@13: Example: michael@13: michael@13: case `rpmtool platform`; in michael@13: *-freebsd[34].* ) ... ;; michael@13: *-sunos5.[678] ) ... ;; michael@13: *-linux2.[24].* ) ... ;; michael@13: esac michael@13: michael@13: =item B [B<-O>] I michael@13: michael@13: This command outputs additional flags for make(1) for michael@13: use with the program I. It provides only standard flags which michael@13: always can be used. In conjunction with B<-O> (optimization), it also provides michael@13: reasonable job control for use on multi-processor platforms (for instance it michael@13: outputs "-j4" on an SMP system with 2 CPUs if GNU make or BSD pmake is used). michael@13: michael@13: Example: michael@13: michael@13: make `rpmtool mflags -O make` michael@13: michael@13: =item B [B<-O>] I michael@13: michael@13: This command outputs additional flags for cc(1) for use with the program michael@13: I. It provides only standard flags which always can be used. michael@13: conjunction with B<-O> it provides also optimization flags (for instance michael@13: it outputs "-O2 -pipe" for GNU C/C++ compiler). michael@13: michael@13: Example: michael@13: michael@13: CC="$CC" CFLAGS=`rpmtool cflags -O $CC` ./configure ... michael@13: michael@13: =item B [B<-p> I] [[C<+|->I ...] michael@13: michael@13: This command output cpp(1) C<-I> options for the OpenPKG instance michael@13: I. It optionally can prefix or suffix with one or more I michael@13: related options, too. If I is prefixed with C<+> (or not michael@13: prefixed at all), the generated option is appended. If I is michael@13: prefixed with C<-> the generated option is prepended. michael@13: michael@13: Example: michael@13: michael@13: rpmtool cppflags -p /foo bar -baz +quux michael@13: michael@13: =item B [B<-p> I] [[C<+|->I ...] michael@13: michael@13: This command output ld(1) C<-L> options for the OpenPKG instance michael@13: I. It optionally can prefix or suffix with one or more I michael@13: related options, too. If I is prefixed with C<+> (or not michael@13: prefixed at all), the generated option is appended. If I is michael@13: prefixed with C<-> the generated option is prepended. michael@13: michael@13: Example: michael@13: michael@13: rpmtool ldflags -p /foo bar -baz +quux michael@13: michael@13: =item B [B<-v>] [B<-o> I] [B<-r> I] [I ...] michael@13: michael@13: This is a dynamic variant of the RPM C<%files> section, i.e., it michael@13: dynamically creates the contents of the C<%files> section for use with michael@13: the C<%files -f> command. For this the file list entries are read from michael@13: the command line (or from stdin if no arguments are given or a single michael@13: argument C<-> is given) and written to stdout (if no B<-o> option is michael@13: given or its I argument is C<->) or to I. michael@13: michael@13: The trick of this approach is to be able to use additional features in michael@13: the file list which RPM does not provide. The following features are michael@13: provided: michael@13: michael@13: =over 4 michael@13: michael@13: =item B michael@13: michael@13: RPM requires that all tags (like C<%attr(...)> or C<%dir>) preceed the michael@13: path in a file list entry. This sometimes leads to ugly and unreadable michael@13: file lists, because all paths cannot be left-aligned. With rpmtool(8) michael@13: tags in the input file list can be at leading and trailing positions. michael@13: The output file list will nevertheless have all tags in leading michael@13: positions for RPM. michael@13: michael@13: =item B michael@13: michael@13: RPM supports simple wildcard patterns like C or C, michael@13: etc. Sometimes it is convenient, to also have (in addition to character michael@13: sets) string sets like C. rpmtool(8) provides this michael@13: by syntactically (without checking the filesystem) expanding those michael@13: string sets. michael@13: michael@13: =item B michael@13: michael@13: This is the most important feature and the reason why shtool(1)'s michael@13: B command was implemented. Although RPM allows one to specify a michael@13: directory in a file list and then implicitly expands this recursively michael@13: into its contents, it unfortunately does not allow one to later michael@13: explcitly override particular entries (usually if an individual michael@13: C<%attr(...)> tag is required). rpmtool(8) now supports overriding michael@13: entries, i.e., if a path occurs multiple times, only the last occurance michael@13: is kept. michael@13: michael@13: =item B michael@13: michael@13: This provides an additional tag C<%not> which can be used to explicitly michael@13: exclude a previously implicitly added entry. michael@13: michael@13: =back michael@13: michael@13: Example: michael@13: michael@13: %install michael@13: : michael@13: rpmtool files -o files -r$RPM_BUILD_ROOT \ michael@13: '%defattr(-,foo,foo)' \ michael@13: '%{prefix}' \ michael@13: '%attr(1755,root,foo) %{prefix}/bin/bar' \ michael@13: '%not %dir {%{prefix},%{prefix}/*,%{prefix}/man/*}' \ michael@13: '%not %{prefix}/info/dir' michael@13: michael@13: %files -f files michael@13: michael@13: =item B [B<-b>] michael@13: michael@13: This displays the contents of F as a boxed message. If option michael@13: B<-b> is given it additionally beeps once before displaying the box. michael@13: michael@13: =back michael@13: michael@13: =head1 HISTORY michael@13: michael@13: This tool was created in November 2000 for use in OpenPKG, the michael@13: cross-platform RPM-based Unix software packaging facility. michael@13: michael@13: =head1 AUTHOR michael@13: michael@13: Ralf S. Engelschall michael@13: rse@engelschall.com michael@13: www.engelschall.com michael@13: michael@13: =cut michael@13: