2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2024-11-21 17:11:45 +00:00
xcat-dep/zhcp/buildrpm.sh
phamt 07988c9aaf Checked in code for zHCP
Former-commit-id: 65e99f12d360a09b00e8c8c54b106914b8de9c2a
2010-04-13 20:27:58 +00:00

47 lines
1.7 KiB
Bash

#!/bin/bash
#--------------------------------------------------------------------------
# Get oriented
#--------------------------------------------------------------------------
BUILD=$PWD
#--------------------------------------------------------------------------
# Prepare environment
#--------------------------------------------------------------------------
rm -rf $BUILD/variable 2>/dev/null
mkdir -p $BUILD/variable 2>/dev/null
echo "%_topdir $BUILD" > $BUILD/variable/.rpmmacros
cp $BUILD/variable/.rpmmacros $HOME 2>/dev/null
#---------------------------------------------------------------------------
# Create tar file of zVM MAP agent code
#---------------------------------------------------------------------------
cd $BUILD/ 2>/dev/null
rm -rf $BUILD/BUILD 2>/dev/null
rm -rf $BUILD/RPMS 2>/dev/null
rm -rf $BUILD/SOURCES 2>/dev/null
rm -rf $BUILD/SPECS 2>/dev/null
rm -rf $BUILD/SRPMS 2>/dev/null
mkdir -p $BUILD/BUILD 2>/dev/null
mkdir -p $BUILD/RPMS 2>/dev/null
mkdir -p $BUILD/SOURCES 2>/dev/null
mkdir -p $BUILD/SPECS 2>/dev/null
mkdir -p $BUILD/SRPMS 2>/dev/null
#---------------------------------------------------------------------------
# Copy source and build files into input directories
#---------------------------------------------------------------------------
tar -zcvf $BUILD/zhcp-build.tar.gz zhcp-build 2>/dev/null
mv $BUILD/zhcp-build.tar.gz $BUILD/SOURCES
cp $BUILD/zhcp.spec $BUILD/SPECS 2>/dev/null
#---------------------------------------------------------------------------
# Build the RPM
#---------------------------------------------------------------------------
rpmbuild -ba -v $BUILD/SPECS/zhcp.spec > $BUILD/rpmbuild.log 2>&1