2 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Check that vers*.texi files are automatically created and distributed
18 # if @included into a texi source. Also check that they correctly contain
19 # the @values definitions they are advertised to.
20 # See also the related test 'vtexi4.sh', which does similar checks, but
21 # for version.texi only, and requires makeinfo, tex and texi2dvi.
25 # We are going to override package version in AC_INIT, so we need
26 # to redefine the name of the distdir as well.
29 # This should work without tex, texinfo or makeinfo.
30 TEX
=false TEXI2DVI
=false MAKEINFO
=false
31 export TEX TEXI2DVI MAKEINFO
33 cat > configure.ac
<< END
34 AC_INIT([$me], [7.45.3a])
36 AC_CONFIG_FILES([Makefile])
40 cat > Makefile.am
<< 'END'
41 info_TEXINFOS
= foobar.texi quux.texi zardoz.texi
42 .PHONY
: echo-distfiles
44 @
echo ' ' $
(DISTFILES
) ' '
47 cat > foobar.texi
<< 'END'
48 @setfilename foobar.info
53 cat > quux.texi
<< 'END'
54 @setfilename quux.info
55 @include version-quux.texi
59 cat > zardoz.texi
<< 'END'
60 @setfilename zardoz.info
62 @include vers1a_2b.texi
66 # Required when using Texinfo.
68 cp "$am_scriptdir"/mdate-sh .
74 day
='([1-9]|1[0-9]|2[0-9]|3[01])'
75 month
='(January|February|March|April|May|June|July|August|September|October|November|December)'
76 year
='20[0-9][0-9]' # Hopefully automake will be obsolete in 80 years ;-)
77 date="$day $month $year"
81 # Basename of the vers*.texi file.
83 # The $(srcdir) of the current build.
85 # The vers*.texi file must be created in $(srcdir).
86 $MAKE $srcdir/$vfile.texi
87 cat $srcdir/$vfile.texi
88 # EDITION and VERSION are synonyms, as per documentation.
89 grep "^@set EDITION 7\\.45\\.3a$" $srcdir/$vfile.texi
90 grep "^@set VERSION 7\\.45\\.3a$" $srcdir/$vfile.texi
91 # Check that UPDATED seems right, and that UPDATED and UPDATED-MONTH
93 $EGREP "^@set UPDATED $date$" $srcdir/$vfile.texi
94 vmonth
=$
(grep '^@set UPDATED ' $srcdir/$vfile.texi |
awk '{print $4, $5}')
95 grep "^@set UPDATED-MONTH $vmonth$" $srcdir/$vfile.texi
96 # Check that the vers*.texi file is distributed according
98 $MAKE echo-distfiles
# For debugging.
99 $MAKE -s echo-distfiles |
grep "[ /]$vfile\\.texi"
107 do_check version-quux ..
108 do_check vers1a_2b ..
110 # The various $(srcdir)/*.info are required for the distribution
111 # and they must be newer than version.texi, so that make won't try
117 # Check that the vers*.texi files are really distributed.
120 diff ..
/version.texi
$distdir/version.texi
121 diff ..
/version-quux.texi
$distdir/version-quux.texi
122 diff ..
/version.texi
$distdir/vers1a_2b.texi