pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/42789: pkgtools/pkg_comp update to handle removal of stanalone-install from pkgtools/libkver



>Number:         42789
>Category:       pkg
>Synopsis:       pkgtools/pkg_comp update to handle removal of 
>stanalone-install from pkgtools/libkver
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 11 10:50:00 +0000 2010
>Originator:     Robert Elz
>Release:        NetBSD *.*   pkgsrc current as of 2010-02-11
>Organization:
        Prince of Songkla University
>Environment:
System: NetBSD jade.coe.psu.ac.th 5.0.2 NetBSD 5.0.2 (JADE-$Revision: 1.12 $) 
#15: Thu Feb 11 12:42:36 ICT 2010 
kre%jade.coe.psu.ac.th@localhost:/usr/obj/5/kernels/JADE i386
Architecture: i386
Machine: i386
>Description:
        pkg_comp attempts to use the standalone-install target of
        pkgtools/libkver to install libkver outside /usr/pkg

        That target broke some time ago (see PR pkg/38651).

        A companion PR submitted at the same time as this one
        (within a second or so anyway) provides an update to
        pkgtools/libkver that (among other things) removes the
        broken standalone-install target (which was most probably
        a poor idea, right from day 1).

        This change in this PR is useful even if that one isn't applied,
        as we don't have to remove the standalone-install target to
        simply avoid using it - this patch does that, avoids using the
        standalone-install target in pkgtools/libkver.

        That is, half of this patch is useful, you'd want to delete the
        part that installs libkverdummy.so as /emul/linux/libkver/lib/libkver.so
        if libkver isn't updated to actually build libkverdummy.so
        (that's independent of whether or not the standalone-install
        target is removed from libkver).

        If the patch in the other PR is applied, then this one becomes
        close to mandatory.

        If this patch is applied (with or without the other one), the
        PR 38651 can close.

>How-To-Repeat:
        Try running pkg_comp with NETBSD_RELEASE defined to be something
        other than "no" in pkg_comp's config file.

        If anyone cares, I have lots more mods to pkg_comp that I
        could supply, some of which already exist in other PR's...

>Fix:
        This patch, applied in pkgtools/pkg_comp changes the way
        pkg_comp installs libkver - it now installs it normally,
        and then copies the files from where pkg_add (or make install)
        placed them (inside /usr/pkg) to where pkg_comp would prefer
        them to be.

Index: pkg_comp.sh
===================================================================
RCS file: /cvsroot/NetBSD/pkgsrc/pkgtools/pkg_comp/files/pkg_comp.sh,v
retrieving revision 1.35
diff -u -r1.35 pkg_comp.sh
--- pkg_comp.sh 13 May 2009 10:40:24 -0000      1.35
+++ pkg_comp.sh 11 Feb 2010 09:56:34 -0000
@@ -624,11 +624,32 @@
     local prefix script statfile
 
     if [ "$NETBSD_RELEASE" != "no" ]; then
-        _BUILD_TARGET="$BUILD_TARGET"
-        BUILD_TARGET="standalone-install"
-        pkg_build pkgtools/libkver
-        BUILD_TARGET="$_BUILD_TARGET"
-        echo "LD_PRELOAD=${LIBKVER_STANDALONE_PREFIX}/lib/libkver.so; export 
LD_PRELOAD" >> $DESTDIR/etc/shrc
+        pkg_build pkgtools/libkver || {
+               warn "PKG_COMP *** pkgtools/libkver build failed"
+               return
+       }
+       (
+               echo "PKG_COMP ==> Copying libkver from ${LOCALBASE}/lib to 
${LIBKVER_STANDALONE_PREFIX}/lib"
+               cd "${DESTDIR}${LOCALBASE}/lib" || exit 1
+               mkdir -p "${DESTDIR}${LIBKVER_STANDALONE_PREFIX}/lib" || exit 1
+               pax -rw -pe libkver.so libkver.so.*.* \
+                   "${DESTDIR}${LIBKVER_STANDALONE_PREFIX}/lib/." || {
+                       warn "PKG_COMP *** Unable to install standalone libkver"
+                       exit 1
+               }
+               mkdir -p
+                   "${DESTDIR}/emul/linux/${LIBKVER_STANDALONE_PREFIX}/lib" ||
+                       exit 1
+               pax -rw -pe -s '/dummy//' libkverdummy.so libkverdummy.so.*.* \
+                "${DESTDIR}/emul/linux/${LIBKVER_STANDALONE_PREFIX}/lib/." || {
+                       warn "PKG_COMP *** Unable to install dummy libkver for 
linux emulation"
+                       exit 1
+               }
+               exit 0
+       ) || return
+       echo 'if [ -f "'"${LIBKVER_STANDALONE_PREFIX}/lib/libkver.so"'" ]; 
then' >> $DESTDIR/etc/shrc
+        echo " LD_PRELOAD=${LIBKVER_STANDALONE_PREFIX}/lib/libkver.so; export 
LD_PRELOAD" >> $DESTDIR/etc/shrc
+       echo 'fi' >> $DESTDIR/etc/shrc
         echo "setenv LD_PRELOAD ${LIBKVER_STANDALONE_PREFIX}/lib/libkver.so" 
>> $DESTDIR/etc/csh.login
         echo "setenv LD_PRELOAD ${LIBKVER_STANDALONE_PREFIX}/lib/libkver.so" 
>> $DESTDIR/etc/csh.cshrc
         ln -s "$NETBSD_RELEASE" $DESTDIR/libkver_osrelease



Home | Main Index | Thread Index | Old Index