Subject: pkg/17175: gtexinfo +CONTENTS contains fixed path in @exec in binary package
To: None <>
From: None <>
List: netbsd-bugs
Date: 06/05/2002 12:03:45
>Number:         17175
>Category:       pkg
>Synopsis:       gtexinfo +CONTENTS contains fixed path in @exec
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 05 03:05:00 PDT 2002
>Originator:     Joachim Koenig-Baltes
>Release:        NetBSD 1.5ZC
System: NetBSD compaq 1.5ZC NetBSD 1.5ZC (JOACHIM_ISDN) #0: Mon May 20 19:00:09 MEST 2002 joachim@duron:/user/unix/work/NetBSD-current/src/sys/arch/i386/compile/JOACHIM_ISDN i386
Architecture: i386
Machine: i386
The gtexinfo PLIST file contains ${INSTALL_INFO} in its @exec and @unexec
lines. INSTALL_INFO ist set to ${PREFIX}/bin/install-info and as such evaluated
when the +CONTENTS file is generated, so it ends up with fixed paths.

When generating a package for gtexinfo, the path where the package got
installed at package create time is thus hardcoded into the +CONTENTS file.

At package installation time, the destination "${PREFIX}" may differ (as in my
case) leading to errors due to failed @exec/@unexec lines in +CONTENTS.

In short: the package is not relocatable.

(I use the NetBSD package system for building a self contained software tree
which a customer can install into a destination directory I do not know in
advance. Setting PKG_DBDIR and using the -p option to pkg_add allows for that)

cd /usr/pkgsrc/devel/gtexinfo; make package
mkdir -p /tmp/pkg/var/db/pkg
PKG_DBDIR=/tmp/pkg/var/db/pkg pkg_add -p /tmp/pkg \

Note: the fix below has the same properties as described in the cvs log for
  define INSTALL_INFO to the very install-info command this package provides
  and use it in post-install *and* PLIST.

apply the following patch to PLIST:

--- PLIST.orig  Wed Jun  5 11:56:05 2002
+++ PLIST       Wed Jun  5 10:49:25 2002
@@ -1,7 +1,7 @@
 @comment $NetBSD: PLIST,v 1.2 2002/04/04 11:10:22 seb Exp $
-@unexec ${INSTALL_INFO} --delete --info-dir=%D/info %D/info/
-@unexec ${INSTALL_INFO} --delete --info-dir=%D/info %D/info/
-@unexec ${INSTALL_INFO} --delete --info-dir=%D/info %D/info/texinfo
+@unexec %D/bin/install-info --delete --info-dir=%D/info %D/info/
+@unexec %D/bin/install-info --delete --info-dir=%D/info %D/info/
+@unexec %D/bin/install-info --delete --info-dir=%D/info %D/info/texinfo
@@ -25,9 +25,9 @@
-@exec ${INSTALL_INFO} --info-dir=%D/info %D/info/
-@exec ${INSTALL_INFO} --info-dir=%D/info %D/info/
-@exec ${INSTALL_INFO} --info-dir=%D/info %D/info/texinfo
+@exec %D/bin/install-info --info-dir=%D/info %D/info/
+@exec %D/bin/install-info --info-dir=%D/info %D/info/
+@exec %D/bin/install-info --info-dir=%D/info %D/info/texinfo