Subject: pkg/17175: gtexinfo +CONTENTS contains fixed path in @exec in binary package
To: None <gnats-bugs@gnats.netbsd.org>
From: None <joachim@handshake.de>
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
>Closed-Date:
>Last-Modified:
>Originator:     Joachim Koenig-Baltes
>Release:        NetBSD 1.5ZC
>Organization:
	
>Environment:
	
	
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
>Description:
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)

>How-To-Repeat:
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 \
  /usr/pkgsrc/packages/i386/All/gtexinfo-4.0.tgz

>Fix:
Note: the fix below has the same properties as described in the cvs log for
PLIST:
  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/info-stnd.info
-@unexec ${INSTALL_INFO} --delete --info-dir=%D/info %D/info/info.info
-@unexec ${INSTALL_INFO} --delete --info-dir=%D/info %D/info/texinfo
+@unexec %D/bin/install-info --delete --info-dir=%D/info %D/info/info-stnd.info
+@unexec %D/bin/install-info --delete --info-dir=%D/info %D/info/info.info
+@unexec %D/bin/install-info --delete --info-dir=%D/info %D/info/texinfo
 bin/makeinfo
 bin/texi2dvi
 bin/texindex
@@ -25,9 +25,9 @@
 info/texinfo-7
 info/texinfo-8
 info/texinfo-9
-@exec ${INSTALL_INFO} --info-dir=%D/info %D/info/info-stnd.info
-@exec ${INSTALL_INFO} --info-dir=%D/info %D/info/info.info
-@exec ${INSTALL_INFO} --info-dir=%D/info %D/info/texinfo
+@exec %D/bin/install-info --info-dir=%D/info %D/info/info-stnd.info
+@exec %D/bin/install-info --info-dir=%D/info %D/info/info.info
+@exec %D/bin/install-info --info-dir=%D/info %D/info/texinfo
 man/man1/info.1
 man/man1/install-info.1
 man/man1/makeinfo.1

>Release-Note:
>Audit-Trail:
>Unformatted: