Debian Codegraph @

m4/package_date.m4

raw
1 ### package_date.m4
2
3 ## Copyright (C) 2013-2017 Roland Winkler <[email protected]>
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 ])