darling/rpm/build.bsh
Andy Neff 7a3f77e4ad
Rpm auto version (#918)
* Auto update rpm version based on date of last commit

Signed-off-by: Andy Neff <andy@visionsystemsinc.com>

* Remove test code left behind by accident

Signed-off-by: Andy Neff <andy@visionsystemsinc.com>

* Use git describe instead

Signed-off-by: Andy Neff <andy@visionsystemsinc.com>

* Update Dockerfile
2021-02-12 12:58:46 -05:00

19 lines
632 B
Bash

#!/usr/bin/env bash
set -eu
yum-builddep -y /src/rpm/SPECS/darling.spec
if [ -e "/src/rpm/SOURCES/darling.tar.gz" ]; then
ln -s /src/rpm/SOURCES/darling.tar.gz /root/rpmbuild/SOURCES/
else
# Preparing tarball
tar --transform "s|^\./|./darling/|" -cf /root/rpmbuild/SOURCES/darling.tar.gz -C /src --exclude=.git --exclude SOURCES --exclude SRPMS --exclude RPMS .
fi
ln -s /src/rpm/SOURCES/dkms.conf /root/rpmbuild/SOURCES/
DARLING_COMMIT_DATE="$(cd /src; git describe --tags HEAD)"
export DARLING_COMMIT_DATE="${DARLING_COMMIT_DATE//-/}"
#spectool -g -R /src/rpm/SPECS/darling.spec
rpmbuild -ba /src/rpm/SPECS/darling.spec