~ubuntu-branches/debian/stretch/bbdb3/stretch

« back to all changes in this revision

Viewing changes to m4/package_date.m4

  • Committer: Package Import Robot
  • Author(s): Barak A. Pearlmutter
  • Date: 2014-03-12 11:09:33 UTC
  • Revision ID: package-import@ubuntu.com-20140312110933-bpex9g0phy8695kq
Tags: upstream-3.1.1
ImportĀ upstreamĀ versionĀ 3.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
### package_date.m4
 
2
 
 
3
## Copyright (C) 2013-2014 Roland Winkler <winkler@gnu.org>
 
4
##
 
5
## This file is part of the Insidious Big Brother Database (aka BBDB),
 
6
##
 
7
## BBDB is free software: you can redistribute it and/or modify
 
8
## it under the terms of the GNU General Public License as published by
 
9
## the Free Software Foundation, either version 3 of the License, or
 
10
## (at your option) any later version.
 
11
##
 
12
## BBDB is distributed in the hope that it will be useful,
 
13
## but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
## GNU General Public License for more details.
 
16
##
 
17
## You should have received a copy of the GNU General Public License
 
18
## along with BBDB.  If not, see <http://www.gnu.org/licenses/>.
 
19
 
 
20
# Figure out timestamp information, for substitution.
 
21
# If we are in a git repo, use the timestamp of the
 
22
# most recent commit.  Otherwise, use the current time.
 
23
AC_DEFUN([AC_PACKAGE_DATE],
 
24
[
 
25
if git log -1 > /dev/null 2>&1; then
 
26
    PACKAGE_DATE="$(git log -1 --format=format:'%ci')"
 
27
elif date --rfc-3339=seconds > /dev/null 2>&1; then
 
28
    PACKAGE_DATE="$(date --rfc-3339=seconds)"
 
29
elif date -u > /dev/null 2>&1; then
 
30
    PACKAGE_DATE="$(date -u)"
 
31
else
 
32
    PACKAGE_DATE="$(date)"
 
33
fi
 
34
AC_SUBST([PACKAGE_DATE])
 
35
])