mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-22 03:32:04 +00:00
39 lines
963 B
Bash
Executable File
39 lines
963 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
function makepythonrpm {
|
|
RPMNAME="$1"
|
|
SPEC_FILE="$RPMNAME.spec"
|
|
tar --exclude .svn -czvf $RPMROOT/SOURCES/$RPMNAME-${VER}.tar.gz $RPMNAME
|
|
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
|
|
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm $EMBEDTXT..."
|
|
rpmbuild --quiet -ta $RPMROOT/SOURCES/$RPMNAME-${VER}.tar.gz --define "version $VER" $REL "$EASE"
|
|
if [ $? -eq 0 ]; then
|
|
exit 0
|
|
else
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
# Main code....
|
|
OSNAME=$(uname)
|
|
VER=`cat Version`
|
|
REL="--define"
|
|
EASE='usedate 1'
|
|
RPMROOT=/root/rpmbuild
|
|
|
|
rpmbuild --version > /dev/null
|
|
if [ $? -gt 0 ]; then
|
|
echo "Error: rpmbuild does not appear to be installed or working."
|
|
exit 2
|
|
fi
|
|
|
|
if [ -n "$1" -a "$1" = "xCAT-openbmc-py" ]; then
|
|
makepythonrpm $1
|
|
else
|
|
echo 'Usage: makepythonrpm xCAT-openbmc-py'
|
|
exit 1
|
|
fi
|
|
|