pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_comp Update to version 1.11



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a2e13a1f27a6
branches:  trunk
changeset: 464616:a2e13a1f27a6
user:      seb <seb%pkgsrc.org@localhost>
date:      Sat Dec 13 18:29:47 2003 +0000

description:
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:

 pkgtools/pkg_comp/Makefile          |   4 ++--
 pkgtools/pkg_comp/files/pkg_comp.8  |  34 ++++++++++++++++++++--------------
 pkgtools/pkg_comp/files/pkg_comp.sh |  36 +++++++++++++++++++++++++-----------
 3 files changed, 47 insertions(+), 27 deletions(-)

diffs (185 lines):

diff -r a5b5c2cb2542 -r a2e13a1f27a6 pkgtools/pkg_comp/Makefile
--- a/pkgtools/pkg_comp/Makefile        Sat Dec 13 18:12:34 2003 +0000
+++ b/pkgtools/pkg_comp/Makefile        Sat Dec 13 18:29:47 2003 +0000
@@ -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 -r a5b5c2cb2542 -r a2e13a1f27a6 pkgtools/pkg_comp/files/pkg_comp.8
--- a/pkgtools/pkg_comp/files/pkg_comp.8        Sat Dec 13 18:12:34 2003 +0000
+++ b/pkgtools/pkg_comp/files/pkg_comp.8        Sat Dec 13 18:29:47 2003 +0000
@@ -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@localhost>
@@ -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 @@
 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 @@
 .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 -r a5b5c2cb2542 -r a2e13a1f27a6 pkgtools/pkg_comp/files/pkg_comp.sh
--- a/pkgtools/pkg_comp/files/pkg_comp.sh       Sat Dec 13 18:12:34 2003 +0000
+++ b/pkgtools/pkg_comp/files/pkg_comp.sh       Sat Dec 13 18:29:47 2003 +0000
@@ -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@localhost>
@@ -117,7 +117,7 @@
 
 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 @@
 
     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 @@
 # /etc/mk.conf
 # File automatically generated by pkg_comp on `date`
 #
+.ifdef BSD_PKG_MK
 
 EOF
 
@@ -454,10 +456,6 @@
         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 @@
 CFLAGS += $CFLAGS
 CPPFLAGS += $CPPFLAGS
 CXXFLAGS += $CXXFLAGS
+
+.endif # BSD_PKG_MK
 EOF
     fi
 }
@@ -654,18 +654,28 @@
 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 @@
     usage
 fi
 
+if [ -z "$conffile" ]; then
+    conffile="$confdir/default.conf"
+fi
+
 target="$1"
 shift
 args="$*"



Home | Main Index | Thread Index | Old Index