##
## OSSP platform - Unix Platform Identification
## Copyright (c) 2003 The OSSP Project
## Copyright (c) 2003 Ralf S. Engelschall
##
## This file is part of OSSP platform, a Unix platform identification
## program which can be found at http://www.ossp.org/pkg/tool/platform/.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2.0 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this library; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
## USA, or contact Ralf S. Engelschall .
##
## platform.pod: the manual page (language: Plain Old Document)
##
=pod
=head1 NAME
B - Unix Platform Identification
=head1 SYNOPSIS
B
[B<-F>|B<--format> I]
[B<-S>|B<--sep> I]
[B<-C>|B<--conc> I]
[B<-L>|B<--lower>]
[B<-U>|B<--upper>]
[B<-v>|B<--verbose>]
[B<-c>|B<--concise>]
[B<-n>|B<--newline>]
[B<-d>|B<--debug>]
B
[B<-t>|B<--type> I]
[B<-n>|B<--newline>]
[B<-d>|B<--debug>]
B
[B<-V>|B<--version>]
B
[B<-h>|B<--help>]
=head1 DESCRIPTION
B is a flexible Unix platform identification program.
It distinguishes a platform according to its I
and I. For both there is a I, I and
I identification. For each of those six identifications,
there is a I, I and I version.
This leads to eighteen (2x3x3) available identification strings for each
platform, from which usually 2 are chosen in a particular situation.
This is done by assembling the platform identification string using a
I string containing one or more identification constructs of the
forms "C<%[xx]>" (verbose), "C<%{xx}>" (regular) and "C<%ExxE>"
(concise).
=head1 OPTIONS
The following command line options are available.
=over 4
=item B<-F>, B<--format> I
This option controls the output formatting of this program. It is a
plain-text string with the "C<%>I" constructs which expand to the
various platform information strings. "C<%{>IC<}>" is the canonical
regular version of the information. "C<%[>IC<]>" is the verbose
version of the information. "C<%E>IC>" is the concise
version of the information. In total, the following constructs
are available for expansion:
%[ac] verbose hardware architecture class
%{ac} regular hardware architecture class
% concise hardware architecture class
%[ap] verbose hardware architecture product
%{ap} regular hardware architecture product
% concise hardware architecture product
%[at] verbose hardware architecture technology
%{at} regular hardware architecture technology
% concise hardware architecture technology
%[sc] verbose operating system class
%{sc} regular operating system class
% concise operating system class
%[sp] verbose operating system product
%{sp} regular operating system product
% concise operating system product
%[st] verbose operating system technology
%{st} regular operating system technology
% concise operating system technology
The default I string is "C<%{sp} (%{ap})>", providing the
regular operating system and hardware architecture product information.
=item B<-S>, B<--sep> I
This option sets the word I string for the platform
information strings. By default it is "C< >" (whitespace). It is
especially used for separating the operating system name and
the operating system version.
=item B<-C>, B<--conc> I
This option sets the word I string for the platform
information strings. By default it is "C>". It is especially used to
concatenate multiple parts in operating system name and version parts.
=item B<-L>, B<--lower>
This options enforces conversion of the output to all I case.
=item B<-U>, B<--upper>
This options enforces conversion of the output to all I case.
=item B<-v>, B<--verbose>
This option enforces verbose versions of all expansion constructs
in I string of option B<-F>. It is equal to specifying all
expansion constructs as "C<%[>IC<]>".
=item B<-c>, B<--concise>
This option enforces concise versions of all expansion constructs
in I string of option B<-F>. It is equal to specifying all
expansion constructs as "C<%E>IC>".
=item B<-n>, B<--no-newline>
This option omits the usual trailing newline character in the output.
=item B<-t>, B<--type> I
This option is a meta option which internally sets options B<-F>, B<-S>,
B<-C>, B<-L>, B<-U>, B<-v> or B<-c> according to I. It can be used
to easily specify various commonly known outputs. The following Is
are available:
=over 4
=item B
Binary Package Id (OpenPKG RPM).
This is equal to "C<-F '%-%' -L -S '' -C '+'>"
and results in outputs like "C" and "C".
=item B
Build-Time Checking (OpenPKG RPM).
This is equal to "C<-F '%-%' -L -S '' -C '+'>"
and results in outputs like "C" and "C".
=item B
GNU F Style Id.
This is similar to B and is equal to "C<-F '"%-unknown-%' -L -S '' -C '+'>"
and results in outputs like "C" and "C".
=item B
HTTP Server Header Id.
This is equal to "C<-F '"%-%' -S '/' -C '+'>"
and results in outputs like "C" and "C".
=item B
Human Readable Verbose Summary Information. This is equal to "C<-F
'Class: %[sc] (%[ac])\nProduct: %[sp] (%[ap])\nTechnology: %[st]
(%[at])' -S ' ' -C '/'>" and results in outputs like:
Class: 4.4BSD (iX86)
Product: FreeBSD 4.9-RC (iX86)
Technology: FreeBSD 4.9-RC (i686)
and
Class: LSB (iX86)
Product: Debian GNU/Linux 3.0 (iX86)
Technology: GNU/Linux 2.2/2.4 (i686)
=item B
All-In-One Full-Table Information. This just outputs really
all 2x2x3 identification strings as a table.
=back
=item B<-d>, B<--debug>
This option enables some internal debugging messages.
=item B<-V>, B<--version>
This option outputs the version information of B only.
=item B<-h>, B<--help>
This option outputs the usage information of B only.
=back
=head1 EXAMPLES
The following real-life use cases are known:
=over 4
=item B build-time decisions
$ platform -c -L -S "" -C "+" -F "%at-%st"
$ platform -c -L -S "" -C "+" -F "%ac-%sc"
=item B binary RPM packages
$ platform -c -L -S "" -C "+" -F "%ap-%sp"
=item F files
$ platform -v -F "%sp (%ap)"
$ platform -v -F "%sc (%ac)"
=item Debugging
$ platform --type=all-in-one
=back
=head1 SUPPORT
B currently knows the following particular Unix platforms
in detail: FreeBSD, NetBSD, OpenBSD, Linux, Sun Solaris, SCO UnixWare,
QNX Neutrino, SGI IRIX, HP HP-UX, HP Tru64, IBM AIX and Apple MacOS X
Darwin.
All other Unix platforms are recognized through generic uname(1)
information and so usually can be identified sufficiently, although the
identification might be not as precise as possible.
=head1 SEE ALSO
http://www.ossp.org/pkg/tool/platform/.
uname(3), GNU F.
=head1 HISTORY
B was implemented in September 2003 by I for use in the B and B projects. It was
prompted by the need in B to have both product (for RPM
filenames) and technology (for build-time decisions) identifiers for the
Unix platforms, OpenPKG packages are maintained for. It was inspired by
the B F and the old B F command.
The major difference to B F is that B
does not use a I identification (cannot be determined most of
the time and is not used at all in all projects I've ever seen) and
is a lot more flexible (class, product and technology identifications
combined with verbose, regular and concise outputs). The drawback of
B is that it (still) knows less particular platforms,
although the generic platform identification is sufficient enough most
of the time.
=head1 AUTHOR
Ralf S. Engelschall
rse@engelschall.com
www.engelschall.com
=cut