Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to override build date #332

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions cf/krb-version.m4
Expand Up @@ -15,9 +15,15 @@ if test -f include/version.h && cmp -s include/newversion.h.in include/version.h
rm -f include/newversion.h.in
else
echo "creating include/version.h"
User=${USER-${LOGNAME}}
Host=`(hostname || uname -n) 2>/dev/null | sed 1q`
Date=`date`
if [ -n "$SOURCE_DATE_EPOCH" ] ; then
User=reproducible
Host=reproducible
Date=`date -u -d "@$SOURCE_DATE_EPOCH" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" 2>/dev/null || date -u`
else
User=${USER-${LOGNAME}}
Host=`(hostname || uname -n) 2>/dev/null | sed 1q`
Date=`date`
fi
mv -f include/newversion.h.in include/version.h.in
sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h
fi
Expand Down
12 changes: 9 additions & 3 deletions configure.ac
Expand Up @@ -676,9 +676,15 @@ if test -f include/version.h && cmp -s include/newversion.h.in include/version.h
rm -f include/newversion.h.in
else
echo "creating include/version.h"
User=${USER-${LOGNAME}}
Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
Date=`date`
if [ -n "$SOURCE_DATE_EPOCH" ] ; then
User=reproducible
Host=reproducible
Date=`date -u -d "@$SOURCE_DATE_EPOCH" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" 2>/dev/null || date -u`
else
User=${USER-${LOGNAME}}
Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
Date=`date`
fi
mv -f include/newversion.h.in include/version.h.in
sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h
fi