52
52
AC_DEFINE(PEBI_PREFIX[RELEASE_VERSION], ["RELEASE_VERSION"], [$1 version number formatted for display])
53
53
AC_DEFINE(PEBI_PREFIX[RELEASE_COMMENT], ["RELEASE_COMMENT"], [Set to trunk if the branch is the main $1 branch])
54
54
AC_DEFINE(PEBI_PREFIX[RELEASE_ID], [RELEASE_ID], [$1 version number formatted for numerical comparison])
57
AC_DEFUN([_PANDORA_READ_FROM_FILE],[
58
$1=`grep $1 $2 | cut -f2 -d=`
61
AC_DEFUN([PANDORA_VC_VERSION],[
62
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)
75
_PANDORA_READ_FROM_FILE([PANDORA_VC_BRANCH],
76
${srcdir}/config/bzr_revinfo)
77
_PANDORA_READ_FROM_FILE([PANDORA_RELEASE_DATE],
78
${srcdir}/config/bzr_revinfo)
79
_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}
109
PANDORA_RELEASE_VERSION="${PANDORA_RELEASE_DATE}.${PANDORA_VC_REVNO}"
110
PANDORA_RELEASE_ID="${PANDORA_RELEASE_NODOTS_DATE}${PANDORA_VC_REVNO}"
112
VERSION="${PANDORA_RELEASE_VERSION}"
113
AC_DEFINE_UNQUOTED([PANDORA_RELEASE_VERSION],["${PANDORA_RELEASE_VERSION}"],
114
[The real version of the software])
115
AC_SUBST(PANDORA_VC_REVNO)
116
AC_SUBST(PANDORA_VC_REVID)
117
AC_SUBST(PANDORA_VC_BRANCH)
118
AC_SUBST(PANDORA_RELEASE_DATE)
119
AC_SUBST(PANDORA_RELEASE_NODOTS_DATE)
120
AC_SUBST(PANDORA_RELEASE_COMMENT)
121
AC_SUBST(PANDORA_RELEASE_VERSION)
122
AC_SUBST(PANDORA_RELEASE_ID)