Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 May 2014 23:28:53 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r266909 - user/nwhitehorn/condorports
Message-ID:  <201405302328.s4UNSrvA042290@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Fri May 30 23:28:53 2014
New Revision: 266909
URL: http://svnweb.freebsd.org/changeset/base/266909

Log:
  Experimental script for unprivileged port-building. Requires vfs.usermount
  set and the patch from kern/121073.

Added:
  user/nwhitehorn/condorports/buildport-user.sh   (contents, props changed)

Added: user/nwhitehorn/condorports/buildport-user.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/nwhitehorn/condorports/buildport-user.sh	Fri May 30 23:28:53 2014	(r266909)
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin
+
+exec 2>&1
+
+port=$1
+pkg=$2
+release=$3
+tarballname=$(basename $4)
+portsdir=$5
+
+scratchdir=$(pwd)
+
+echo Building $pkg \(origin $port\) for $release on `hostname` $_CONDOR_SLOT 
+
+cleanup() {
+	umount build/buildshare/ports/$portsdir
+	umount build/dev
+	exit 1
+}
+
+set -e
+trap cleanup EXIT
+
+mkdir build
+tar -C build -xf /buildshare/releases/$release.tar
+mkdir -p build/buildshare/ports/$portsdir
+mount -t nullfs -o ro /buildshare/ports/$portsdir build/buildshare/ports/$portsdir
+mount -t devfs devfs build/dev
+tar -C build -xvf $tarballname
+
+# XXX: work around bug in pkg
+cat 'ldconfig_insecure=YES' >> build/etc/rc.conf
+chroot build /etc/rc.d/ldconfig start
+
+portsdir=/buildshare/ports/$portsdir
+
+# Which (if any) of the following should we use fakeroot for?
+
+echo 'Make depends'
+export INSTALL_AS_USER=yes
+chroot build make -C $port depends USE_PACKAGE_DEPENDS=true BATCH=true WRKDIRPREFIX=/obj DISABLE_MAKE_JOBS=true PKGREPOSITORY=/packages PACKAGES=/packages DISTDIR=/distfiles PORTSDIR=$portsdir PACKAGE_BUILDING=1
+
+echo 'Make install'
+chroot build make -C $port install USE_PACKAGE_DEPENDS=true BATCH=true WRKDIRPREFIX=/obj DISABLE_MAKE_JOBS=true PKGREPOSITORY=/packages PACKAGES=/packages DISTDIR=/distfiles PORTSDIR=$portsdir PACKAGE_BUILDING=1
+
+echo 'Make package'
+chroot build make -C $port package PKGREPOSITORY=/packages PACKAGES=/packages BATCH=true NO_LATEST_LINK=true WRKDIRPREFIX=/obj PORTSDIR=$portsdir PACKAGE_BUILDING=1
+cp build/packages/$pkg $scratchdir/$pkg
+
+set +e
+trap true EXIT
+exit 0
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405302328.s4UNSrvA042290>