packaging changes. Default installation direcotry is /opt/xcat now. environmental variables XCATROOT, PATH and MANPATH got updated by installed the packages. Did not touch xCAT and xcatnbroot yet.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@153 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
linggao 2007-12-11 19:15:28 +00:00
parent 7cade470d5
commit b947a175a2
14 changed files with 111 additions and 41 deletions

View File

@ -22,7 +22,7 @@ else
pkg="packages"
fi
tar czvf xCAT-client-2.0.tar.gz xCAT-client-2.0;
tar --exclude .svn -czvf xCAT-client-2.0.tar.gz xCAT-client-2.0;
rm /usr/src/$pkg/RPMS/noarch/xCAT-client-2.0*rpm
rpmbuild -ta xCAT-client-2.0.tar.gz ;
#rpm -Uvh /usr/src/$pkg/RPMS/noarch/xCAT-client-2.0*rpm

View File

@ -21,7 +21,7 @@ else
pkg="packages"
fi
tar czvf xCAT-server-2.0.tar.gz xCAT-server-2.0;
tar --exclude .svn -czvf xCAT-server-2.0.tar.gz xCAT-server-2.0;
rm /usr/src/$pkg/RPMS/noarch/xCAT-server-2.0*rpm
rpmbuild -ta xCAT-server-2.0.tar.gz ;
#rpm -Uvh /usr/src/$pkg/RPMS/noarch/xCAT-server-2.0*rpm

View File

