/[gentoo-alt]/trunk/aix-miscutils/bootstrap
Gentoo

Contents of /trunk/aix-miscutils/bootstrap

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1616 - (show annotations) (download)
Mon Apr 14 11:44:55 2008 UTC (6 years, 8 months ago) by haubi
File size: 2840 byte(s)
ohw, dropped duplicate /trunk/ subdir.

1 #! /bin/sh
2 # Copyright 2007 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # Author: Michael Haubenwallner <haubi@gentoo.org>
5
6 set -e
7
8 versioning_done=no
9
10 while [ "x$1" != x ]; do
11 arg=$1
12 shift
13 case "x${arg}" in
14 x--version=*)
15 echo "x${arg}" | sed -e 's,^x--version=,,' > version
16 versioning_done=yes
17 ;;
18 esac
19 done
20 svnurl='$HeadURL: svn+ssh://haubi@svn.gentoo.org/var/svnroot/gentoo-alt/trunk/aix-miscutils/bootstrap $'
21
22 mainversion=`grep 'AC_INIT(aix-miscutils,[0-9\.]*svnversion)' configure.ac | sed -e 's/.*([^,]*,\([^),]*\)\.svnversion\>.*)/\1/'`
23 if [ "x${mainversion}" != x ]; then
24 # configure.ac indicates to define the package-version automagically
25 if [ "x${versioning_done}" != xyes ] && [ -d .svn ] ; then
26 # we are in an svn sandbox:
27 # then we need to determine the version out of svn keyword 'HeadURL'.
28 case "${svnurl}" in
29 *'/trunk/'*)
30 # is snapshot from trunk:
31 # version is mainversion + '.' + [last-committed] svn revision
32 svn status -v | cut -c19-26 | sort -rn | { read v ; echo "${mainversion}.${v}" ;} > version
33 versioning_done=yes
34 ;;
35 *'/branches/'*)
36 # is snapshot from branch:
37 # version is branch-number + '.' + [last-committed] svn revision
38 ( echo -n "${svnurl}" \
39 | sed -e "s,-branch/bootstrap \\\$,,; s,.*/,," -e "s,^.*-,,"
40 svn status -v | cut -c19-26 | sort -rn | { read v ; echo ".${v}" ;}
41 ) > version
42 versioning_done=yes
43 ;;
44 esac
45 fi
46 if [ "x${versioning_done}" != xyes ]; then
47 case "${svnurl}" in
48 *'/tags/'*)
49 # is tag: version is tag number
50 ( echo "${svnurl}" \
51 | sed -e "s,/bootstrap \\\$,,; s,.*-,,"
52 ) > version
53 versioning_done=yes
54 ;;
55 *)
56 if [ -r version ]; then
57 # we reuse the 'version' determined during packaging from svn.
58 versioning_done=yes
59 fi
60 ;;
61 esac
62 fi
63 if [ "x${versioning_done}" != xyes ]; then
64 echo "error: no 'version' file and unknown svnurl '${svnurl}'" >&2
65 echo "error: cannot determine package version" >&2
66 exit 1
67 fi
68 else
69 # configure.ac defines the version, keep 'version' empty.
70 : > version
71 fi
72 set +x
73
74 echo "mkdir -p m4 build-aux"
75 mkdir -p m4 build-aux
76 #echo "aclocal -I m4 --install"
77 # aclocal -I m4 --install
78 echo "aclocal"
79 aclocal
80 #echo "autoheader"
81 # autoheader
82 echo "automake --add-missing --copy --foreign"
83 automake --add-missing --copy --foreign
84 echo "autoconf"
85 autoconf
86
87 if [ -s version ]; then
88 version=`cat version`
89 eval `grep '^PACKAGE_VERSION=' configure | head -n 1`
90 if [ "${version}" != "${PACKAGE_VERSION}" ]; then
91 (
92 echo '--- configure'
93 echo '+++ configure'
94 grep "\<${PACKAGE_VERSION}\>" configure \
95 | awk '{print "@@ -1,1 +1,1 @@"; print "-" $0; print "+" $0}' \
96 | sed -e "s|\(^+.*\)\<${PACKAGE_VERSION}\>|\1${version}|"
97 ) | patch --no-backup-if-mismatch configure -
98 fi
99 fi

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.20