summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorseb <seb>2003-12-13 18:29:47 +0000
committerseb <seb>2003-12-13 18:29:47 +0000
commitd0f2d00b597b87d55a0e4535bc04d7ad2f52ba4b (patch)
tree22a25640ecd671af8a3a6f2208205d6cbdc639c0 /pkgtools
parent2c042f85b691e47fc8840e41c07300203799849d (diff)
downloadpkgsrc-d0f2d00b597b87d55a0e4535bc04d7ad2f52ba4b.tar.gz
Update to version 1.11
Support pathname to configuration files, support latest libkver and emit the usual BSD_PKG_MK ifdef protection in the generated /etc/mk.conf. Approved by jmmv@.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_comp/Makefile4
-rw-r--r--pkgtools/pkg_comp/files/pkg_comp.834
-rw-r--r--pkgtools/pkg_comp/files/pkg_comp.sh36
3 files changed, 47 insertions, 27 deletions
diff --git a/pkgtools/pkg_comp/Makefile b/pkgtools/pkg_comp/Makefile
index 7cc8e9776c6..2521785f280 100644
--- a/pkgtools/pkg_comp/Makefile
+++ b/pkgtools/pkg_comp/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.14 2003/09/07 22:31:18 jmmv Exp $
+# $NetBSD: Makefile,v 1.15 2003/12/13 18:29:47 seb Exp $
-DISTNAME= pkg_comp-1.10
+DISTNAME= pkg_comp-1.11
WRKSRC= ${WRKDIR}
CATEGORIES= pkgtools
MASTER_SITES= # empty
diff --git a/pkgtools/pkg_comp/files/pkg_comp.8 b/pkgtools/pkg_comp/files/pkg_comp.8
index e3d394c567e..a04e527b505 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.13 2003/09/07 22:31:18 jmmv Exp $
+.\" $NetBSD: pkg_comp.8,v 1.14 2003/12/13 18:29:47 seb Exp $
.\"
.\" pkg_comp - Build packages inside a clean chroot environment
.\" Copyright (c) 2002, 2003, Julio M. Merino Vidal <jmmv@netbsd.org>
@@ -27,7 +27,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd September 7, 2003
+.Dd December 13, 2003
.Dt PKG_COMP 8
.Os
.Sh NAME
@@ -35,7 +35,11 @@
.Nd build packages inside a chroot
.Sh SYNOPSIS
.Nm
-.Op Ar -c conf_file
+.Oo Fl Po
+.Cm c Ns \&| Ns Cm C
+.Pc
+.Ar conf_file
+.Oc
.Ar target
.Op Ar pkg_name ...
.Sh DESCRIPTION
@@ -97,6 +101,13 @@ followed by the configuration file name and the .conf suffix.
The default configuration file is
.Pa $HOME/pkg_comp/default.conf ,
and is always used if you do not specify another one.
+The configuration file name is specified by the argument of the
+.Fl c
+option.
+Alternatively you can specify any pathname as a configuration file
+with the argument of the
+.Fl C
+option.
.Pp
Configuration files are simple shell scripts that define
variables.
@@ -171,17 +182,12 @@ 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
-.Pa pkgtools/libkver
-package is installed, configuring it with the version set in the variable.
-This package fakes some system functions and calls to the
-.Xr sysctl 8
-utility so that programs get the right kernel version with respect to the
-installed userland (inside the chroot).
-Note that
-.Va REAL_SRC
-has to point to a directory holding system sources
-matching the selected version.
+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
+command's output.
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 1d31125f507..19b6484a0d4 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.11 2003/09/07 22:31:18 jmmv Exp $
+# $NetBSD: pkg_comp.sh,v 1.12 2003/12/13 18:29:47 seb Exp $
#
# pkg_comp - Build packages inside a clean chroot environment
# Copyright (c) 2002, 2003, Julio M. Merino Vidal <jmmv@netbsd.org>
@@ -117,7 +117,7 @@ err()
usage()
{
- echo "usage: $ProgName [-c conf_file] target [pkg_names]"
+ echo "usage: $ProgName [-(c|C) conf_file] target [pkg_names]"
exit 1
}
@@ -402,9 +402,10 @@ pkg_makeroot()
if [ "$NETBSD_RELEASE" != "no" ]; then
BUILD_TARGET=install pkg_build pkgtools/libkver
- echo "LD_PRELOAD=/usr/lib/libkver.so; export LD_PRELOAD" >> $DESTDIR/etc/shrc
- echo "setenv LD_PRELOAD /usr/lib/libkver.so" >> $DESTDIR/etc/csh.login
- echo "setenv LD_PRELOAD /usr/lib/libkver.so" >> $DESTDIR/etc/csh.cshrc
+ 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
+ ln -s "$NETBSD_RELEASE" $DESTDIR/libkver_osrelease
fi
if [ "$USE_GCC3" = "yes" ]; then
@@ -436,6 +437,7 @@ makeroot_mkconf()
# /etc/mk.conf
# File automatically generated by pkg_comp on `date`
#
+.ifdef BSD_PKG_MK
EOF
@@ -454,10 +456,6 @@ EOF
fi
fi
- if [ "$NETBSD_RELEASE" != "no" ]; then
- echo "KVER_OSRELEASE = $NETBSD_RELEASE" >> $file
- fi
-
if [ "$USE_AUDIT_PACKAGES" != "yes" ]; then
echo "ALLOW_VULNERABLE_PACKAGES ?= YES" >> $file
fi
@@ -477,6 +475,8 @@ EOF
CFLAGS += $CFLAGS
CPPFLAGS += $CPPFLAGS
CXXFLAGS += $CXXFLAGS
+
+.endif # BSD_PKG_MK
EOF
fi
}
@@ -654,18 +654,28 @@ pkg_removeroot()
confdir="$HOME/pkg_comp"
# Parse options
-args=`getopt c: $*`
+args=`getopt c:C: $*`
if [ $? != 0 ]; then
usage
fi
set -- $args
-conffile="$confdir/default.conf"
+conffile=
while [ $# -gt 0 ]; do
case "$1" in
-c)
+ if [ -n "$conffile" ]; then
+ usage
+ fi
conffile="$confdir/$2.conf"
shift
;;
+ -C)
+ if [ -n "$conffile" ]; then
+ usage
+ fi
+ conffile="$2"
+ shift
+ ;;
--)
shift; break
;;
@@ -677,6 +687,10 @@ if [ $# -lt 1 ]; then
usage
fi
+if [ -z "$conffile" ]; then
+ conffile="$confdir/default.conf"
+fi
+
target="$1"
shift
args="$*"