@ -8,7 +8,7 @@ Source: perl-xCAT-2.0.tar.gz
Packager: IBM Corp.
Vendor: IBM Corp.
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
Prefix: %{_prefix}
Prefix: /opt/xcat
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
%ifos linux
BuildArch: noarch
@ -21,41 +21,39 @@ Provides perl xCAT libraries for core functionality. Required for all xCAT inst
Includes xCAT::Table, xCAT::NodeRange, among others.
%prep
%setup -q -n perl-xCAT-%{version}
%setup -q
%build
perl Makefile.PL
%{__make} %{?mflags}
%install
%{__make} install DESTDIR=$RPM_BUILD_ROOT %{?mflags_install}
test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT/%{_datadir} ||:
test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT/%{_libdir}/perl5/5* ||:
find %{buildroot} -name "perllocal.pod" \
-o -name ".packlist" \
-o -name "*.bs" \
|xargs -i rm -f {}
rm -rf $RPM_BUILD_ROOT
# ndebug - this seems to break the AIX build - need to investigate
%ifos linux
find %{buildroot}%{_prefix} \
-type d -depth \
-exec rmdir {} \; 2>/dev/null
%endif
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/data
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT
find $RPM_BUILD_ROOT -type f | sed -e "s@$RPM_BUILD_ROOT@/@" > files.list
cp -r xCAT/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/*
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/data/*
cp xCAT2.0.doc $RPM_BUILD_ROOT/%{prefix}/share/doc
cp xCAT2.0.pdf $RPM_BUILD_ROOT/%{prefix}/share/doc
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/*
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/*
%clean
test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT
%files -f files.list
#find $RPM_BUILD_ROOT -type f | sed -e "s@$RPM_BUILD_ROOT@/@" > files.list
%files
%defattr(-, root, root)
%doc LICENSE.html
%doc README
%doc xCAT2.0.doc
%doc xCAT2.0.pdf
#%doc LICENSE.html
#%doc README
#%doc xCAT2.0.doc
#%doc xCAT2.0.pdf
%{prefix}
%changelog
* Wed May 2 2007 - Norm Nott nott@us.ibm.com

View File

@ -1,6 +1,11 @@
#!/usr/bin/env perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
package xCAT::Client;
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
use xCAT::NodeRange;
use xCAT::Utils;
use xCAT::Table;
@ -35,7 +40,7 @@ my %resps;
# in those directories will be loaded in as plugins (for duplicate
# commands, last one in wins). If it is set to any other value
# (e.g. "yes", "default", whatever string you want) the default plugin
# directory /usr/lib/xcat/plugins will be used.
# directory /opt/xcat/lib/perl/xCAT_plugin will be used.
#
# Input:
# Request hash - A hash ref containing the input command and args to be
@ -80,12 +85,7 @@ sub submit_request {
unless ($sitetab) {
print ("ERROR: Unable to open basic site table for configuration\n");
}
$::XCATPREFIX = '/usr';
my ($tmp) = $sitetab->getAttribs({'key'=>'xcatprefix'},'value');
if ($tmp and $tmp->{value}) {
$::XCATPREFIX = $tmp->{value};
}
$plugins_dir=$::XCATPREFIX.'/lib/xcat/plugins';
$plugins_dir=$::XCATROOT.'/lib/perl/xCAT_plugin';
scan_plugins();
}

View File

@ -1,6 +1,12 @@
#!/usr/bin/env perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
package xCAT::NotifHandler;
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
use File::Basename qw(fileparse);
#%notif is a cache that holds the info from the "notification" table.
@ -294,8 +300,8 @@ sub notify {
if ($pid=fork()) { }
elsif (defined($pid)) {
if (($path eq "") || ($path eq ".\/")) {
#default path is /usr/lib/xcat/monitoring/ if there is no path specified
require "/usr/lib/xcat/monitoring/".$modname.".pm";
#default path is /opt/xcat/lib/perl/xCAT_monitoring/ if there is no path specified
require "$::XCATROOT/lib/perl/xCAT_monitoring/".$modname.".pm";
} else {
require $_;
}

View File

@ -7,6 +7,11 @@
#but going for prototype
#class xcattable
package xCAT::Table;
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
use DBI;

View File

@ -1,5 +1,10 @@
#!/usr/bin/env perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
use xCAT::Table;
use xCAT::NodeRange;
use IO::Socket::SSL;

View File

@ -4,6 +4,12 @@
#I've not had the time. Net::Ping shows perl code I could see being adapted for a somewhat
#asynchronous ICMP ping (the tcp syn is interesting, but far too limited, and that is currently the only async
#method Net::Ping provides.
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
use IO::Socket::SSL;
use XML::Simple;
use Data::Dumper;

View File

@ -1,5 +1,10 @@
#!/usr/bin/env perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
use IO::Socket::SSL;
use XML::Simple;
use Data::Dumper;

View File

@ -1,5 +1,10 @@
#!/usr/bin/env perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
use File::Basename;
use xCAT::MsgUtils;

View File

@ -1,5 +1,10 @@
#!/usr/bin/env perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
use IO::Socket::SSL;
use IO::Socket::INET;
use File::Basename;

View File

@ -1,5 +1,10 @@
#!/usr/bin/env perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
use IO::Socket::SSL;
use IO::Socket::INET;
use File::Basename;

View File

@ -1,6 +1,11 @@
#!/usr/bin/env perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
#Just like xcatclient, but needs to read a file in and pass it as $request->data
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
use IO::Socket::SSL;
use IO::Socket::INET;
use File::Basename;

View File

@ -8,7 +8,7 @@ Source: xCAT-client-2.0.tar.gz
Packager: IBM Corp.
Vendor: IBM Corp.
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
Prefix: /usr
Prefix: /opt/xcat
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
# AIX will build with an arch of "ppc"
@ -33,6 +33,7 @@ mkdir -p $RPM_BUILD_ROOT/%{prefix}/sbin
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/scripts
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man5
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-client
cp bin/* $RPM_BUILD_ROOT/%{prefix}/bin
chmod 755 $RPM_BUILD_ROOT/%{prefix}/bin/*
@ -42,6 +43,9 @@ cp share/man/man1/* $RPM_BUILD_ROOT/%{prefix}/share/man/man1
chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/*
cp share/man/man5/* $RPM_BUILD_ROOT/%{prefix}/share/man/man5
chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man5/*
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/*
#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
@ -90,8 +94,8 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README
%doc LICENSE.html
#%doc README
#%doc LICENSE.html
%{prefix}
%changelog
@ -101,3 +105,24 @@ rm -rf $RPM_BUILD_ROOT
* Tue Feb 20 2007 Jarrod Johnson <jbjohnso@us.ibm.com>
- Start core rpm for 1.3 work
%post
%ifos linux
echo "XCATROOT=$XCATROOT
PATH=\$PATH:\$XCATROOT/bin:\$XCATROOT/sbin
MANPATH=\$MANPATH:\$XCATROOT/share/man
export XCATROOT PATH MANPATH" >/etc/profile.d/xcat.sh
echo "setenv XCATROOT \"$XCATROOT\"
setenv PATH \${PATH}:\${XCATROOT}/bin:\${XCATROOT}/sbin
setenv MANPATH \${MANPATH}:\${XCATROOT}/share/man" >/etc/profile.d/xcat.csh
chmod 755 /etc/profile.d/xcat.*
%endif
%preun
%ifos linux
if [ $1 == 0 ]; then #This means only on -e
rm /etc/profile.d/xcat.*
unset XCATROOT
fi
%endif