head 1.6; access; symbols; locks; strict; comment @# @; 1.6 date 2003.10.31.20.00.05; author rse; state Exp; branches; next 1.5; 1.5 date 2003.10.26.11.34.44; author rse; state Exp; branches; next 1.4; 1.4 date 2003.09.29.12.53.15; author rse; state Exp; branches; next 1.3; 1.3 date 2003.09.08.19.03.03; author rse; state Exp; branches; next 1.2; 1.2 date 2003.09.08.11.47.05; author rse; state Exp; branches; next 1.1; 1.1 date 2003.09.08.11.16.13; author rse; state Exp; branches; next ; desc @@ 1.6 log @fix typos @ text @## ## 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 @ 1.5 log @improve documentation @ text @d2 1 a2 1 ## OSSP platform - Platform Identification d65 2 a66 2 This leads to eithteen (2x3x3) available identification strings for each platform, from which usually 2 are choosen in a particular situation. d279 1 a279 1 combined with verbose, regular and consise outputs). The drawback of @ 1.4 log @add blind IBM AIX support; add platforms to manual page; cleanup and fix system classes @ text @d62 10 a71 7 I identification. For all of those six identifications, there is a I, I and I version. This leads to eithteen (2x3x3) available identification strings for each platform, from which usually 2 are choosen 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>", "C<%ExxE>". "C<%[xx]>", and "C<%{xx}>". d92 1 d96 1 d100 1 d104 1 d108 1 d156 52 a207 7 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: "C" for binary package id (OpenPKG RPM), "C" for build time checking (OpenPKG RPM), "C for GNU F style id "C" for non-whitespace HTTP Server-header id, "C" for human readable verbose summary information, and "C" for an all-in-one full-table information. d253 2 a254 1 QNX Neutrino, SGI IRIX, HP HP-UX, HP Tru64, IBM AIX. d272 2 a273 2 Unix platforms packages are maintained for. It was inspired by B F and older B F command. d277 2 a278 2 the time and is not used at all in all projects I've ever seen), is a lot more flexible (class, product and technology identifications d280 3 a282 1 B is that it (still) knows less particular platforms. @ 1.3 log @finish mostly all (initial ;-) features of this program and the corresponding documentation @ text @d196 10 @ 1.2 log @more initial documentation @ text @a40 1 [B<-T>|B<--type> I] d47 5 d78 29 a106 18 %[ac] verbose hardware architecture class %[ap] verbose hardware architecture product %[at] verbose hardware architecture technology %[sc] verbose operating system class %[sp] verbose operating system product %[st] verbose operating system technology %{ac} regular hardware architecture class %{ap} regular hardware architecture product %{at} regular hardware architecture technology %{sc} regular operating system class %{sp} regular operating system product %{st} regular operating system technology % concise hardware architecture class % concise hardware architecture product % concise hardware architecture technology % concise operating system class % concise operating system product % concise operating system technology d110 5 d117 4 d123 2 d127 1 a127 1 =item B<-T>, B<--type> I d131 4 d137 18 a154 1 =item B<-n>, B<--newline> d158 2 d162 2 d166 2 d178 2 a179 2 platform -c -L -S "" -C "+" -F "%at-%st" platform -c -L -S "" -C "+" -F "%ac-%sc" d182 2 a183 2 platform -c -L -S "" -C "+" -F "%ap-%sp" d186 7 a192 3 platform -v -F "%sp (%ap)" platform -v -F "%sc (%ac)" @ 1.1 log @initial OSSP platform (FreeBSD, Linux and Solaris support only) @ text @d35 17 a51 1 ... d55 83 a137 1 ... d153 7 @