~singpolyma/asterisk

ref: e53028316af1111dba45bf16c7d41b7a4d7ca5c3 asterisk/build_tools/make_build_h -rwxr-xr-x 765 bytes
e5302831 — Debian VoIP Team build-reproducibly 3 years ago
                                                                                
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
#!/bin/sh
HOSTNAME=`uname -n | sed 's/\\\\/\\\\\\\\/g'`
KERNEL=`uname -r   | sed 's/\\\\/\\\\\\\\/g'`
MACHINE=`uname -m  | sed 's/\\\\/\\\\\\\\/g'`
OS=`uname -s`
USER=`id | awk -F")" '{print $1}'| awk -F"(" '{print $2}' | sed 's/\\\\/\\\\\\\\/g'`
DATE=`date -u "+%Y-%m-%d %H:%M:%S"`
if [ -n "${SOURCE_DATE_EPOCH}" ]; then
	# building reproducibly, faking some data
	HOSTNAME='buildd.debian.org'
	KERNEL='unknown'
	MACHINE='unknown'
	USER='nobody'
	DATE=`date -u "+%Y-%m-%d %H:%M:%S" -d @${SOURCE_DATE_EPOCH}`
fi
cat << END
/*
 * build.h
 * Automatically generated
 */
#define BUILD_HOSTNAME "${HOSTNAME}"
#define BUILD_KERNEL "${KERNEL}"
#define BUILD_MACHINE "${MACHINE}"
#define BUILD_OS "${OS}"
#define BUILD_DATE "${DATE} UTC"
#define BUILD_USER "${USER}"

END