diff options
author | hubertf <hubertf> | 2001-05-20 01:58:19 +0000 |
---|---|---|
committer | hubertf <hubertf> | 2001-05-20 01:58:19 +0000 |
commit | e3810bd33cd8692d8c305dff3494bedf1bd45aaf (patch) | |
tree | 12fa91bfd31708274f03d04041570560cbd316f8 /mk | |
parent | 9f68d516f58789631c5ae3cfc6d2fa92838ac2e6 (diff) | |
download | pkgsrc-e3810bd33cd8692d8c305dff3494bedf1bd45aaf.tar.gz |
make the bin-install target look at some FTP servers (stored in
BINPKG_SITES). As discussed on tech-pkg.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 40 | ||||
-rw-r--r-- | mk/mk.conf.example | 16 |
2 files changed, 49 insertions, 7 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 475f69bbdbc..864de62be83 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.743 2001/05/20 00:54:09 hubertf Exp $ +# $NetBSD: bsd.pkg.mk,v 1.744 2001/05/20 01:58:20 hubertf Exp $ # # This file is in the public domain. # @@ -2632,17 +2632,45 @@ checksum: fetch uptodate-digest .endif + +# List of sites carrying binary pkgs. Variables "rel" and "arch" are +# replaced with OS release ("1.5", ...) and architecture ("mipsel", ...) +BINPKG_SITE?= \ + ftp://ftp.netbsd.org/pub/NetBSD/packages/$${rel}/$${arch} + +# List of flags to pass to pkg_add(8) for bin-install: +BIN_INSTALL_FLAGS?= # -v + # Install binary pkg, without strict uptodate-check first -# (XXX should be able to snarf via FTP. Later...) bin-install: + @found="`${PKG_INFO} -e \"${PKGWILDCARD}\" || ${TRUE}`"; \ + if [ "$$found" != "" ]; then \ + ${ECHO_MSG} "${_PKGSRC_IN}> $$found is already installed - perhaps an older version?"; \ + ${ECHO_MSG} "*** If so, you may wish to \`\`pkg_delete $$found'' and install"; \ + ${ECHO_MSG} "*** this package again by \`\`${MAKE} bin-install'' to upgrade it properly."; \ + ${SHCOMMENT} ${ECHO_MSG} "*** or use \`\`${MAKE} bin-update'' to upgrade it and all of its dependencies."; \ + exit 1; \ + fi @if [ -f ${PKGFILE} ] ; then \ ${ECHO_MSG} "Installing from binary pkg ${PKGFILE}" ; \ ${PKG_ADD} ${PKGFILE} ; \ else \ - ${SHCOMMENT} Cycle through some FTP server here ;\ - ${ECHO_MSG} "Installing from source" ; \ - ${MAKE} ${MAKEFLAGS} package && \ - ${MAKE} ${MAKEFLAGS} clean ; \ + rel=`uname -r | sed 's@\.\([0-9]*\)[\._].*@\.\1@'`; \ + arch=`sysctl -n hw.machine_arch`; \ + for site in ${BINPKG_SITE} ; do \ + ${ECHO} Trying `eval echo $$site`/All ; \ + ${SHCOMMENT} echo ${SETENV} PKG_PATH="`eval echo $$site`/All" ${PKG_ADD} ${BIN_INSTALL_FLAGS} ${PKGNAME}${PKG_SUFX} ; \ + if ${SETENV} PKG_PATH="`eval echo $$site`/All" ${PKG_ADD} ${BIN_INSTALL_FLAGS} ${PKGNAME}${PKG_SUFX} ; then \ + ${ECHO} "${PKGNAME} successfully installed." ; \ + break ; \ + fi ; \ + done ; \ + if ! ${PKG_INFO} -qe ${PKGNAME} ; then \ + ${SHCOMMENT} Cycle through some FTP server here ;\ + ${ECHO_MSG} "Installing from source" ; \ + ${MAKE} ${MAKEFLAGS} package && \ + ${MAKE} ${MAKEFLAGS} clean ; \ + fi ; \ fi diff --git a/mk/mk.conf.example b/mk/mk.conf.example index d5706ca2523..01c6ad116d8 100644 --- a/mk/mk.conf.example +++ b/mk/mk.conf.example @@ -1,4 +1,4 @@ -# $NetBSD: mk.conf.example,v 1.210 2001/05/18 06:01:35 jlam Exp $ +# $NetBSD: mk.conf.example,v 1.211 2001/05/20 01:58:21 hubertf Exp $ # # Sample /etc/mk.conf file, which can be used to set specific values @@ -283,6 +283,20 @@ # Possible: defined, not defined # Default: not defined +#BINPKG_SITE=... +# Whitespace seperated list of URLs for binary packages. Directories +# "All" etc. are expected in the named place, variables "rel" and +# "arch" are replaced with OS release ("1.5", ...) and architecture +# ("mipsel", ...) +# Possible: any ftp url, see above. +# Default: ftp://ftp.netbsd.org/pub/NetBSD/packages/$${rel}/$${arch} + +#BIN_INSTALL_FLAGS= +# List of flags passed to pkg_add(8) in the bin_install package. +# Possible: -v, -u, etc. See pkg_add(8) +# Default: (no option) + + # # Definitions used only in the packages collection # |