From 3c5895a2f6aaaa9c04115a09006f0a60249be045 Mon Sep 17 00:00:00 2001 From: grant Date: Tue, 23 Sep 2003 07:44:48 +0000 Subject: add --with-{ftp,mtree,pax,tar} to allow overriding the commands that pkg_install calls, and pass the full path for each from the pkg Makefile. fixes issue with pkg_add and pkg_create calling non-existent or less-than-functional tools since it relied on $PATH. --- pkgtools/pkg_install/Makefile | 6 +- pkgtools/pkg_install/files/add/Makefile.in | 4 +- pkgtools/pkg_install/files/configure | 92 ++++++++++++++------------ pkgtools/pkg_install/files/configure.ac | 27 +++++++- pkgtools/pkg_install/files/create/Makefile.in | 6 +- pkgtools/pkg_install/files/lib/Makefile.in | 7 +- pkgtools/pkg_install/files/view/pkg_view.sh.in | 4 +- 7 files changed, 93 insertions(+), 53 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/pkg_install/Makefile b/pkgtools/pkg_install/Makefile index f7329d69f92..0f9c93f72c6 100644 --- a/pkgtools/pkg_install/Makefile +++ b/pkgtools/pkg_install/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.86 2003/09/18 23:43:37 grant Exp $ +# $NetBSD: Makefile,v 1.87 2003/09/23 07:44:48 grant Exp $ # Notes to package maintainers: # @@ -19,6 +19,10 @@ COMMENT= Package installation and administration tools GNU_CONFIGURE= # defined CONFIGURE_ARGS+= --with-pkgdbdir=${PKG_DBDIR} +CONFIGURE_ARGS+= --with-ftp=${FETCH_CMD} +CONFIGURE_ARGS+= --with-mtree=${MTREE} +CONFIGURE_ARGS+= --with-pax=${PAX} +CONFIGURE_ARGS+= --with-tar=${TAR} NO_PKGTOOLS_REQD_CHECK= # defined NO_BUILDLINK= # defined diff --git a/pkgtools/pkg_install/files/add/Makefile.in b/pkgtools/pkg_install/files/add/Makefile.in index 315f126ae25..24c3172ddcf 100644 --- a/pkgtools/pkg_install/files/add/Makefile.in +++ b/pkgtools/pkg_install/files/add/Makefile.in @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.in,v 1.8 2003/09/23 06:36:19 grant Exp $ +# $NetBSD: Makefile.in,v 1.9 2003/09/23 07:44:50 grant Exp $ srcdir= @srcdir@ @@ -14,7 +14,7 @@ CC= @CC@ CCLD= $(CC) LIBS= -linstall @LIBS@ CPPFLAGS= @CPPFLAGS@ -I. -I$(srcdir) -I../lib -DEFS= @DEFS@ -DBINDIR=\"$(sbindir)\" +DEFS= @DEFS@ -DBINDIR=\"$(sbindir)\" -DMTREE_CMD=\"@mtree@\" CFLAGS= @CFLAGS@ LDFLAGS= @LDFLAGS@ -L../lib diff --git a/pkgtools/pkg_install/files/configure b/pkgtools/pkg_install/files/configure index 249dab130a2..859041c1ca8 100755 --- a/pkgtools/pkg_install/files/configure +++ b/pkgtools/pkg_install/files/configure @@ -310,7 +310,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CANONICAL_HOST INCLUDES SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S RANLIB ac_ct_RANLIB AR CHMOD CMP CP ENV FIND GREP LN MKDIR PAX RMDIR RM SED SORT TOUCH AUTOCONF AUTOHEADER pkgdbdir CPP EGREP LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CANONICAL_HOST INCLUDES SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S RANLIB ac_ct_RANLIB AR CHMOD CMP CP ENV FIND GREP LN MKDIR RMDIR RM SED SORT TOUCH AUTOCONF AUTOHEADER pkgdbdir ftp tar pax mtree CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -847,7 +847,11 @@ if test -n "$ac_init_help"; then Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pkgdbdir=DIR Where to put the pkg database (/var/db/pkg) + --with-pkgdbdir=DIR Where to put the pkg database (/var/db/pkg) + --with-ftp=path Path to tnftp (PREFIX/bin/ftp) + --with-tar=path Path to pax-as-tar (PREFIX/bin/tar) + --with-pax=path Path to pax (PREFIX/bin/pax) + --with-mtree=path Path to mtree (PREFIX/sbin/mtree) Some influential environment variables: CC C compiler command @@ -2776,45 +2780,6 @@ else echo "${ECHO_T}no" >&6 fi -# Extract the first word of "pax", so it can be a program name with args. -set dummy pax; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PAX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PAX in - [\\/]* | ?:[\\/]*) - ac_cv_path_PAX="$PAX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PAX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - ;; -esac -fi -PAX=$ac_cv_path_PAX - -if test -n "$PAX"; then - echo "$as_me:$LINENO: result: $PAX" >&5 -echo "${ECHO_T}$PAX" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - # Extract the first word of "rmdir", so it can be a program name with args. set dummy rmdir; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -3027,6 +2992,46 @@ fi; +# Check whether --with-ftp or --without-ftp was given. +if test "${with_ftp+set}" = set; then + withval="$with_ftp" + ftp="$with_ftp" +else + ftp='$(prefix)/bin/ftp' +fi; + + + +# Check whether --with-tar or --without-tar was given. +if test "${with_tar+set}" = set; then + withval="$with_tar" + tar="$with_tar" +else + tar='$(prefix)/bin/tar' +fi; + + + +# Check whether --with-pax or --without-pax was given. +if test "${with_pax+set}" = set; then + withval="$with_pax" + pax="$with_pax" +else + pax='$(prefix)/bin/pax' +fi; + + + +# Check whether --with-mtree or --without-mtree was given. +if test "${with_mtree+set}" = set; then + withval="$with_mtree" + mtree="$with_mtree" +else + mtree='$(sbindir)/mtree' +fi; + + + echo "$as_me:$LINENO: checking for dbopen in -ldb1" >&5 echo $ECHO_N "checking for dbopen in -ldb1... $ECHO_C" >&6 @@ -4934,7 +4939,6 @@ s,@FIND@,$FIND,;t t s,@GREP@,$GREP,;t t s,@LN@,$LN,;t t s,@MKDIR@,$MKDIR,;t t -s,@PAX@,$PAX,;t t s,@RMDIR@,$RMDIR,;t t s,@RM@,$RM,;t t s,@SED@,$SED,;t t @@ -4943,6 +4947,10 @@ s,@TOUCH@,$TOUCH,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@pkgdbdir@,$pkgdbdir,;t t +s,@ftp@,$ftp,;t t +s,@tar@,$tar,;t t +s,@pax@,$pax,;t t +s,@mtree@,$mtree,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LIBOBJS@,$LIBOBJS,;t t diff --git a/pkgtools/pkg_install/files/configure.ac b/pkgtools/pkg_install/files/configure.ac index 49cc2b96f21..a5566b57023 100644 --- a/pkgtools/pkg_install/files/configure.ac +++ b/pkgtools/pkg_install/files/configure.ac @@ -25,7 +25,6 @@ AC_PATH_PROG(FIND, find) AC_PATH_PROG(GREP, grep) AC_PATH_PROG(LN, ln) AC_PATH_PROG(MKDIR, mkdir) -AC_PATH_PROG(PAX, pax) AC_PATH_PROG(RMDIR, rmdir) AC_PATH_PROG(RM, rm) AC_PATH_PROG(SED, sed) @@ -39,11 +38,35 @@ AC_SUBST(AUTOHEADER) dnl Set the default pkg dbdir AC_ARG_WITH(pkgdbdir, -[ --with-pkgdbdir=DIR Where to put the pkg database (/var/db/pkg)], +[ --with-pkgdbdir=DIR Where to put the pkg database (/var/db/pkg)], [ pkgdbdir="$with_pkgdbdir" ], [ pkgdbdir="/var/db/pkg" ]) AC_SUBST(pkgdbdir) +AC_ARG_WITH(ftp, +[ --with-ftp=path Path to tnftp (PREFIX/bin/ftp)], +[ ftp="$with_ftp" ], +[ ftp='$(prefix)/bin/ftp' ]) +AC_SUBST(ftp) + +AC_ARG_WITH(tar, +[ --with-tar=path Path to pax-as-tar (PREFIX/bin/tar)], +[ tar="$with_tar" ], +[ tar='$(prefix)/bin/tar' ]) +AC_SUBST(tar) + +AC_ARG_WITH(pax, +[ --with-pax=path Path to pax (PREFIX/bin/pax)], +[ pax="$with_pax" ], +[ pax='$(prefix)/bin/pax' ]) +AC_SUBST(pax) + +AC_ARG_WITH(mtree, +[ --with-mtree=path Path to mtree (PREFIX/sbin/mtree)], +[ mtree="$with_mtree" ], +[ mtree='$(sbindir)/mtree' ]) +AC_SUBST(mtree) + dnl Checks for libraries. AC_CHECK_LIB(db1, dbopen) AC_SEARCH_LIBS(tgetent, [termcap termlib curses ncurses]) diff --git a/pkgtools/pkg_install/files/create/Makefile.in b/pkgtools/pkg_install/files/create/Makefile.in index d535755b242..4e79b084d2f 100644 --- a/pkgtools/pkg_install/files/create/Makefile.in +++ b/pkgtools/pkg_install/files/create/Makefile.in @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.in,v 1.9 2003/09/23 06:36:20 grant Exp $ +# $NetBSD: Makefile.in,v 1.10 2003/09/23 07:44:51 grant Exp $ srcdir= @srcdir@ @@ -10,11 +10,13 @@ mandir= @mandir@ man1dir= $(mandir)/man1 cat1dir= $(mandir)/cat1 +tar= @tar@ + CC= @CC@ CCLD= $(CC) LIBS= -linstall @LIBS@ CPPFLAGS= @CPPFLAGS@ -I. -I$(srcdir) -I../lib -DEFS= @DEFS@ +DEFS= @DEFS@ -DTAR_CMD=\"$(tar)\" CFLAGS= @CFLAGS@ LDFLAGS= @LDFLAGS@ -L../lib diff --git a/pkgtools/pkg_install/files/lib/Makefile.in b/pkgtools/pkg_install/files/lib/Makefile.in index 6e73cfe8bbb..ed57e3596e7 100644 --- a/pkgtools/pkg_install/files/lib/Makefile.in +++ b/pkgtools/pkg_install/files/lib/Makefile.in @@ -1,14 +1,17 @@ -# $NetBSD: Makefile.in,v 1.5 2003/09/23 06:36:21 grant Exp $ +# $NetBSD: Makefile.in,v 1.6 2003/09/23 07:44:51 grant Exp $ srcdir= @srcdir@ pkgdbdir= @pkgdbdir@ +tar= @tar@ +ftp= @ftp@ + RANLIB= @RANLIB@ AR= @AR@ CC= @CC@ CPPFLAGS= @CPPFLAGS@ -I. -I$(srcdir) -DEFS= @DEFS@ -DDEF_LOG_DIR=\"$(pkgdbdir)\" +DEFS= @DEFS@ -DDEF_LOG_DIR=\"$(pkgdbdir)\" -DTAR_CMD=\"$(tar)\" -DFTP_CMD=\"$(ftp)\" CFLAGS= @CFLAGS@ LIB= libinstall.a diff --git a/pkgtools/pkg_install/files/view/pkg_view.sh.in b/pkgtools/pkg_install/files/view/pkg_view.sh.in index 8f78b4eba1b..1333191b68e 100644 --- a/pkgtools/pkg_install/files/view/pkg_view.sh.in +++ b/pkgtools/pkg_install/files/view/pkg_view.sh.in @@ -1,6 +1,6 @@ #! /bin/sh -# $NetBSD: pkg_view.sh.in,v 1.2 2003/09/09 13:34:22 jlam Exp $ +# $NetBSD: pkg_view.sh.in,v 1.3 2003/09/23 07:44:51 grant Exp $ # # Copyright (c) 2001 Alistair G. Crooks. All rights reserved. @@ -48,7 +48,7 @@ grepprog="@GREP@" linkfarmprog="@sbindir@/linkfarm" lnprog="@LN@" mkdirprog="@MKDIR@" -paxprog="@PAX@" +paxprog="@pax@" pkgadminprog="@sbindir@/pkg_admin" pkginfoprog="@sbindir@/pkg_info" rmprog="@RM@" -- cgit v1.2.3