From c8d9ead677b1d3a56b16a6cb24a466f049f6b9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Sutre?= Date: Fri, 10 Feb 2012 18:16:27 +0100 Subject: [PATCH] Source grub-mkconfig_lib from the build directory at build time. --- ChangeLog | 17 +++++++++++++++++ gentpl.py | 2 +- util/grub-install.in | 5 ++++- util/grub-kbdcomp.in | 5 ++++- util/grub-mkconfig.in | 8 ++++---- util/grub-mknetdir.in | 5 ++++- util/grub-mkrescue.in | 5 ++++- util/grub-mkstandalone.in | 5 ++++- util/grub-reboot.in | 5 ++++- util/grub-set-default.in | 5 ++++- util/powerpc/ieee1275/grub-mkrescue.in | 5 ++++- 11 files changed, 54 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6eb0f0e5..ae99c94ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2012-02-10 Grégoire Sutre + + Source grub-mkconfig_lib from the build directory at build time. + Suggested by: Vladimir Serbinenko. + + * gentpl.py (manpage): Set pkgdatadir to $(builddir) on help2man call. + * util/grub-install.in: Define pkgdatadir if not already set, and source + grub-mkconfig_lib from there. + * util/grub-kbdcomp.in: Likewise. + * util/grub-mkconfig.in: Likewise. + * util/grub-mknetdir.in: Likewise. + * util/grub-mkrescue.in: Likewise. + * util/grub-mkstandalone.in: Likewise. + * util/grub-reboot.in: Likewise. + * util/grub-set-default.in: Likewise. + * util/powerpc/ieee1275/grub-mkrescue.in: Likewise. + 2012-02-10 Vladimir Serbinenko Increase warning level. diff --git a/gentpl.py b/gentpl.py index 3008b8018..9e0d25353 100644 --- a/gentpl.py +++ b/gentpl.py @@ -465,7 +465,7 @@ def manpage(): r += gvar_add("man_MANS", "[+ name +].[+ mansection +]\n") r += rule("[+ name +].[+ mansection +]", "[+ name +]", """ chmod a+x [+ name +] -PATH=$(builddir):$$PATH $(HELP2MAN) --section=[+ mansection +] -i $(top_srcdir)/docs/man/[+ name +].h2m -o $@ [+ name +] +PATH=$(builddir):$$PATH pkgdatadir=$(builddir) $(HELP2MAN) --section=[+ mansection +] -i $(top_srcdir)/docs/man/[+ name +].h2m -o $@ [+ name +] """) r += gvar_add("CLEANFILES", "[+ name +].[+ mansection +]") r += "endif\n" diff --git a/util/grub-install.in b/util/grub-install.in index 95c268c88..747ef1729 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -34,6 +34,9 @@ platform=@platform@ host_os=@host_os@ pkglibdir="${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`" datadir="@datadir@" +if [ "x$pkgdatadir" = x ]; then + pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`" +fi localedir="@datadir@/locale" self="`basename $0`" @@ -77,7 +80,7 @@ else disk_module=native fi -. "${datadir}/@PACKAGE@/grub-mkconfig_lib" +. "${pkgdatadir}/grub-mkconfig_lib" # Usage: usage # Print the usage. diff --git a/util/grub-kbdcomp.in b/util/grub-kbdcomp.in index 8854c880b..393873443 100644 --- a/util/grub-kbdcomp.in +++ b/util/grub-kbdcomp.in @@ -7,12 +7,15 @@ exec_prefix="@exec_prefix@" bindir="@bindir@" datarootdir="@datarootdir@" datadir="@datadir@" +if [ "x$pkgdatadir" = x ]; then + pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`" +fi grub_mklayout="${bindir}/`echo grub-mklayout | sed ${transform}`" ckbcomp_options="" -. "${datadir}/@PACKAGE@/grub-mkconfig_lib" +. "${pkgdatadir}/grub-mkconfig_lib" self=`basename $0` diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 289763abb..b5144e3a4 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -31,7 +31,9 @@ PACKAGE_NAME=@PACKAGE_NAME@ PACKAGE_VERSION=@PACKAGE_VERSION@ host_os=@host_os@ datadir="@datadir@" -pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`" +if [ "x$pkgdatadir" = x ]; then + pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`" +fi grub_cfg="" grub_mkconfig_dir="${sysconfdir}"/grub.d @@ -42,7 +44,7 @@ grub_script_check="${bindir}/`echo grub-script-check | sed "${transform}"`" GRUB_PREFIX=`echo '/@bootdirname@/@grubdirname@' | sed "s,//*,/,g"` -. "${datadir}/@PACKAGE@/grub-mkconfig_lib" +. "${pkgdatadir}/grub-mkconfig_lib" # Usage: usage # Print the usage. @@ -95,8 +97,6 @@ do esac done -. "${datadir}/@PACKAGE@/grub-mkconfig_lib" - if [ "x$EUID" = "x" ] ; then EUID=`id -u` fi diff --git a/util/grub-mknetdir.in b/util/grub-mknetdir.in index 92879a5a6..eec170a74 100644 --- a/util/grub-mknetdir.in +++ b/util/grub-mknetdir.in @@ -30,6 +30,9 @@ PACKAGE_VERSION=@PACKAGE_VERSION@ host_os=@host_os@ pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst" datadir="@datadir@" +if [ "x$pkgdatadir" = x ]; then + pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`" +fi self=`basename $0` @@ -52,7 +55,7 @@ efi32_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-efi" efi64_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi" itanium_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/ia64-efi" -. "${datadir}/@PACKAGE@/grub-mkconfig_lib" +. "${pkgdatadir}/grub-mkconfig_lib" # Usage: usage # Print the usage. diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in index 7bd09d608..cd57d41a0 100644 --- a/util/grub-mkrescue.in +++ b/util/grub-mkrescue.in @@ -30,6 +30,9 @@ PACKAGE_NAME=@PACKAGE_NAME@ PACKAGE_TARNAME=@PACKAGE_TARNAME@ PACKAGE_VERSION=@PACKAGE_VERSION@ datadir="@datadir@" +if [ "x$pkgdatadir" = x ]; then + pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`" +fi pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst" self=`basename $0` @@ -46,7 +49,7 @@ grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`" xorriso=xorriso -. "${datadir}/@PACKAGE@/grub-mkconfig_lib" +. "${pkgdatadir}/grub-mkconfig_lib" # Usage: usage # Print the usage. diff --git a/util/grub-mkstandalone.in b/util/grub-mkstandalone.in index 60c0fe06a..235147797 100644 --- a/util/grub-mkstandalone.in +++ b/util/grub-mkstandalone.in @@ -31,6 +31,9 @@ PACKAGE_TARNAME=@PACKAGE_TARNAME@ PACKAGE_VERSION=@PACKAGE_VERSION@ pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst" datadir="@datadir@" +if [ "x$pkgdatadir" = x ]; then + pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`" +fi self=`basename $0` @@ -40,7 +43,7 @@ format= grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`" source= -. "${datadir}/@PACKAGE@/grub-mkconfig_lib" +. "${pkgdatadir}/grub-mkconfig_lib" # Usage: usage # Print the usage. diff --git a/util/grub-reboot.in b/util/grub-reboot.in index 400f497a1..1dfa382b8 100644 --- a/util/grub-reboot.in +++ b/util/grub-reboot.in @@ -26,6 +26,9 @@ PACKAGE_NAME=@PACKAGE_NAME@ PACKAGE_VERSION=@PACKAGE_VERSION@ datarootdir="@datarootdir@" datadir="@datadir@" +if [ "x$pkgdatadir" = x ]; then + pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`" +fi self=`basename $0` @@ -34,7 +37,7 @@ rootdir= bootdir= grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'` -. "${datadir}/@PACKAGE@/grub-mkconfig_lib" +. "${pkgdatadir}/grub-mkconfig_lib" # Usage: usage # Print the usage. diff --git a/util/grub-set-default.in b/util/grub-set-default.in index 001002773..49e7a4d1e 100644 --- a/util/grub-set-default.in +++ b/util/grub-set-default.in @@ -26,6 +26,9 @@ PACKAGE_NAME=@PACKAGE_NAME@ PACKAGE_VERSION=@PACKAGE_VERSION@ datarootdir="@datarootdir@" datadir="@datadir@" +if [ "x$pkgdatadir" = x ]; then + pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`" +fi self=`basename $0` @@ -34,7 +37,7 @@ rootdir= bootdir= grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'` -. "${datadir}/@PACKAGE@/grub-mkconfig_lib" +. "${pkgdatadir}/grub-mkconfig_lib" # Usage: usage # Print the usage. diff --git a/util/powerpc/ieee1275/grub-mkrescue.in b/util/powerpc/ieee1275/grub-mkrescue.in index 8632149b8..7742906b3 100644 --- a/util/powerpc/ieee1275/grub-mkrescue.in +++ b/util/powerpc/ieee1275/grub-mkrescue.in @@ -32,12 +32,15 @@ platform=@platform@ pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` datarootdir="@datarootdir@" datadir="@datadir@" +if [ "x$pkgdatadir" = x ]; then + pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`" +fi self=`basename $0` grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`" -. "${datadir}/@PACKAGE@/grub-mkconfig_lib" +. "${pkgdatadir}/grub-mkconfig_lib" # Usage: usage # Print the usage.