Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

ports/3326: Fetching packages is harder than needed

From: <S(at)mSmith.net>
Date: Fri Jun 20 2003 - 17:09:11 EDT


>Number: 3326
>Category: ports
>Synopsis: Fetching packages is harder than needed
>Confidential: yes
net
>Environment:
        

	System      : OpenBSD 3.3
	Architecture: OpenBSD.i386
	Machine     : i386

>Description:

To install a package; you must know what the version of the software the package is for.

The ports tree already knows this.

I'm lazy.
>How-To-Repeat:

   ftp to your local friendly ftp mirror and try to download a package.
>Fix:

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

This makes testing packages very easy.

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

This allows you to do

Do you need help?X

   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 a source build.

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:

>Release-Note:
Received on Fri Jun 20 17:30:17 2003

Do you need more help?X

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:58 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library