Man pages for db tables are now built automatically.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@602 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
bp-sawyers 2008-02-27 19:52:07 +00:00
parent d154f58ed0
commit a5c93c5164
8 changed files with 130 additions and 21 deletions

View File

@ -6,7 +6,7 @@ if [ "$OSNAME" = "AIX" ]
then
echo '.svn' > /tmp/xcat-excludes
tar -X /tmp/xcat-excludes -cvf /opt/freeware/src/packages/SOURCES/perl-xCAT-2.0.tar perl-xCAT-2.0
tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/perl-xCAT-2.0.tar perl-xCAT-2.0
gzip /opt/freeware/src/packages/SOURCES/perl-xCAT-2.0.tar
cd ./perl-xCAT-2.0
rm -f /opt/freeware/src/packages/SRPMS/perl-xCAT-2.0*rpm /opt/freeware/src/packages/RPMS/ppc/perl-xCAT-2.0*rpm
@ -21,7 +21,7 @@ else
pkg="packages"
fi
tar --exclude .svn -czvf /usr/src/$pkg/SOURCES/perl-xCAT-2.0.tar.gz perl-xCAT-2.0/;
tar --exclude .svn -czf /usr/src/$pkg/SOURCES/perl-xCAT-2.0.tar.gz perl-xCAT-2.0/;
rm -f /usr/src/$pkg/SRPMS/perl-xCAT-2.0*rpm /usr/src/$pkg/RPMS/noarch/perl-xCAT-2.0*rpm
rpmbuild -ta /usr/src/$pkg/SOURCES/perl-xCAT-2.0.tar.gz ;
#rpm -Uvh /usr/src/$pkg/RPMS/noarch/perl-xCAT-2.0*rpm

View File

@ -9,7 +9,7 @@ then
rm -f xCAT-rmc-$version; ln -s $source/xCAT-rmc xCAT-rmc-$version
rm -f /opt/freeware/src/packages/SRPMS/xCAT-rmc*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-rmc*rpm
echo '.svn' > /tmp/xcat-excludes
tar -X /tmp/xcat-excludes -cvf xCAT-rmc-$version.tar xCAT-rmc-$version
tar -X /tmp/xcat-excludes -cf xCAT-rmc-$version.tar xCAT-rmc-$version
gzip /opt/freeware/src/packages/SOURCES/xCAT-rmc-$version.tar
cd $source/xCAT-rmc
rpm -ba xCAT-rmc.spec

View File

@ -6,7 +6,7 @@ if [ "$OSNAME" = "AIX" ]
then
echo '.svn' > /tmp/xcat-excludes
tar -X /tmp/xcat-excludes -cvf /opt/freeware/src/packages/SOURCES/xCAT-server-2.0.tar xCAT-server-2.0
tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/xCAT-server-2.0.tar xCAT-server-2.0
gzip /opt/freeware/src/packages/SOURCES/xCAT-server-2.0.tar
cd ./xCAT-server-2.0
rm -f /opt/freeware/src/packages/SRPMS/xCAT-server-2.0*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-server-2.0*rpm
@ -22,7 +22,7 @@ else
pkg="packages"
fi
tar --exclude .svn -czvf /usr/src/$pkg/SOURCES/xCAT-server-2.0.tar.gz xCAT-server-2.0;
tar --exclude .svn -czf /usr/src/$pkg/SOURCES/xCAT-server-2.0.tar.gz xCAT-server-2.0;
rm -f /usr/src/$pkg/SRPMS/xCAT-server-2.0*rpm /usr/src/$pkg/RPMS/noarch/xCAT-server-2.0*rpm
rpmbuild -ta /usr/src/$pkg/SOURCES/xCAT-server-2.0.tar.gz ;
#rpm -Uvh /usr/src/$pkg/RPMS/noarch/xCAT-server-2.0*rpm

View File

@ -6,7 +6,7 @@ version='2.0'
if [ "$OSNAME" = "AIX" ]
then
echo '.svn' > /tmp/xcat-excludes
tar -X /tmp/xcat-excludes -cvf /opt/freeware/src/packages/SOURCES/xCAT-web.tar xCAT-web
tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/xCAT-web.tar xCAT-web
gzip /opt/freeware/src/packages/SOURCES/xCAT-web.tar
cd ./xCAT-web
rm -f /opt/freeware/src/packages/SRPMS/xCAT-web*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-web*rpm

75
perl-xCAT-2.0/db2man Normal file
View File

