]> git.ozlabs.org Git - petitboot/blob - bootstrap
Cleanup man pages
[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
21         version=$(printf '%s-%s%s' ${date} g ${head})
22
23         # Add a '-dirty' postfix for uncommitted changes.
24
25         if git diff-index HEAD | read dummy; then
26                 version=`printf '%s%s' ${version} -dirty`
27         fi
28 else
29         # Default to current date and time.
30
31         version="dev-$(date +%y.%m.%d-%H.%M.%S)"
32 fi
33
34 set -x
35
36 sed -e s,@version@,${version},g configure.ac.in > configure.ac
37
38 aclocal
39 libtoolize --force --copy
40 autoheader
41 automake --foreign --add-missing --copy
42 autoconf