]> git.ozlabs.org Git - petitboot/blob - bootstrap
discover: Add discover_server_notify_boot_status
[petitboot] / bootstrap
1 #! /bin/bash
2 # bootstrap -- Use this script to create generated files from a VCS checkout
3 #
4
5 version=
6
7 if [ "$1" ]; then
8         version=$1
9 elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then
10
11         # If available, use the git commit revision for the package version.
12
13         # Add a date prefix for easy reading.
14         # date='2010-11-30 16:36:09 -0800'
15
16         date=$(git log --pretty=format:"%ci" -1 HEAD)
17         date=${date##20}
18         date=${date%%:[0-9][0-9] *}
19         date=${date//-/.}
20         date=${date// /.}
21         date=${date//:/.}
22
23         version=$(printf '%s-%s%s' ${date} g ${head})
24
25         # Add a '-dirty' postfix for uncommitted changes.
26
27         if git diff-index HEAD | read dummy; then
28                 version=`printf '%s%s' ${version} -dirty`
29         fi
30 else
31         # Default to current date and time.
32
33         version="dev-$(date +%y.%m.%d-%H.%M.%S)"
34 fi
35
36 set -x
37
38 sed -e s,@version@,${version},g configure.ac.in > configure.ac
39
40 aclocal
41 libtoolize --force --copy
42 autoheader
43 automake --foreign --add-missing --copy
44 autoconf