@ -0,0 +1,75 @@
#!/usr/bin/perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
# Builds the xCAT database man pages from the descriptions that are contained
# in Schema.pm. This script is run during the build of the perl-xCAT rpm, but
# is not packaged in the binary form of that rpm.
# We assume that this script is run in the perl-xCAT-2.0 dir, so everything is
# done relative to that.
use lib '.';
use xCAT::Schema;
my $poddir = 'pods/man5';
if (system("mkdir -p $poddir")) { die "Error: could not create $poddir.\n"; }
my $tabspecref = \%xCAT::Schema::tabspec;
# Build the man page for each table.
foreach my $tablekey (keys %$tabspecref) {
my $table = $tabspecref->{$tablekey};
my $summary = $table->{table_desc};
my $colorder = $table->{cols};
my $descriptions = $table->{descriptions};
writemanpage("$poddir/$tablekey.5.pod", $tablekey, $summary, $colorder, $descriptions);
}
exit;
# Create the man page for one table.
sub writemanpage {
my $file = shift; # relative path file name of the man page
my $tablename = shift; # name of table
my $summary = shift; # description of table
my $colorder = shift; # the order in which the table attributes should be presented in
my $descriptions = shift; # a hash containing the description of each attribute
open(FILE, ">$file") or die "Error: could not open $file for writing.\n";
print FILE <<"EOS1";
=head1 NAME
B<$tablename> - a table in the xCAT database.
=head1 SYNOPSIS
B<$tablename Attributes:>
EOS1
foreach my $a (@$colorder) { print FILE " I<$a>\n"; }
print FILE <<"EOS2";
=head1 DESCRIPTION
$summary
B<$tablename Attributes:>
EOS2
foreach my $a (@$colorder) {
my $d = $descriptions->{$a};
print FILE "\nI<$a> - $d\n";
}
print FILE <<"EOS3";
=head1 NOTES
This command is part of the xCAT software product.
EOS3
close FILE;
}

View File

