File: build-info

package info (click to toggle)
sawfish 1:1.11.90-1.2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 26,204 kB
  • sloc: lisp: 30,914; ansic: 14,583; sh: 11,203; makefile: 562; python: 91; perl: 7
file content (49 lines) | stat: -rw-r--r-- 1,371 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
# build-info -- Generate header file containing build details
# $Id: build-info,v 1.5 2000/11/16 21:58:27 jsh Exp $

version="$1"
sawfishdir="$2"
lispdir="$3"
sawfishexecdir="$4"
localedir="$5"

[ -n "$HOSTNAME" ] \
    || HOSTNAME=`hostname` \
    || HOSTNAME=unknown

[ -n "$LOCALDOMAIN" ] \
    || LOCALDOMAIN=`dnsdomainname` \
    || LOCALDOMAIN=`domainname` \
    || LOCALDOMAIN=unknown

sys_name="$HOSTNAME.$LOCALDOMAIN"
user_name="$LOGNAME"

SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
DATE_FMT="%Y-%m-%d"
build_date=$(date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u "+$DATE_FMT")
DATE_FMT="%T %Z"
build_time=$(date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u "+$DATE_FMT")

cat >src/build.h <<EOF
/* build.h -- Definitions relating to the current build
   Automatically generated by build-info; DO NOT EDIT! */

#ifndef BUILD_H
#define BUILD_H

#define SAWFISH_VERSION "$version"
#define SAWFISH_DIR "$sawfishdir"
#define SAWFISH_LISPDIR "$lispdir"
#define SAWFISH_EXECDIR "$sawfishexecdir"
#define SAWFISH_LOCALEDIR "$localedir"

#define BUILD_HOST "unknown"
#define BUILD_USER "unknown"

#define BUILD_DATE "$build_date"
#define BUILD_TIME "$build_time"

#endif /* BUILD_H */
EOF