forked from OpenSC/OpenSC
-
Notifications
You must be signed in to change notification settings - Fork 2
/
bootstrap.ci
executable file
·79 lines (68 loc) · 1.92 KB
/
bootstrap.ci
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh
usage()
{
cat << EOF
usage: $0 options
OpenSC bootstrap
OPTIONS:
-h Show this message
-s Package suffix
-S Use package suffix as 'g' appended with the date of last commit
-r Package version revision
-R Use package version revision as Git commit number from 'git describe' result
-b Package branch
-B Use package branch as current Git branch
EOF
}
SUFFIX=
REVISION=
VERBOSE=
KEEPVERSION=
while getopts “:hs:Sr:RK” OPTION
do
case $OPTION in
h)
usage
exit 1
;;
s)
SUFFIX=$OPTARG
;;
S)
SUFFIX=g`git log -1 --pretty=fuller --date=iso | grep CommitDate: | sed -E 's/^CommitDate:\s(.*)/\1/' | sed -E 's/(.*)-(.*)-(.*) (.*):(.*):(.*)\s+.*/\1\2\3\4\5\6/'`
;;
r)
REVISION=$OPTARG
;;
R)
REVISION=`git describe | perl -ne 'print $1 if /^[\.0-9]*-([0-9]*)-g[a-z0-9]*$/;'`
;;
?)
usage
exit
;;
esac
done
set -e
set -x
if [ -f Makefile ]; then
make distclean
fi
rm -rf *~ *.cache config.guess config.log config.status config.sub depcomp ltmain.sh version.m4.ci
if [ -n "$SUFFIX" ] || [ -n "$REVISION" ]
then
cp -a version.m4 version.m4.tmp
if [ -n "$SUFFIX" ]
then
echo Set package suffix "$SUFFIX"
sed 's/^define(\[PACKAGE_SUFFIX\],\s*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_SUFFIX\], \['$SUFFIX'\])/g' version.m4.tmp > version.m4.ci
cp version.m4.ci version.m4.tmp
fi
if [ -n "$REVISION" ]
then
echo Set package revision "$REVISION"
sed 's/^define(\[PACKAGE_VERSION_REVISION\],\s*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_VERSION_REVISION\], \['$REVISION'\])/g' version.m4.tmp > version.m4.ci
fi
rm -f version.m4.tmp
fi
autoreconf --verbose --install --force || true