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 munge-${MUNGE_VERSION} ${MUNGE_URL} munge-${MUNGE_VERSION}
/usr/bin/cp ${TOP_DIR}/munge-${MUNGE_VERSION}/munge.spec ${TOP_DIR}/SPECS/munge.spec
tar --exclude-vcs --create --verbose --xz --file ${TOP_DIR}/SOURCES/munge-${MUNGE_VERSION}.tar.xz munge-${MUNGE_VERSION}
# installing dependencies
/bin/yum makecache fast
/usr/bin/touch /var/lib/rpm/*
/bin/yum-builddep -y -q -e 0 ${TOP_DIR}/SPECS/munge.spec
/usr/bin/cp ${TOP_DIR}/rpmmacros ~/.rpmmacros
# compiling rpm
/usr/bin/rpmbuild --clean --target=${MUNGE_DEST_ARCH} ${MUNGE_OPTIONS} -ba ${TOP_DIR}/SPECS/munge.spec
# moving rpms to artifacts directories
/usr/bin/find ${TOP_DIR}/RPMS/ -type f -exec /usr/bin/cp -v {} ${TOP_DIR}/ARTIFACTS/{} \;
# installing result to be used when compiling slurm
/usr/bin/find ${TOP_DIR}/RPMS/ -type f -exec /usr/bin/yum install -y -q -e 0 {} \;
# Cleaning post compilation
/usr/bin/rm -rf ${TOP_DIR}/BUILD/* ${TOP_DIR}/RPMS/* ${TOP_DIR}/SRPMS/* ${TOP_DIR}/SOURCES/* ${TOP_DIR}/BUILDROOT/*