2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-21 03:02:05 +00:00

update build scripts to allow non-root user to build xcat-core tarball locally

This commit is contained in:
ligc 2015-05-26 04:20:46 -04:00
parent 7ec5d73d1d
commit e63a398bfc
6 changed files with 25 additions and 17 deletions

View File

@ -3,7 +3,7 @@
# Sign an RPM. This must be run as root, and root must have already set up the key.
# I think the key needs to come from /root/.gnupg
set env(HOME) /root
#set env(HOME) /root
#
# This Expect script was generated by autoexpect on Fri Jun 27 10:45:23 2008

View File

@ -80,14 +80,16 @@ OSNAME=$(uname)
if [ "$OSNAME" != "AIX" ]; then
GSA=http://pokgsa.ibm.com/projects/x/xcat/build/linux
# Get a lock, so can not do 2 builds at once
exec 8>/var/lock/xcatbld-$REL.lock
if ! flock -n 8; then
echo "Can't get lock /var/lock/xcatbld-$REL.lock. Someone else must be doing a build right now. Exiting...."
exit 1
fi
# This is so rpm and gpg will know home, even in sudo
export HOME=/root
if [ "$(id -u)" == "0" ]; then
# Get a lock, so can not do 2 builds at once
exec 8>/var/lock/xcatbld-$REL.lock
if ! flock -n 8; then
echo "Can't get lock /var/lock/xcatbld-$REL.lock. Someone else must be doing a build right now. Exiting...."
exit 1
fi
# This is so rpm and gpg will know home, even in sudo
export HOME=/root
fi
fi
# for the git case, query the current branch and set REL (changing master to devel if necessary)
@ -131,9 +133,11 @@ fi
XCATCORE="xcat-core" # core-snap is a sym link to xcat-core
if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms
DESTDIR=../../$REL$EMBEDDIR/$XCATCORE
#DESTDIR=../../$REL$EMBEDDIR/$XCATCORE
DESTDIR=$HOME/xcatbuild/$REL$EMBEDDIR/$XCATCORE
else
DESTDIR=../..$EMBEDDIR/$XCATCORE
#DESTDIR=../..$EMBEDDIR/$XCATCORE
DESTDIR=$HOME/xcatbuild/..$EMBEDDIR/$XCATCORE
fi
SRCD=core-snap-srpms
@ -143,7 +147,7 @@ if [ "$OSNAME" = "AIX" ]; then
SYSGRP=system
else
NOARCH=noarch
SYSGRP=root
SYSGRP=$(id -g)
fi
function setversionvars {
@ -453,7 +457,7 @@ if [ -n "$VERBOSEMODE" ]; then
else
verboseflag=""
fi
echo "Creating $TARNAME ..."
echo "Creating $(dirname $DESTDIR)/$TARNAME ..."
if [[ -e $TARNAME ]]; then
mkdir -p previous
mv -f $TARNAME previous

View File

@ -19,7 +19,8 @@ use Pod::Html;
my $poddir = 'pods';
my $mandir = 'share/man';
my $htmldir = 'share/doc';
my $cachedir = '/tmp';
my $cachedir = "$ENV{'HOME'}/tmp";
if (system("mkdir -p $cachedir")) { die "Error: could not create $cachedir.\n"; }
my $isaix = ($^O =~ /^aix/i);
my $skiponaix = 'route|group';

View File

@ -15,7 +15,8 @@ use Pod::Html;
my $poddir = 'pods';
my $mandir = 'share/man';
my $htmldir = 'share/doc';
my $cachedir = '/tmp';
my $cachedir = "$ENV{'HOME'}/tmp";
if (system("mkdir -p $cachedir")) { die "Error: could not create $cachedir.\n"; }
my @pods = getPodList($poddir);
#foreach (@pods) { print "$_\n"; } exit;

View File

@ -15,7 +15,8 @@ use Pod::Html;
my $poddir = 'pods';
my $mandir = 'share/man';
my $htmldir = 'share/doc';
my $cachedir = '/tmp';
my $cachedir = "$ENV{'HOME'}/tmp";
if (system("mkdir -p $cachedir")) { die "Error: could not create $cachedir.\n"; }
my @pods = getPodList($poddir);
#foreach (@pods) { print "$_\n"; } exit;

View File

@ -15,7 +15,8 @@ use Pod::Html;
my $poddir = 'pods';
my $mandir = 'share/man';
my $htmldir = 'share/doc';
my $cachedir = '/tmp';
my $cachedir = "$ENV{'HOME'}/tmp";
if (system("mkdir -p $cachedir")) { die "Error: could not create $cachedir.\n"; }
my @pods = getPodList($poddir);
#foreach (@pods) { print "$_\n"; } exit;