On 02/26/2012 09:18 PM, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Hello, all. In GRUB2 we have following problem: If
>
>  program_transform_name=s,grub,grub2
>
> then
>   pkglibdir=$libdir/grub2
>
Hmm... no, this is not automake's doing (automake is in fact not
documented to do so, and I've just added a test verifying that it
indeed does not do so -- see attachment).

> but
>   pkgdatadir=$datadir/grub2
>
You mean "pkgdatadir=$datadir/grub" here?  Anyway, this would be correct;
it's the "pkglibdir=$libdir/grub2" above that looks fishy.

> Is it intended or is it a bug?
>
Any transformation of a $(pkg*dir) by $(program_transform_name) would be
a bug; if you encounter such an issue, I'd be grateful if you report it.

But I'm pretty sure the inconsistency you are seeing here is due to
another reasons (maybe some Makefile.am or configure.ac settings you're
missing?)

HTH,
  Stefano
>From 848256f2d7057836be33e3abf84d082122a44c74 Mon Sep 17 00:00:00 2001
Message-Id: <848256f2d7057836be33e3abf84d082122a44c74.1330331593.git.stefano.lattar...@gmail.com>
From: Stefano Lattarini <stefano.lattar...@gmail.com>
Date: Mon, 27 Feb 2012 09:28:47 +0100
Subject: [PATCH] coverage: --program-transform shouldn't transform too much
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Stemmed from a report by Vladimir 'φ-coder/phcoder' Serbinenko:
<http://lists.gnu.org/archive/html/automake/2012-02/msg00025.html>

* tests/transform3.test: New test, checking that --program-transform
does not transform too much stuff (in particular, pkglibexecdir,
pgklibdir and pkgdatadir).
* tests/list-of-tests.mk: Add it.
* THANKS: Update.
---
 THANKS                 |    1 +
 tests/list-of-tests.mk |    1 +
 tests/transform3.test  |   87 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 0 deletions(-)
 create mode 100755 tests/transform3.test

diff --git a/THANKS b/THANKS
index 7b7c9df..1bc3a80 100644
--- a/THANKS
+++ b/THANKS
@@ -370,6 +370,7 @@ Ulrich Eckhardt		eckha...@satorlaser.com
 Václav Haisman		v.hais...@sh.cvut.cz
 Vadim Zeitlin		vadim.zeit...@dptmaths.ens-cachan.fr
 Vincent Lefevre		vinc...@vinc17.org
+Vladimir Serbinenko	phco...@gmail.com
 Volker Boerchers	vboerch...@tecon.de
 Werner John		j...@oswf.de
 Werner Koch		w...@isil.d.shuttle.de
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index 89cff2f..0e5ee29 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -1144,6 +1144,7 @@ txinfo33.test \
 txinfo-unrecognized-extension.test \
 transform.test \
 transform2.test \
+transform3.test \
 uninstall-fail.test \
 uninstall-pr9578.test \
 unused.test \
diff --git a/tests/transform3.test b/tests/transform3.test
new file mode 100755
index 0000000..0fcf9bd
--- /dev/null
+++ b/tests/transform3.test
@@ -0,0 +1,87 @@
+#! /bin/sh
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure that --program-transform does not transform too much
+# stuff (in particular, pgklibdir, pkgdatadir and pkglibexecdir).
+
+required=cc
+. ./defs || Exit 1
+
+cat > configure.ac <<'END'
+AC_INIT([foo], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_PROG_CC
+AM_PROG_AR
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_SCRIPTS = foo
+pkgdata_DATA = bar.txt
+pkglib_LIBRARIES = libzap.a
+pkglibexec_SCRIPTS = mu
+END
+
+cat > libzap.c <<'END'
+int zap (void)
+{
+  return 0;
+}
+END
+
+echo 'To be or not to be ...' > bar.txt
+
+cat > foo <<'END'
+#!/bin/sh
+exit 0
+END
+cp foo mu
+chmod a+x foo mu
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure --program-prefix=gnu- --prefix "`pwd`/inst"
+
+$MAKE install
+find inst # For debugging.
+test -f inst/bin/gnu-foo
+test -x inst/bin/gnu-foo
+test -f inst/share/foo/bar.txt
+test ! -d inst/share/gnu-foo
+test -f inst/lib/foo/libzap.a
+test ! -d inst/lib/gnu-foo
+test -f inst/libexec/foo/gnu-mu
+test -x inst/libexec/foo/gnu-mu
+test ! -d inst/libexec/gnu-foo
+
+$MAKE uninstall
+test `find inst -type f -print | wc -l` = 0
+
+# Opportunistically test for installdirs.
+rm -rf inst
+$MAKE installdirs
+test -d inst/share/foo
+test ! -d inst/share/gnu-foo
+test -d inst/lib/foo
+test ! -d inst/lib/gnu-foo
+test -d inst/libexec/foo
+test ! -d inst/libexec/gnu-foo
+
+:
-- 
1.7.9

Reply via email to