Newer
Older
#!/bin/bash -xe
# Cleaning pre compilation
/usr/bin/rm -rf ${TOP_DIR}/BUILD/* ${TOP_DIR}/RPMS/* ${TOP_DIR}/SRPMS/* ${TOP_DIR}/SOURCES/* ${TOP_DIR}/BUILDROOT/*
# retrieving sources
/usr/bin/cd ${TOP_DIR}/SOURCES
/usr/bin/git clone -b slurm-${SLURM_VERSION} ${SLURM_URL} slurm-${SLURM_VERSION}
/usr/bin/cp ${TOP_DIR}/slurm-${SLURM_VERSION}/slurm.spec ${TOP_DIR}/SPECS/slurm.spec
tar --exclude-vcs --create --verbose --xz --bzip2 ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION}.tar.bz2 slurm-${SLURM_VERSION}
# installing dependencies
/bin/yum makecache fast
/usr/bin/touch /var/lib/rpm/*
/bin/yum-builddep -y -q -e 0 ${TOP_DIR}/SPECS/slurm.spec
/usr/bin/cp ${TOP_DIR}/rpmmacros ~/.rpmmacros
# compiling rpm
/usr/bin/rpmbuild --clean --target=${SLURM_DEST_ARCH} ${SLURM_OPTIONS} -ba ${TOP_DIR}/SPECS/slurm.spec
# moving rpms to artifacts directories
/usr/bin/find ${TOP_DIR}/RPMS/ -type f -exec /usr/bin/cp -v {} ${TOP_DIR}/ARTIFACTS/ \;
# Cleaning post compilation
/usr/bin/rm -rf ${TOP_DIR}/BUILD/* ${TOP_DIR}/RPMS/* ${TOP_DIR}/SRPMS/* ${TOP_DIR}/SOURCES/* ${TOP_DIR}/BUILDROOT/*