blob: 70a9f5f4163046f1442a8fc715016790eb70c769 [file] [log] [blame]
#!/bin/bash -x
set -e
ARGS=()
# If we're running under jenkins, let's do some extra stuff
if [ "$1" = "-j" ] ; then
# We expect that the vdp-system-rpms build has already run in a sibling directory
# and put the results into DST_DIR
rpm -i ../DST_DIR/system/x86_64/platformmgr-*.rpm
mkdir -p RPMS/SOURCES
ARGS+=(--define="_topdir $(pwd)/RPMS")
fi
mkdir -p ./tmp/fence-agent-build/
export FENCE_AGENT_TMP=$(make/git-version-gen .tarball-version)
export FENCE_AGENT_TMP2=${FENCE_AGENT_TMP##*.}
export FENCE_AGENT_VER=${FENCE_AGENT_TMP%.*}
export FENCE_AGENT_REL=${FENCE_AGENT_TMP2%-*}
export FENCE_AGENT_TAG=${FENCE_AGENT_TMP##*-}
./autogen.sh
./configure
make dist-gzip
mv *.tar.gz ./tmp/fence-agent-build/
tar -zxf ./tmp/fence-agent-build/fence-agents-*.gz -C ./tmp/fence-agent-build/
mv ./tmp/fence-agent-build/fence-agents-${FENCE_AGENT_VER}.${FENCE_AGENT_REL}-${FENCE_AGENT_TAG} ./tmp/fence-agent-build/fence-agents-${FENCE_AGENT_VER}
tar -cjSf ./tmp/fence-agent-build/fence-agents-${FENCE_AGENT_VER}.tar.bz2 -C ./tmp/fence-agent-build/ ./fence-agents-${FENCE_AGENT_VER}/
mv ./tmp/fence-agent-build/fence-agents-*.bz2 ./RPMS/SOURCES/
rpmbuild -ba ./fence-agents.spec --define="version ${FENCE_AGENT_VER}" --define="release ${FENCE_AGENT_REL}" --define="tag ${FENCE_AGENT_TAG}" "${ARGS[@]}"