[PATCH] INSTALL doesn't belong in docdir, use pkgdatadir instead
Gaetan Nadon
gaetan.nadon at videotron.ca
Mon Jan 4 05:57:01 PST 2010
On Sat, 2010-01-02 at 20:44 +0000, Julien Cristau wrote:
> docdir stays in xorg-macros.pc so we don't break the existing
> $(INSTALL_CMD).
>
> Signed-off-by: Julien Cristau <jcristau at debian.org>
> ---
> Untested, but with fixed typo, added comment in xorg-macros.pc.in and
> no bumped version (the bump was actually unnecessary, this should work
> fine with the current version).
>
> Makefile.am | 2 +-
> xorg-macros.m4.in | 8 ++++----
> xorg-macros.pc.in | 7 +++++--
> 3 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index 1e07014..7340beb 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -21,7 +21,7 @@
>
> aclocaldir = $(datadir)/aclocal
> aclocal_DATA = xorg-macros.m4
> -dist_doc_DATA = INSTALL
> +dist_pkgdata_DATA = INSTALL
>
> # Previous versions used to install xorgversion.m4, now integrated
> # into xorg-macros.m4. Explicitly remove that old file in order not
> diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
> index 20d0c70..db2a62d 100644
> --- a/xorg-macros.m4.in
> +++ b/xorg-macros.m4.in
> @@ -507,14 +507,14 @@ XORG_MANPAGE_SECTIONS
> # Minimum version: 1.4.0
> #
> # Defines the variable INSTALL_CMD as the command to copy
> -# INSTALL from $prefix/share/doc/util-macros.
> +# INSTALL from $prefix/share/util-macros.
> #
> AC_DEFUN([XORG_INSTALL], [
> AC_REQUIRE([PKG_PROG_PKG_CONFIG])
> -macros_docdir=`$PKG_CONFIG --print-errors --variable=docdir xorg-macros`
> -INSTALL_CMD="(cp -f "$macros_docdir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
> +macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
> +INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
> mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
> || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
> -echo 'util-macros \"docdir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
> +echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
> AC_SUBST([INSTALL_CMD])
> ]) # XORG_INSTALL
> diff --git a/xorg-macros.pc.in b/xorg-macros.pc.in
> index 15a1154..dcc1e4b 100644
> --- a/xorg-macros.pc.in
> +++ b/xorg-macros.pc.in
> @@ -3,9 +3,12 @@ exec_prefix=@exec_prefix@
> includedir=@includedir@
> datarootdir=@datarootdir@
> datadir=@datadir@
> -PACKAGE_TARNAME=@PACKAGE_TARNAME@
> +PACKAGE=@PACKAGE@
> # Used by XORG_INSTALL
> -docdir=@docdir@
> +pkgdatadir=${datadir}/${PACKAGE}
> +# docdir is kept for backwards compatibility with XORG_INSTALL from
> +# util-macros 1.4
> +docdir=${pkgdatadir}
>
> Name: X.Org Macros
> Description: A set of autoconf project macros for X.Org modules
Tested-by: Gaetan Nadon <memsize at videotron.ca>
To be on the safe side, let's wait a week and if al goes well, I can
push this patch.
Test Results for reference
=================
The tests consist in creating a tarball from a module that was created
with a version 1.5 and 1.4 of INSTALL_CMD (with and without the patch to
be tested). That creates 2 tarballs which are then configured against
xorg-macros at version 1.4 and 1.5. That produces 4 test cases in which
the distcheck target is run. The INSTALL file must be manually deleted
before running distcheck.
Tarball created from a module containing a version 1.4 INSTALL_CMD
macro.
- tarball configured against an installed 1.4 xorg-macros.pc file:
macros_docdir=`$PKG_CONFIG --print-errors --variable=docdir
xorg-macros`
INSTALL_CMD = (cp
-f /home/nadon/xorg/prefix14/share/doc/util-macros/INSTALL
- tarball configured against an installed 1.5 xorg-macros.pc file:
macros_docdir=`$PKG_CONFIG --print-errors --variable=docdir
xorg-macros`
INSTALL_CMD = (cp
-f /home/nadon/xorg/prefix15/share/util-macros/INSTALL
Tarball created from a module containing a version 1.5 INSTALL_CMD
macro.
- tarball configured against an installed 1.4 xorg-macros.pc file:
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir
xorg-macros`
INSTALL_CMD = (cp -f /INSTALL
- tarball configured against an installed 1.5 xorg-macros.pc file:
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir
xorg-macros`
INSTALL_CMD = (cp
-f /home/nadon/xorg/prefix15/share/util-macros/INSTALL
The first test case (1.4 INSTALL_CMD with 1.4 xorg-macros.pc file) is
the current situation without any patch.
The second test case (1.4 INSTALL_CMD with 1.5 xorg-macros.pc file) is
successful because of the docdir "workaround" which supplies the new
value to the old variable.
The third test case (1.5 INSTALL_CMD with 1.4 xorg-macros.pc file)
creates a zero-byte INSTALL file. This is the expected behavior. However
it is important not to abort the makefile. The INSTALL_CMD executes in
the following way:
nadon at ubuntu:~/xorg/prefix15/fixesproto-15-14$ make INSTALL
(cp -f /INSTALL ./.INSTALL.tmp && mv ./.INSTALL.tmp ./INSTALL) || (rm
-f ./.INSTALL.tmp; touch ./INSTALL; echo 'util-macros "pkgdatadir" from
xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)
cp: cannot stat `/INSTALL': No such file or directory
util-macros "pkgdatadir" from xorg-macros.pc not found: installing
possibly empty INSTALL.
The copy command fails but the makefile completes successful. This is
the expected behavior modeled after the changelog cmd.
This scenario is unlikely to happen, anyway, because the tarball already
contains an INSTALL file. In that case, the INSTALL_CMD simply "touches"
the INSTALL file. Unless you delete the INSTALL file, the distcheck
target creates an INSTALL file.
The fourth test case (1.5 INSTALL_CMD with 1.5 xorg-macros.pc file) is
sucessful.
All four test cases exhibit a successful distcheck target.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.x.org/archives/xorg-devel/attachments/20100104/a04e4ede/attachment.html
More information about the xorg-devel
mailing list