-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild-info
executable file
·54 lines (43 loc) · 1.16 KB
/
build-info
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
# build-info -- Generate header file containing build details
# $Id$
rep_version="$1"
repdir="$2"
replispdir="$3"
repexecdir="$4"
repdocfile="$5"
repcommonexecdir="$6"
[ -n "$HOSTNAME" ] \
|| HOSTNAME=`hostname` \
|| HOSTNAME=unknown
sys_name="$HOSTNAME"
user_name="$LOGNAME"
dateopts=""
if [ -n "$SOURCE_DATE_EPOCH" ] ; then
if date --version|grep -q GNU ; then
dateopts="-u -d @$SOURCE_DATE_EPOCH"
else
dateopts="-u -r $SOURCE_DATE_EPOCH"
fi
sys_name=reproducible
user_name=reproducible
fi
build_date="`date $dateopts +'%a %b %e %Y'`"
build_time="`date $dateopts +'%T %Z'`"
cat <<EOF
/* build.h -- Definitions relating to the current build
Automatically generated by build-info; DO NOT EDIT! */
#ifndef BUILD_H
#define BUILD_H
#define REP_VERSION "$rep_version"
#define REP_DIRECTORY "$repdir"
#define REP_LISP_DIRECTORY "$replispdir"
#define REP_EXEC_DIRECTORY "$repexecdir"
#define REP_COMMON_EXEC_DIRECTORY "$repcommonexecdir"
#define REP_DOC_FILE "$repdocfile"
#define BUILD_HOST "$sys_name"
#define BUILD_USER "$user_name"
#define BUILD_DATE "$build_date"
#define BUILD_TIME "$build_time"
#endif /* BUILD_H */
EOF