From a suggestion by Eric Blake. See automake bug#11356.
This is a follow-up to previous patch 'v1.12-12-gb99b5be'.
* configure.ac (RELEASE_YEAR): New AC_SUBST'd variable, should hold
the value of the current year.
* Makefile.am (update-copyright): Be sure to also update the
definition of 'RELEASE_YEAR' in configure.ac.
* lib/Automake/Config.in ($RELEASE_YEAR): New exported variable,
initialized from the value substituted for '@RELEASE_YEAR@'.
(@EXPORT): Add it.
* automake.in, aclocal.in: Use '$RELEASE_YEAR' (which will be
substituted at make time) instead of hard-coding the release
year. This should ensure the copyright range in the version
message and in the generated files (Makefile.in and aclocal.m4)
are automatically kept up-to-date.
* bootstrap (dosubst): Update, also substitute '@RELEASE_YEAR@'.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
.PHONY: update-copyright
update-copyright:
- $(AM_V_GEN)excluded_re=`echo $(FETCHFILES) \
+ $(AM_V_GEN)set -e; \
+ current_year=`date +%Y` && test -n "$$current_year" \
+ || { echo "$@: cannot get current year" >&1; exit 1; }; \
+ sed -i "/^RELEASE_YEAR=/s/=.*$$/=$$current_year/" configure.ac; \
+ excluded_re=`echo $(FETCHFILES) \
| sed -e 's|^|lib/|' -e 's| | lib/|g' -e 's, ,|,g'`; \
$(GIT) ls-files \
| grep -Ev '^(lib/)?(COPYING|INSTALL)$$' \
# name in the header.
$output = "# generated automatically by aclocal $VERSION -*- Autoconf -*-
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-$RELEASE_YEAR Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
{
print <<EOF;
aclocal (GNU $PACKAGE) $VERSION
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) $RELEASE_YEAR Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
# Copyright on generated Makefile.ins.
my $gen_copyright = "\
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-$RELEASE_YEAR Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
{
print <<EOF;
automake (GNU $PACKAGE) $VERSION
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) $RELEASE_YEAR Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
{
rm -f $2
in=`echo $1 | sed 's,^.*/,,'`
+ current_year=`date +%Y` && test -n "$current_year" \
+ || { echo "$me: cannot get current year" >&2; exit 1; }
sed -e "s%@APIVERSION@%$APIVERSION%g" \
-e "s%@PACKAGE@%$PACKAGE%g" \
-e "s%@PERL@%$PERL%g" \
-e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
-e "s%@VERSION@%$VERSION%g" \
-e "s%@datadir@%$datadir%g" \
+ -e "s%@RELEASE_YEAR@%$current_year%g" \
-e "s%@configure_input@%Generated from $in; do not edit by hand.%g" \
$1 > $2
chmod a-w $2
AM_INIT_AUTOMAKE([dist-xz filename-length-max=99 color-tests
parallel-tests silent-rules no-define no-dependencies])
+## Keep this on a line of its own, since it must be found and processed
+## by the 'update-copyright' rule in out Makefile.
+RELEASE_YEAR=2012
+AC_SUBST([RELEASE_YEAR])
+
# The API version is the base version. We must guarantee
# compatibility for all releases with the same API version.
# Our current rule is that:
require Exporter;
our @ISA = qw (Exporter);
-our @EXPORT = qw ($APIVERSION $PACKAGE $PACKAGE_BUGREPORT $VERSION $libdir
- $perl_threads);
+our @EXPORT = qw ($APIVERSION $PACKAGE $PACKAGE_BUGREPORT $VERSION
+ $RELEASE_YEAR $libdir $perl_threads);
# Parameters set by configure. Not to be changed. NOTE: assign
# VERSION as string so that e.g. version 0.30 will print correctly.
our $PACKAGE = '@PACKAGE@';
our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@';
our $VERSION = '@VERSION@';
+our $RELEASE_YEAR = '@RELEASE_YEAR@';
our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
our $perl_threads = @PERL_THREADS@;