#!/bin/sh -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 if [ "${SLURM_RELEASE_SPEC}" != "1" ]; then /usr/bin/git clone -b slurm-${SLURM_VERSION} ${SLURM_URL} ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION_SPEC}-${SLURM_RELEASE_SPEC} /usr/bin/sed -i "s|^Name:.*|Name: slurm|g" ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION_SPEC}-${SLURM_RELEASE_SPEC}/slurm.spec /usr/bin/sed -i "s|^Version:.*|Version: ${SLURM_VERSION_SPEC}|g" ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION_SPEC}-${SLURM_RELEASE_SPEC}/slurm.spec /usr/bin/sed -i "s|^Release:.*|Release: ${SLURM_RELEASE_SPEC}|g" ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION_SPEC}-${SLURM_RELEASE_SPEC}/slurm.spec /usr/bin/cp ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION_SPEC}-${SLURM_RELEASE_SPEC}/slurm.spec ${TOP_DIR}/SPECS/slurm.spec /usr/bin/tar --exclude-vcs --totals --create --verbose --bzip2 --file ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION_SPEC}-${SLURM_RELEASE_SPEC}.tar.bz2 -C ${TOP_DIR}/SOURCES/ slurm-${SLURM_VERSION_SPEC}-${SLURM_RELEASE_SPEC} else /usr/bin/git clone -b slurm-${SLURM_VERSION} ${SLURM_URL} ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION_SPEC} /usr/bin/sed -i "s|^Name:.*|Name: slurm|g" ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION_SPEC}/slurm.spec /usr/bin/sed -i "s|^Version:.*|Version: ${SLURM_VERSION_SPEC}|g" ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION_SPEC}/slurm.spec /usr/bin/sed -i "s|^Release:.*|Release: ${SLURM_RELEASE_SPEC}|g" ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION_SPEC}/slurm.spec /usr/bin/cp ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION_SPEC}/slurm.spec ${TOP_DIR}/SPECS/slurm.spec /usr/bin/tar --exclude-vcs --totals --create --verbose --bzip2 --file ${TOP_DIR}/SOURCES/slurm-${SLURM_VERSION_SPEC}.tar.bz2 -C ${TOP_DIR}/SOURCES/ slurm-${SLURM_VERSION_SPEC} fi # installing dependencies /usr/bin/yum makecache fast /usr/bin/touch /var/lib/rpm/* /usr/bin/echo "${SLURM_BUILD_DEP_OPTIONS}" | /usr/bin/xargs /bin/yum-builddep -y ${TOP_DIR}/SPECS/slurm.spec /usr/bin/cp ${TOP_DIR}/rpmmacros ~/.rpmmacros /usr/bin/yum install -y jsoncpp-devel json-c-devel json-parser-devel hdf5-devel pmix-devel freeipmi-devel rrdtool-devel man2html man2html-core libcurl-devel glib2-devel hwloc-devel gtk2-devel lua-devel numactl-devel lz4-devel \ jsoncpp json-c json-parser hdf5 pmix freeipmi rrdtool man2html man2html-core libcurl glib2 hwloc gtk2 lua numactl numactl-libs numad lz4 pmix pmix-devel /usr/bin/yum --setopt=group_package_types=optional groupinstall -y "Infiniband Support" # compiling rpm /usr/bin/rpmbuild --clean --target=${SLURM_DEST_ARCH} ${SLURM_BUILD_OPTIONS} -ba ${TOP_DIR}/SPECS/slurm.spec # moving rpms to artifacts directories /usr/bin/find ${TOP_DIR}/RPMS/ -type f -iname "*.rpm" -exec /usr/bin/cp -v {} ${TOP_DIR}/ARTIFACTS/ \; # installing rpm to check if all is ok and to enable compilation of slurm related products /usr/bin/yum install -y ${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/*