File: gst-package-release-datetime.m4

package info (click to toggle)
gst-plugins-bad1.0 1.0.8-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 36,832 kB
  • sloc: ansic: 297,908; cpp: 22,677; sh: 13,303; xml: 6,362; makefile: 4,867; perl: 1,435; objc: 1,273; python: 362; sed: 16
file content (89 lines) | stat: -rw-r--r-- 3,802 bytes parent folder | download | duplicates (24)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
dnl macros to set GST_PACKAGE_RELEASE_DATETIME

dnl ===========================================================================
dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME
dnl
dnl Usage:
dnl
dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME()
dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no]...)
dnl sets the release datetime to the current date
dnl (no = this is not a release, but git or prerelease)
dnl
dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([YYYY-MM-DD])
dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [YYYY-MM-DD])
dnl sets the release datetime to the specified date (and time, if given)
dnl (yes = this is a release, not git or prerelease)
dnl
dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [DOAP-FILE], [RELEASE-VERSION])
dnl sets the release date to the release date associated with version
dnl RELEASE-VERSION in the .doap file DOAP-FILE
dnl (yes = this is a release, not git or prerelease)
dnl
dnl We need to treat pre-releases like git because there won't be an entry
dnl in the .doap file for pre-releases yet, and we don't want to use the
dnl date of the last release either.
dnl ===========================================================================
AC_DEFUN([AG_GST_SET_PACKAGE_RELEASE_DATETIME],
[
  dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME()
  dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes]...)
  if test "x$1" = "xno" -o "x$1" = "x"; then
    GST_PACKAGE_RELEASE_DATETIME=`date -u "+%Y-%m-%dT%H:%MZ"`
  elif test "x$1" = "xyes"; then
    dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no], ["YYYY-MM-DD"])
    dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no], [DOAP-FILE], [RELEASE-VERSION])
    if ( echo $1 | grep -e '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then
      GST_PACKAGE_RELEASE_DATETIME=$1
    else
      dnl we assume the .doap file contains the date as YYYY-MM-DD
      YYYY_MM_DD=`sh "${srcdir}/common/extract-release-date-from-doap-file" $3 $2`;
      if test "x$YYYY_MM_DD" != "x"; then
        GST_PACKAGE_RELEASE_DATETIME=$YYYY_MM_DD
      else
        AC_MSG_ERROR([SET_PACKAGE_RELEASE_DATETIME: could not extract
            release date for release version $3 from $2])
        GST_PACKAGE_RELEASE_DATETIME=""
      fi
    fi
  dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([YYYY-MM-DD])
  elif ( echo $1 | grep -e '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then
    GST_PACKAGE_RELEASE_DATETIME=$1
  else
    AC_MSG_WARN([SET_PACKAGE_RELEASE_DATETIME: invalid first argument])
    GST_PACKAGE_RELEASE_DATETIME=""
  fi

  if test "x$GST_PACKAGE_RELEASE_DATETIME" = "x"; then
    AC_MSG_WARN([Invalid package release date time: $GST_PACKAGE_RELEASE_DATETIME])
  else
    AC_MSG_NOTICE([Setting GST_PACKAGE_RELEASE_DATETIME to $GST_PACKAGE_RELEASE_DATETIME])

    AC_DEFINE_UNQUOTED([GST_PACKAGE_RELEASE_DATETIME],
        ["$GST_PACKAGE_RELEASE_DATETIME"],
        [GStreamer package release date/time for plugins as YYYY-MM-DD])
  fi
])

dnl ===========================================================================
dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO
dnl
dnl Usage:
dnl
dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([NANO-VERSION], [DOAP-FILE], [RELEASE-VERSION])
dnl if NANO-VERSION is 0, sets the release date to the release date associated
dnl with version RELEASE-VERSION in the .doap file DOAP-FILE, otherwise sets
dnl the release date and time to the current date/time.
dnl
dnl We need to treat pre-releases like git because there won't be an entry
dnl in the .doap file for pre-releases yet, and we don't want to use the
dnl date of the last release either.
dnl ===========================================================================
AC_DEFUN([AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO],
[
  if test "x$1" = "x0"; then
    AG_GST_SET_PACKAGE_RELEASE_DATETIME([yes], [ $2 ], [ $3 ])
  else
    AG_GST_SET_PACKAGE_RELEASE_DATETIME([no])
  fi
])