openpkg/rpmtool.pod

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
parent 13
cb59d6afeb61
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

     1 ##
     2 ##  rpmtool.pod -- OpenPKG RPM Auxiliary Tool (Manual Page)
     3 ##
     4 ##  Copyright (c) 2000-2012 OpenPKG GmbH <http://openpkg.com/>
     5 ##
     6 ##  This software is property of the OpenPKG GmbH, DE MUC HRB 160208.
     7 ##  All rights reserved. Licenses which grant limited permission to use,
     8 ##  copy, modify and distribute this software are available from the
     9 ##  OpenPKG GmbH.
    10 ##
    11 ##  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
    12 ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    13 ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    14 ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    15 ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    16 ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    17 ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    18 ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    19 ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    20 ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    21 ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    22 ##  SUCH DAMAGE.
    23 ##
    25 =pod
    27 =head1 NAME
    29 B<rpmtool> - RPM Auxiliary Tool
    31 =head1 SYNOPSIS
    33 B<rpmtool>
    34 I<command>
    35 [I<command-options>]
    37 =head1 DESCRIPTION
    39 This is an auxiliary tool to the RedHat Package Manager (RPM). It
    40 provides additional functionality for use in RPM I<spec> files while
    41 building packages. The following I<command>s are available:
    43 =over 4
    45 =item B<platform>
    47 This command outputs a unique platform id in the format
    48 "<architecture>-<system><release>". For instance, the output on a
    49 FreeBSD platform can be "i386-freebsd4.2", the output on a Linux
    50 platform can be "i686-linux2.2.16", the output on a Solaris platform can
    51 be "sun4u-sunos5.8", etc.
    53 Example:
    55  case `rpmtool platform`; in
    56      *-freebsd[34].* ) ... ;;
    57      *-sunos5.[678]  ) ... ;;
    58      *-linux2.[24].* ) ... ;;
    59  esac
    61 =item B<mflags> [B<-O>] I<tool>
    63 This command outputs additional flags for make(1) for
    64 use with the program I<tool>. It provides only standard flags which
    65 always can be used. In conjunction with B<-O> (optimization), it also provides
    66 reasonable job control for use on multi-processor platforms (for instance it
    67 outputs "-j4" on an SMP system with 2 CPUs if GNU make or BSD pmake is used).
    69 Example:
    71  make `rpmtool mflags -O make`
    73 =item B<cflags> [B<-O>] I<tool>
    75 This command outputs additional flags for cc(1) for use with the program
    76 I<tool>. It provides only standard flags which always can be used.
    77 conjunction with B<-O> it provides also optimization flags (for instance
    78 it outputs "-O2 -pipe" for GNU C/C++ compiler).
    80 Example:
    82  CC="$CC" CFLAGS=`rpmtool cflags -O $CC` ./configure ...
    84 =item B<cppflags> [B<-p> I<prefix>] [[C<+|->I<subdir> ...]
    86 This command output cpp(1) C<-I> options for the OpenPKG instance
    87 I<prefix>. It optionally can prefix or suffix with one or more I<subdir>
    88 related options, too. If I<subdir> is prefixed with C<+> (or not
    89 prefixed at all), the generated option is appended. If I<subdir> is
    90 prefixed with C<-> the generated option is prepended.
    92 Example:
    94  rpmtool cppflags -p /foo bar -baz +quux
    96 =item B<ldflags> [B<-p> I<prefix>] [[C<+|->I<subdir> ...]
    98 This command output ld(1) C<-L> options for the OpenPKG instance
    99 I<prefix>. It optionally can prefix or suffix with one or more I<subdir>
   100 related options, too. If I<subdir> is prefixed with C<+> (or not
   101 prefixed at all), the generated option is appended. If I<subdir> is
   102 prefixed with C<-> the generated option is prepended.
   104 Example:
   106  rpmtool ldflags -p /foo bar -baz +quux
   108 =item B<files> [B<-v>] [B<-o> I<outfile>] [B<-r> I<build-root>] [I<entry> ...]
   110 This is a dynamic variant of the RPM C<%files> section, i.e., it
   111 dynamically creates the contents of the C<%files> section for use with
   112 the C<%files -f> command. For this the file list entries are read from
   113 the command line (or from stdin if no arguments are given or a single
   114 argument C<-> is given) and written to stdout (if no B<-o> option is
   115 given or its I<outfile> argument is C<->) or to I<outfile>.
   117 The trick of this approach is to be able to use additional features in
   118 the file list which RPM does not provide. The following features are
   119 provided:
   121 =over 4
   123 =item B<Trailing Tags>
   125 RPM requires that all tags (like C<%attr(...)> or C<%dir>) preceed the
   126 path in a file list entry. This sometimes leads to ugly and unreadable
   127 file lists, because all paths cannot be left-aligned. With rpmtool(8)
   128 tags in the input file list can be at leading and trailing positions.
   129 The output file list will nevertheless have all tags in leading
   130 positions for RPM.
   132 =item B<Syntactical Set Pattern>
   134 RPM supports simple wildcard patterns like C</path/*> or C</path/[a-z]>,
   135 etc. Sometimes it is convenient, to also have (in addition to character
   136 sets) string sets like C</path/{foo,bar,quux}>. rpmtool(8) provides this
   137 by syntactically (without checking the filesystem) expanding those
   138 string sets.
   140 =item B<Overriding Entries>
   142 This is the most important feature and the reason why shtool(1)'s
   143 B<files> command was implemented. Although RPM allows one to specify a
   144 directory in a file list and then implicitly expands this recursively
   145 into its contents, it unfortunately does not allow one to later
   146 explcitly override particular entries (usually if an individual
   147 C<%attr(...)> tag is required). rpmtool(8) now supports overriding
   148 entries, i.e., if a path occurs multiple times, only the last occurance
   149 is kept.
   151 =item B<Negation Tag>
   153 This provides an additional tag C<%not> which can be used to explicitly
   154 exclude a previously implicitly added entry.
   156 =back
   158 Example:
   160  %install
   161    :
   162  rpmtool files -o files -r$RPM_BUILD_ROOT \
   163      '%defattr(-,foo,foo)' \
   164      '%{prefix}' \
   165      '%attr(1755,root,foo) %{prefix}/bin/bar' \
   166      '%not %dir {%{prefix},%{prefix}/*,%{prefix}/man/*}' \
   167      '%not %{prefix}/info/dir'
   169  %files -f files
   171 =item B<msg> [B<-b>]
   173 This displays the contents of F<stdin> as a boxed message. If option
   174 B<-b> is given it additionally beeps once before displaying the box.
   176 =back
   178 =head1 HISTORY
   180 This tool was created in November 2000 for use in OpenPKG, the
   181 cross-platform RPM-based Unix software packaging facility.
   183 =head1 AUTHOR
   185  Ralf S. Engelschall
   186  rse@engelschall.com
   187  www.engelschall.com
   189 =cut

mercurial