<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.26.0">
</HEAD>
<BODY>
On Sat, 2010-01-02 at 20:44 +0000, Julien Cristau wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
docdir stays in xorg-macros.pc so we don't break the existing
$(INSTALL_CMD).
Signed-off-by: Julien Cristau <<A HREF="mailto:jcristau@debian.org">jcristau@debian.org</A>>
---
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
</PRE>
</BLOCKQUOTE>
<BR>
<BR>
Tested-by: Gaetan Nadon <<A HREF="mailto:memsize@videotron.ca">memsize@videotron.ca</A>><BR>
<BR>
To be on the safe side, let's wait a week and if al goes well, I can push this patch.<BR>
<BR>
Test Results for reference<BR>
=================<BR>
<BR>
<BR>
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.<BR>
<BR>
Tarball created from a module containing a version 1.4 INSTALL_CMD macro.<BR>
- tarball configured against an installed 1.4 xorg-macros.pc file:<BR>
<BR>
macros_docdir=`$PKG_CONFIG --print-errors --variable=docdir xorg-macros`<BR>
INSTALL_CMD = (cp -f /home/nadon/xorg/prefix14/share/doc/util-macros/INSTALL<BR>
<BR>
- tarball configured against an installed 1.5 xorg-macros.pc file:<BR>
macros_docdir=`$PKG_CONFIG --print-errors --variable=docdir xorg-macros`<BR>
INSTALL_CMD = (cp -f /home/nadon/xorg/prefix15/share/util-macros/INSTALL<BR>
<BR>
<BR>
Tarball created from a module containing a version 1.5 INSTALL_CMD macro.<BR>
- tarball configured against an installed 1.4 xorg-macros.pc file:<BR>
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`<BR>
INSTALL_CMD = (cp -f /INSTALL <BR>
<BR>
- tarball configured against an installed 1.5 xorg-macros.pc file:<BR>
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`<BR>
INSTALL_CMD = (cp -f /home/nadon/xorg/prefix15/share/util-macros/INSTALL<BR>
<BR>
The first test case (1.4 INSTALL_CMD with 1.4 xorg-macros.pc file) is the current situation without any patch.<BR>
<BR>
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.<BR>
<BR>
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:<BR>
<BR>
nadon@ubuntu:~/xorg/prefix15/fixesproto-15-14$ make INSTALL<BR>
(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)<BR>
cp: cannot stat `/INSTALL': No such file or directory<BR>
util-macros "pkgdatadir" from xorg-macros.pc not found: installing possibly empty INSTALL.<BR>
<BR>
The copy command fails but the makefile completes successful. This is the expected behavior modeled after the changelog cmd.<BR>
<BR>
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.<BR>
<BR>
The fourth test case (1.5 INSTALL_CMD with 1.5 xorg-macros.pc file) is sucessful.<BR>
<BR>
All four test cases exhibit a successful distcheck target.<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</BODY>
</HTML>