File: vmrelease.sh

package info (click to toggle)
vmatch 2.3.1%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 17,108 kB
  • sloc: ansic: 70,897; sh: 7,139; perl: 4,152; makefile: 1,181; xml: 642; awk: 563; ruby: 306; haskell: 288; sed: 60
file content (42 lines) | stat: -rwxr-xr-x 861 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
USAGE="Usage: $0 <cflagsstring>"
COPYRIGHT="${WORKVSTREESRC}/Copyright"
PROGRAM=VSTREE

if test $# -eq 0
then
  echo ${USAGE}
  exit 1
fi

if test -f ${COPYRIGHT}
then
  cat ${COPYRIGHT}
else
  echo "$0: cannot open file \"${COPYRIGHT}\""
  exit 1
fi

cat << ENDOFRELEASEPRE
#ifndef ${PROGRAM}RELEASE_H
#define ${PROGRAM}RELEASE_H
ENDOFRELEASEPRE

date +"#define ${PROGRAM}COMPILEDATE \"%Y-%m-%d %H:%M:%S\"" --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}"

shift # get rid of first argument
echo "#define ${PROGRAM}CFLAGS \"(reproducible build)\""

if [ -n "${SOURCE_DATE_EPOCH}" ]
then
  HOSTNAME="(reproducible build)"
else
  HOSTNAME="`hostname`"
fi

cat << ENDOFRELEASEPOST
#define ${PROGRAM}RELEASEDATE "2007-Aug-27"
#define ${PROGRAM}VERSION "`cat ${WORKVSTREESRC}/VERSION`"
#define ${PROGRAM}COMPILEHOST "${HOSTNAME}"
#endif
ENDOFRELEASEPOST