3
3
dnl gives unlimited permission to copy and/or distribute it,
4
4
dnl with or without modifications, as long as this notice is preserved.
6
AC_DEFUN([_PANDORA_BUILDING_FROM_VC],[
7
pandora_building_from_vc=no
9
if test -d ".bzr" ; then
10
pandora_building_from_bzr=yes
11
pandora_building_from_vc=yes
13
pandora_building_from_bzr=no
16
if test -d ".svn" ; then
17
pandora_building_from_svn=yes
18
pandora_building_from_vc=yes
20
pandora_building_from_svn=no
23
if test -d ".hg" ; then
24
pandora_building_from_hg=yes
25
pandora_building_from_vc=yes
27
pandora_building_from_hg=no
30
if test -d ".git" ; then
31
pandora_building_from_git=yes
32
pandora_building_from_vc=yes
34
pandora_building_from_git=no
6
38
AC_DEFUN([PANDORA_BUILDING_FROM_VC],[
8
ac_cv_building_from_vc=no
10
AS_IF([test -d "${srcdir}/.bzr"],[
11
ac_cv_building_from_bzr=yes
12
ac_cv_building_from_vc=yes
14
ac_cv_building_from_bzr=no
17
AS_IF([test -d "${srcdir}/.svn"],[
18
ac_cv_building_from_svn=yes
19
ac_cv_building_from_vc=yes
21
ac_cv_building_from_svn=no
24
AS_IF([test -d "${srcdir}/.hg"],[
25
ac_cv_building_from_hg=yes
26
ac_cv_building_from_vc=yes
28
ac_cv_building_from_hg=no
31
AS_IF([test -d "${srcdir}/.git"],[
32
ac_cv_building_from_git=yes
33
ac_cv_building_from_vc=yes
35
ac_cv_building_from_git=no
39
m4_syscmd(_PANDORA_BUILDING_FROM_VC [
41
PANDORA_RELEASE_DATE=`date +%Y.%m`
42
PANDORA_RELEASE_NODOTS_DATE=`date +%Y%m`
46
PANDORA_VC_REVID="unknown"
47
PANDORA_VC_BRANCH="bzr-export"
49
if test "${pandora_building_from_bzr}" = "yes"; then
50
echo "# Grabbing changelog and version information from bzr"
51
PANDORA_BZR_REVNO=`bzr revno`
52
if test "x$PANDORA_BZR_REVNO" != "x${PANDORA_VC_REVNO}" ; then
53
PANDORA_VC_REVNO="${PANDORA_BZR_REVNO}"
54
PANDORA_VC_REVID=`bzr log -r-1 --show-ids | grep revision-id | cut -f2 -d' ' | head -1`
55
PANDORA_VC_BRANCH=`bzr nick`
59
if ! test -d config ; then
63
cat > config/pandora_vc_revinfo.tmp <<EOF
64
PANDORA_VC_REVNO=${PANDORA_VC_REVNO}
65
PANDORA_VC_REVID=${PANDORA_VC_REVID}
66
PANDORA_VC_BRANCH=${PANDORA_VC_BRANCH}
67
PANDORA_RELEASE_DATE=${PANDORA_RELEASE_DATE}
68
PANDORA_RELEASE_NODOTS_DATE=${PANDORA_RELEASE_NODOTS_DATE}
70
if ! diff config/pandora_vc_revinfo.tmp config/pandora_vc_revinfo >/dev/null 2>&1 ; then
71
mv config/pandora_vc_revinfo.tmp config/pandora_vc_revinfo
73
rm -f config/pandora_vc_revinfo.tmp
41
dnl Takes one argument which is the prefix to append
42
AC_DEFUN([PANDORA_EXPORT_BZR_INFO],[
43
m4_ifval(m4_normalize([$1]),[
44
m4_define([PEBI_PREFIX],[])
46
m4_define([PEBI_PREFIX],m4_toupper(m4_normalize($1))[_])
49
AC_DEFINE(PEBI_PREFIX[BZR_REVID], ["BZR_REVID"], [bzr revision ID])
50
AC_DEFINE(PEBI_PREFIX[BZR_BRANCH], ["BZR_BRANCH"], [bzr branch name])
51
AC_DEFINE(PEBI_PREFIX[RELEASE_DATE], ["RELEASE_DATE"], [Release date based on the date of the repo checkout])
52
AC_DEFINE(PEBI_PREFIX[RELEASE_VERSION], ["RELEASE_VERSION"], [$1 version number formatted for display])
53
AC_DEFINE(PEBI_PREFIX[RELEASE_COMMENT], ["RELEASE_COMMENT"], [Set to trunk if the branch is the main $1 branch])
54
AC_DEFINE(PEBI_PREFIX[RELEASE_ID], [RELEASE_ID], [$1 version number formatted for numerical comparison])
57
77
AC_DEFUN([_PANDORA_READ_FROM_FILE],[
58
78
$1=`grep $1 $2 | cut -f2 -d=`
61
81
AC_DEFUN([PANDORA_VC_VERSION],[
62
82
AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
64
PANDORA_RELEASE_DATE=`date +%Y.%m`
65
PANDORA_RELEASE_NODOTS_DATE=`date +%Y%m`
69
PANDORA_VC_REVID="unknown"
70
PANDORA_VC_BRANCH="bzr-export"
72
AS_IF([test -f ${srcdir}/config/bzr_revinfo],[
73
_PANDORA_READ_FROM_FILE([PANDORA_VC_REVNO],${srcdir}/config/bzr_revinfo)
74
_PANDORA_READ_FROM_FILE([PANDORA_VC_REVID],${srcdir}/config/bzr_revinfo)
84
_PANDORA_BUILDING_FROM_VC
86
AS_IF([test -f ${srcdir}/config/pandora_vc_revinfo],[
87
_PANDORA_READ_FROM_FILE([PANDORA_VC_REVNO],${srcdir}/config/pandora_vc_revinfo)
88
_PANDORA_READ_FROM_FILE([PANDORA_VC_REVID],${srcdir}/config/pandora_vc_revinfo)
75
89
_PANDORA_READ_FROM_FILE([PANDORA_VC_BRANCH],
76
${srcdir}/config/bzr_revinfo)
90
${srcdir}/config/pandora_vc_revinfo)
77
91
_PANDORA_READ_FROM_FILE([PANDORA_RELEASE_DATE],
78
${srcdir}/config/bzr_revinfo)
92
${srcdir}/config/pandora_vc_revinfo)
79
93
_PANDORA_READ_FROM_FILE([PANDORA_RELEASE_NODOTS_DATE],
80
${srcdir}/config/bzr_revinfo)
81
_PANDORA_READ_FROM_FILE([PANDORA_RELEASE_COMMENT],
82
${srcdir}/config/bzr_revinfo)
84
AS_IF([test "${ac_cv_building_from_bzr}" = "yes"],[
85
dnl echo "Grabbing changelog and version information from bzr"
86
dnl bzr log --short > ChangeLog || touch ChangeLog
87
PANDORA_BZR_REVNO=`bzr revno`
88
AS_IF([test "x$PANDORA_BZR_REVNO" != "${PANDORA_VC_REVNO}"],[
89
PANDORA_VC_REVNO="${PANDORA_BZR_REVNO}"
90
PANDORA_VC_REVID=`bzr log -r-1 --show-ids | grep revision-id | awk '{print $[]2}' | head -1`
91
PANDORA_VC_BRANCH=`bzr nick`
92
AS_IF([test "x${PANDORA_VC_BRANCH}" != "${PACKAGE}"],[
93
PANDORA_RELEASE_COMMENT="${PANDORA_VC_BRANCH}"
95
PANDORA_RELEASE_COMMENT="trunk"
99
AS_IF([! test -d config],[mkdir -p config])
100
cat > "config/bzr_revinfo" <<EOF
101
PANDORA_VC_REVNO=${PANDORA_VC_REVNO}
102
PANDORA_VC_REVID=${PANDORA_VC_REVID}
103
PANDORA_VC_BRANCH=${PANDORA_VC_BRANCH}
104
PANDORA_RELEASE_DATE=${PANDORA_RELEASE_DATE}
105
PANDORA_RELEASE_NODOTS_DATE=${PANDORA_RELEASE_NODOTS_DATE}
106
PANDORA_RELEASE_COMMENT=${PANDORA_RELEASE_COMMENT}
94
${srcdir}/config/pandora_vc_revinfo)
96
AS_IF([test "x${PANDORA_VC_BRANCH}" != x"${PACKAGE}"],[
97
PANDORA_RELEASE_COMMENT="${PANDORA_VC_BRANCH}"
99
PANDORA_RELEASE_COMMENT="trunk"
109
102
PANDORA_RELEASE_VERSION="${PANDORA_RELEASE_DATE}.${PANDORA_VC_REVNO}"
110
103
PANDORA_RELEASE_ID="${PANDORA_RELEASE_NODOTS_DATE}${PANDORA_VC_REVNO}"
121
114
AC_SUBST(PANDORA_RELEASE_VERSION)
122
115
AC_SUBST(PANDORA_RELEASE_ID)
118
AC_DEFUN([PANDORA_VC_INFO_HEADER],[
119
AC_REQUIRE([PANDORA_VC_VERSION])
120
m4_define([PANDORA_VC_PREFIX],m4_toupper(m4_normalize(AC_PACKAGE_NAME))[_])
122
AC_DEFINE_UNQUOTED(PANDORA_VC_PREFIX[VC_REVNO], [$PANDORA_VC_REVNO], [Version control revision number])
123
AC_DEFINE_UNQUOTED(PANDORA_VC_PREFIX[VC_REVID], ["$PANDORA_VC_REVID"], [Version control revision ID])
124
AC_DEFINE_UNQUOTED(PANDORA_VC_PREFIX[VC_BRANCH], ["$PANDORA_VC_BRANCH"], [Version control branch name])
125
AC_DEFINE_UNQUOTED(PANDORA_VC_PREFIX[RELEASE_DATE], ["$PANDORA_RELEASE_DATE"], [Release date of version control checkout])
126
AC_DEFINE_UNQUOTED(PANDORA_VC_PREFIX[RELEASE_NODOTS_DATE], [$PANDORA_RELEASE_NODOTS_DATE], [Numeric formatted release date of checkout])
127
AC_DEFINE_UNQUOTED(PANDORA_VC_PREFIX[RELEASE_COMMENT], ["$PANDORA_RELEASE_COMMENT"], [Set to trunk if the branch is the main $PACKAGE branch])
128
AC_DEFINE_UNQUOTED(PANDORA_VC_PREFIX[RELEASE_VERSION], ["$PANDORA_RELEASE_VERSION"], [Release date and revision number of checkout])
129
AC_DEFINE_UNQUOTED(PANDORA_VC_PREFIX[RELEASE_ID], [$PANDORA_RELEASE_ID], [Numeric formatted release date and revision number of checkout])