summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubertf <hubertf@pkgsrc.org>2001-05-20 01:58:19 +0000
committerhubertf <hubertf@pkgsrc.org>2001-05-20 01:58:19 +0000
commit765504717b4834b42096d926ae18a9fbdce13bf3 (patch)
tree12fa91bfd31708274f03d04041570560cbd316f8
parentebe9b8274a038e4934cbd1bc05cc1b7f31bc127e (diff)
downloadpkgsrc-765504717b4834b42096d926ae18a9fbdce13bf3.tar.gz
make the bin-install target look at some FTP servers (stored in
BINPKG_SITES). As discussed on tech-pkg.
-rw-r--r--Packages.txt13
-rw-r--r--mk/bsd.pkg.mk40
-rw-r--r--mk/mk.conf.example16
3 files changed, 57 insertions, 12 deletions
diff --git a/Packages.txt b/Packages.txt
index d696939bed4..92dba769cd7 100644
--- a/Packages.txt
+++ b/Packages.txt
@@ -1,4 +1,4 @@
-# $NetBSD: Packages.txt,v 1.159 2001/05/09 17:43:22 skrll Exp $
+# $NetBSD: Packages.txt,v 1.160 2001/05/20 01:58:19 hubertf Exp $
###########################################################################
==========================
@@ -273,10 +273,13 @@ LOCALBASE, and X11BASE can also be set in /etc/mk.conf to save having
to remember to set them each time you want to use pkgsrc.
If you want to deinstall and re-install a binary package that you've
-created (see next section) or that you put into pkgsrc/packages
-manually, you can use the the "bin-install" target, which will
-install a binary package - if available - via pkg_add, and do a "make
-package" else.
+created (see next section), that you put into pkgsrc/packages manually or
+that's located on a remote FTP server, you can use the the "bin-install"
+target. This target will install a binary package - if available - via
+pkg_add, and do a "make package" else. The list of remote FTP sites
+searched is kept in the variable BINPKG_SITE, which defaults to
+ftp.netbsd.org. Any flags that should be added to pkg_add(8) can be put
+into BIN_INSTALL_FLAGS. See pkgsrc/mk/mk.conf.example for more details.
A final word of warning: If you setup a system that has a non-standard
setting for LOCALBASE (or X11BASE, for that matter), be sure to set that
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
#