[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
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.


  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/ \
+.if defined (SNAPSHOT)
+PACKAGE_SUBDIR=`uname -r`
+# Sites with the 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 @@
 all build: ${_DEPbuild_COOKIES} ${_DEPlib_COOKIES} ${_DEPmisc_COOKIES} \
-install: ${_INSTALL_DEPS}
 fake: ${_FAKE_COOKIE}
 package: ${_PACKAGE_DEPS}

+.if defined(FROM_SOURCE) || !defined(FROM_PACKAGE)
+install: ${_INSTALL_DEPS}
+.    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

 .  if defined(_IGNORE_REGRESS)