Allow to override build date with SOURCE_DATE_EPOCH (#1176)

in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
This commit is contained in:
Bernhard M. Wiedemann
2021-05-09 15:09:15 +02:00
committed by GitHub
parent ae2470fad4
commit 0663544be8
+4 -1
View File
@@ -76,7 +76,10 @@ if test -d ".git" || test -f ".git" ; then :
else
GIT_RELEASE="${PACKAGE_VERSION}"
GIT_DATE=`date -u -r CHANGELOG.md`
NDPI_API_VERSION=`date +%s | cut -c7-10`
if test -z "$SOURCE_DATE_EPOCH" ; then :
SOURCE_DATE_EPOCH=`date +%s`
fi
NDPI_API_VERSION=`echo $SOURCE_DATE_EPOCH | cut -c7-10`
fi
NDPI_API_VERSION=`echo $NDPI_API_VERSION | sed 's/^0*//'`