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

installing packages




To install a package, you have to know where it on the server and
which version of the software OpenBSD has in the ports tree for
the directory you're fetching (as it's part of the package
name). All of this information is stored in the ports tree.


The below set of diffs allow you to type
  FROM_PACKAGE=yes make install
and it fetches the packages from your (well, my) favourite
ftp mirror and installs it. It makes it potentially easier
to install a prebuilt package than build the port from
scratch (if FROM_PACKAGE=yes is in mk.conf).

If you want a snapshot build of ports, you'll want to define
  SNAPSHOT=rightyroo
as well.

This allows you to do
   cd /usr/ports/www/mozilla
   FROM_PACKAGE=yes SNAPSHOT=yes make install
and have mozilla installed (including any missing dependancies).


You can put FROM_PACKAGE into /etc/mk.conf and use FROM_SOURCE
to override it when you want/need a source build.


Comments?



Sam
  Email: S@mSmith.net

Index: infrastructure/templates/network.conf.template
===================================================================
RCS file: /library/OpenBSD/ports/infrastructure/templates/network.conf.template,v
retrieving revision 1.62
diff -u -r1.62 network.conf.template
--- infrastructure/templates/network.conf.template      13 May 2003 10:52:11 -0000      1.62
+++ infrastructure/templates/network.conf.template      20 May 2003 20:57:31 -0000
@@ -262,6 +264,20 @@
        http://packetstorm.dyn.org/ \
        http://packetstorm.blackroute.net/ \
        http://packetstorm.trustica.cz/
+
+
+.if defined (SNAPSHOT)
+PACKAGE_SUBDIR=snapshots
+.else
+PACKAGE_SUBDIR=`uname -r`
+.endif
+
+# Sites with the packages
+MASTER_SITE_OPENBSD_PACKAGES= \
+       ftp://ftp.uk.openbsd.org/pub/OpenBSD/${PACKAGE_SUBDIR}/packages/${MACHINE_ARCH}/ \
+        ftp://ftp.openbsd.org/pub/OpenBSD/${PACKAGE_SUBDIR}/packages/${MACHINE_ARCH}/ \
+        ftp://ftp.usa.openbsd.org/pub/OpenBSD/${PACKAGE_SUBDIR}/packages/${MACHINE_ARCH}/
+

 MASTER_SITE_HORDE+=            \
        ftp://ftp.horde.org/pub/ \

Index: infrastructure/mk/bsd.port.mk
===================================================================
RCS file: /library/OpenBSD/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.544
diff -u -r1.544 bsd.port.mk
@@ -1533,10 +1583,25 @@
        ${_CONFIGURE_COOKIE}
 all build: ${_DEPbuild_COOKIES} ${_DEPlib_COOKIES} ${_DEPmisc_COOKIES} \
        ${_BUILD_COOKIE}
-install: ${_INSTALL_DEPS}
 fake: ${_FAKE_COOKIE}
 package: ${_PACKAGE_DEPS}

+.if defined(FROM_SOURCE) || !defined(FROM_PACKAGE)
+install: ${_INSTALL_DEPS}
+.else
+FILE=${FULLPKGNAME${SUB PACKAGE}}${_MASTER}${PKG_SUFX}
+install:
+.    if ${PERMIT_PACKAGE_FTP:L} == "yes"
+               @for site in ${MASTER_SITE_OPENBSD_PACKAGES}; do\
+               ${ECHO_MSG} ">> Attempting to fetch ${FILE} from $${site}."; \
+               if ${SUDO} /usr/sbin/pkg_add $${site}${FILE}; then \
+                               exit 0; \
+               fi; \
+           done;
+.   else
+           @echo "This package must be built from source as we may not distribute packages."
+.      endif
+.endif

 .  if defined(_IGNORE_REGRESS)
 regress: