summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorseb <seb@pkgsrc.org>2005-11-16 01:31:35 +0000
committerseb <seb@pkgsrc.org>2005-11-16 01:31:35 +0000
commit5aa7ec82d4baf5987dd728e4d0a8264d5f936bb3 (patch)
tree7fc4e58ddb5522cc83a75d0a93960add91793141 /pkgtools
parent843ffba4364064283d39ad83eb81b85a32120e2b (diff)
downloadpkgsrc-5aa7ec82d4baf5987dd728e4d0a8264d5f936bb3.tar.gz
Update to version 1.24.
When installing libkver, as required when NETBSD_RELEASE is set in a pkg_comp configuration, do so in a special purpose prefix and use it from there. This is useful when running a bulk build in the chroot or simply removing all installed packages in it: the libkver package won't be removed hence the chroot will still be usable. Approved by MAINTAINER.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_comp/Makefile4
-rw-r--r--pkgtools/pkg_comp/files/pkg_comp.825
-rw-r--r--pkgtools/pkg_comp/files/pkg_comp.sh39
3 files changed, 53 insertions, 15 deletions
diff --git a/pkgtools/pkg_comp/Makefile b/pkgtools/pkg_comp/Makefile
index 428b348a89e..7d7f63186b7 100644
--- a/pkgtools/pkg_comp/Makefile
+++ b/pkgtools/pkg_comp/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.31 2005/10/02 09:38:39 jmmv Exp $
+# $NetBSD: Makefile,v 1.32 2005/11/16 01:31:35 seb Exp $
-DISTNAME= pkg_comp-1.23
+DISTNAME= pkg_comp-1.24
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/pkg_comp/files/pkg_comp.8 b/pkgtools/pkg_comp/files/pkg_comp.8
index 28a8cdef7bb..386822802d3 100644
--- a/pkgtools/pkg_comp/files/pkg_comp.8
+++ b/pkgtools/pkg_comp/files/pkg_comp.8
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_comp.8,v 1.27 2005/10/02 09:38:39 jmmv Exp $
+.\" $NetBSD: pkg_comp.8,v 1.28 2005/11/16 01:31:35 seb Exp $
.\"
.\" pkg_comp - Build packages inside a clean chroot environment
.\" Copyright (c) 2002, 2003, 2004, 2005 Julio M. Merino Vidal <jmmv@NetBSD.org>
@@ -231,12 +231,23 @@ If set to
.Ql no ,
no special action is taken (this is useful if the system version inside
the chroot matches the outside one).
-Otherwise, the file
-.Pa /libkver_osrelease
-inside the chroot will hold this variable's value.
-The pkgsrc system will pick up this file and fake the
-.Xr uname 1
-command's output.
+Otherwise, the package
+.Pa pkgtools/libkver
+will be installed inside the chroot, in a special purpose
+prefix which value can be set in
+.Pa $DESTDIR/etc/mk.conf
+with
+.Va LIBKVER_STANDALONE_PREFIX .
+The libkver library will be configured inside the chroot, with the symbolic link
+.Pa $DESTDIR/libkver_osrelease
+and
+.Va LD_PRELOAD
+in default shells environments,
+so that the NetBSD version specified in
+.Va NETBSD_RELEASE
+overrides the host system version. See
+.Xr kver 3
+for more information.
Defaults to
.Ql no .
.It PKG_SYSCONFBASE
diff --git a/pkgtools/pkg_comp/files/pkg_comp.sh b/pkgtools/pkg_comp/files/pkg_comp.sh
index 2b617113ba8..62de22839bb 100644
--- a/pkgtools/pkg_comp/files/pkg_comp.sh
+++ b/pkgtools/pkg_comp/files/pkg_comp.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: pkg_comp.sh,v 1.25 2005/10/02 09:38:39 jmmv Exp $
+# $NetBSD: pkg_comp.sh,v 1.26 2005/11/16 01:31:35 seb Exp $
#
# pkg_comp - Build packages inside a clean chroot environment
# Copyright (c) 2002, 2003, 2004, 2005 Julio M. Merino Vidal <jmmv@NetBSD.org>
@@ -202,8 +202,8 @@ init_script()
#!/bin/sh
# Generated by pkg_comp on `date`
-if [ -f ${LOCALBASE}/lib/libkver.so ]; then
- LD_PRELOAD=${LOCALBASE}/lib/libkver.so; export LD_PRELOAD
+if [ -f ${LIBKVER_STANDALONE_PREFIX}/lib/libkver.so ]; then
+ LD_PRELOAD=${LIBKVER_STANDALONE_PREFIX}/lib/libkver.so; export LD_PRELOAD
fi
EOF
@@ -606,11 +606,38 @@ makeroot_digest()
#
makeroot_libkver()
{
+ local prefix script statfile
+
if [ "$NETBSD_RELEASE" != "no" ]; then
+ _BUILD_TARGET="$BUILD_TARGET"
+ BUILD_TARGET="standalone-install"
pkg_build pkgtools/libkver
- echo "LD_PRELOAD=${LOCALBASE}/lib/libkver.so; export LD_PRELOAD" >> $DESTDIR/etc/shrc
- echo "setenv LD_PRELOAD ${LOCALBASE}/lib/libkver.so" >> $DESTDIR/etc/csh.login
- echo "setenv LD_PRELOAD ${LOCALBASE}/lib/libkver.so" >> $DESTDIR/etc/csh.cshrc
+ BUILD_TARGET="$_BUILD_TARGET"
+ prefix=`mktemp $DESTDIR/pkg_comp/tmp/pkg_comp-XXXX`
+ rm $prefix
+ script="$prefix.sh"
+ statfile="$prefix.stat"
+ init_script $script
+ cat >> $script <<EOF
+cd /usr/pkgsrc/pkgtools/libkver
+make show-var VARNAME=LIBKVER_STANDALONE_PREFIX
+if [ \$? != 0 ]; then
+ touch /pkg_comp/tmp/`basename $statfile`
+fi
+EOF
+ chmod +x $script
+ fsmount
+ LIBKVER_STANDALONE_PREFIX=$(chroot $DESTDIR /pkg_comp/tmp/`basename $script`)
+ fsumount
+ rm $script
+ if [ -f $statfile ]; then
+ rm $statfile
+ err "Failed to get libkver standalone prefix"
+ fi
+ rm $script
+ echo "LD_PRELOAD=${LIBKVER_STANDALONE_PREFIX}/lib/libkver.so; export LD_PRELOAD" >> $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
fi
}