@ -23,12 +23,30 @@ Includes xCAT::Table, xCAT::NodeRange, among others.
%prep
%setup -q
%build
# This phase is done in (for RH): /usr/src/redhat/BUILD/perl-xCAT-2.0
# All of the tarball source has been unpacked there and is in the same file structure
# as it is in svn.
# Build the pod version of the man pages for each DB table. It puts them in the man5 subdir.
./db2man
# Convert pods to man pages, e.g.: pod2man pods/man5/chain.5.pod share/man/man5/chain.1
for i in pods/*/*.pod; do
man=${i/pods/share\/man}
mkdir -p ${man%/*}
pod2man $i ${man%.pod}
done
%install
# The install phase puts all of the files in the paths they should be in when the rpm is
# installed on a system. The RPM_BUILD_ROOT is a simulated root file system and usually
# has a value like: /var/tmp/perl-xCAT-2.0-snap200802270932-root
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/data
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man5
cp -r xCAT/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/*
@ -42,7 +60,12 @@ cp LICENSE.html $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT
cp README $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT/*
# These were built dynamically in the build phase
cp share/man/man5/* $RPM_BUILD_ROOT/%{prefix}/share/man/man5
chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man5/*
%clean
# This step does not happen until *after* the %files packaging below
rm -rf $RPM_BUILD_ROOT
#find $RPM_BUILD_ROOT -type f | sed -e "s@$RPM_BUILD_ROOT@/@" > files.list
@ -50,9 +73,10 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
#%doc LICENSE.html
#%doc README
#%doc xCAT2.0.doc
#%doc README
#%doc xCAT2.0.doc
#%doc xCAT2.0.pdf
# Just package everything that has been copied into RPM_BUILD_ROOT
%{prefix}
%changelog

View File

@ -154,8 +154,8 @@ nodegroup => {
table_desc => 'Not supported yet! Contains group definitions, whose membership is dynamic depending on characteristics of the node.',
descriptions => {
groupname => 'Name of the group.',
grouptype => 'dynamic or static??',
members => 'Not used. Will be deleted. (The membership for static groups is stored in the nodelist table.)',
grouptype => 'The only current valid value is dynamic. We will be looking at having the object def commands working with static group definitions in the nodelist table.',
members => 'The value of the attribute is not used, but the attribute is necessary as a place holder for the object def commands. (The membership for static groups is stored in the nodelist table.)',
wherevals => 'A list of comma-separated "attr=val" pairs that can be used to determine the members of a dynamic group.',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
@ -167,7 +167,7 @@ nodehm => {
table_desc => "Settings that control how each node's hardware is managed. Typically, an additional table that is specific to the hardware type of the node contains additional info. E.g. the ipmi, mp, and ppc tables.",
descriptions => {
node => 'The node name or group name.',
power => 'The method to use to control the power of the node. If not set, the mgt attribute will be used. Valid values: ipmi, blade, hmc, ivm, fsp??. If "ipmi", xCAT will search for this node in the ipmi table for more info. If "blade", xCAT will search for this node in the mp table. If "hmc", "ivm", or "fsp", xCAT will search for this node in the ppc table.',
power => 'The method to use to control the power of the node. If not set, the mgt attribute will be used. Valid values: ipmi, blade, hmc, ivm, fsp. If "ipmi", xCAT will search for this node in the ipmi table for more info. If "blade", xCAT will search for this node in the mp table. If "hmc", "ivm", or "fsp", xCAT will search for this node in the ppc table.',
mgt => 'The method to use to do general hardware management of the node. This attribute is used as the default if poweer, cons, or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp. See the power attribute for more details.',
cons => 'The console method. If not set, the mgt attribute will be used. Valid values: cyclades, mrv, or the values valid for mgt??',
termserver => 'The hostname of the terminal server.',
@ -278,7 +278,7 @@ passwd => {
keys => [qw(key)],
table_desc => 'Contains default userids and passwords for xCAT to access cluster components. Userids/passwords for specific cluster components can be overidden in other tables, e.g. mpa, ipmi, ppchcp, etc.',
descriptions => {
key => 'The type of component this user/pw is for. Valid values: blade (management module), ipmi (BMC), system (nodes??), omapi (DHCP).',
key => 'The type of component this user/pw is for. Valid values: blade (management module), ipmi (BMC), system (nodes??), omapi (DHCP), hmc, ivm, fsp.',
username => 'The default userid for this type of component',
password => 'The default password for this type of component',
comments => 'Any user-written notes.',
@ -333,8 +333,8 @@ ppcdirect => {
table_desc => 'Info necessary to use FSPs to control system p CECs.',
descriptions => {
hcp => 'Hostname of the FSP.',
username => 'Userid of the FSP. Default is ??',
password => 'Password of the FSP.',
username => 'Userid of the FSP. If not filled in, xCAT will look in the passwd table for key=fsp. If not in the passwd table, the default used is admin.',
password => 'Password of the FSP. If not filled in, xCAT will look in the passwd table for key=fsp. If not in the passwd table, the default used is admin.',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
},
@ -345,8 +345,8 @@ ppchcp => {
table_desc => 'Info necessary to use HMCs and IVMs as hardware control points for LPARs.',
descriptions => {
hcp => 'Hostname of the HMC or IVM.',
username => 'Userid of the HMC or IVM. Default is hscroot for HMCs and padmin for IVMs??',
password => 'Password of the HMC or IVM.',
username => 'Userid of the HMC or IVM. If not filled in, xCAT will look in the passwd table for key=hmc or key=ivm. If not in the passwd table, the default used is hscroot for HMCs and padmin for IVMs.',
password => 'Password of the HMC or IVM. If not filled in, xCAT will look in the passwd table for key=hmc or key=ivm. If not in the passwd table, the default used is abc123 for HMCs and padmin for IVMs.',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
},

View File

@ -24,17 +24,21 @@ xCAT-client provides the fundamental xCAT commands (chtab, chnode, rpower, etc)
%prep
%setup -q
%build
# /bin/pwd
# /bin/ls
# This phase is done in (for RH): /usr/src/redhat/BUILD/xCAT-client-2.0
# All of the tarball source has been unpacked there and is in the same file structure
# as it is in svn.
# Convert pods to man pages, e.g.: pod2man pods/man1/tabdump.1.pod share/man/man1/tabdump.1
echo "Converting pod files to man pages..."
for i in pods/*/*.pod; do
man=${i/pods/share\/man}
pod2man $i ${man%%.pod}
mkdir -p ${man%/*}
pod2man $i ${man%.pod}
done
%install
# The install phase puts all of the files in the paths they should be in when the rpm is
# installed on a system. The RPM_BUILD_ROOT is a simulated root file system and usually
# has a value like: /var/tmp/xCAT-client-2.0-snap200802270932-root
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin
@ -50,6 +54,8 @@ cp bin/* $RPM_BUILD_ROOT/%{prefix}/bin
chmod 755 $RPM_BUILD_ROOT/%{prefix}/bin/*
cp sbin/* $RPM_BUILD_ROOT/%{prefix}/sbin
chmod 755 $RPM_BUILD_ROOT/%{prefix}/sbin/*
# Most of these were built dynamically in the build phase
cp share/man/man1/* $RPM_BUILD_ROOT/%{prefix}/share/man/man1
chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/*
cp share/man/man3/* $RPM_BUILD_ROOT/%{prefix}/share/man/man3
@ -58,6 +64,7 @@ cp share/man/man5/* $RPM_BUILD_ROOT/%{prefix}/share/man/man5
chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man5/*
# cp share/man/man8/* $RPM_BUILD_ROOT/%{prefix}/share/man/man8
# chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man8/*
cp LICENSE.html $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-client
cp README $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-client
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-client/*
@ -65,6 +72,7 @@ chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-client/*
#cp usr/share/xcat/scripts/setup-local-client.sh $RPM_BUILD_ROOT/usr/share/xcat/scripts/setup-local-client.sh
#chmod 755 $RPM_BUILD_ROOT/usr/share/xcat/scripts/setup-local-client.sh
# These links get made in the RPM_BUILD_ROOT/prefix area
ln -sf xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/rpower
ln -sf xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/rscan
ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/sbin/makedhcp
@ -111,12 +119,14 @@ ln -sf ../bin/xcatDBcmds $RPM_BUILD_ROOT/%{prefix}/bin/xcat2nim
ln -sf ../bin/xdsh $RPM_BUILD_ROOT/%{prefix}/bin/xdcp
%clean
# This step does not happen until *after* the %files packaging below
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
#%doc README
#%doc LICENSE.html
# Just package everything that has been copied into RPM_BUILD_ROOT
%{prefix}
%changelog