Index | Thread | Search

From:
Stuart Henderson <stu@spacehopper.org>
Subject:
Re: Running make in ports as a normal user
To:
<j@bitminer.ca>, Ports <ports@openbsd.org>, <wai@roquesor.com>
Date:
Mon, 10 Nov 2025 10:52:16 +0000

Download raw body.

Thread
I recommend making /usr/ports a separate filesystem and keep the default 
dirs for most things.

Pointing WRKOBJDIR at a less important fs is a good idea for when the 
kernel crashes during a build. Then newfs is a viable and faster cleanup 
strategy than fsck.

Set SUDO and PORTS_PRIVSEP in mk.conf, and run "make fix-permissions" in 
the dir for any port to create the dirs and set ownership.

I think the tars are fixed in 7.8, but why ftp and then cvs to get any 
updates, when you could just fetch via cvs anyway?

-- 
  Sent from a phone, apologies for poor formatting.

On 9 November 2025 22:53:28 j@bitminer.ca wrote:

> Why do it the hard way when you can script it?
>
> cat myports.sh
> ftp https://ftp.openbsd.org/pub/OpenBSD/snapshots/ports.tar.gz
> tar xzpf ports.tar.gz -C /usr
>
> osver=`uname -r`
> mkdir -p /usr/distfiles /usr/obj/ports
> mkdir -p /usr/cache/pub/OpenBSD/$osver/packages/amd64
>
> chown metheuser:metheuser /usr/distfiles
> /usr/cache/pub/OpenBSD/$osver/packages/amd64
> chown metheuser:metheuser /usr/obj/ports
>
> chmod 775 /usr/obj
>
> chown metheuser:metheuser /usr/ports
> chown -R metheuser:metheuser /usr/ports
>
>> /etc/mk.conf
> echo WRKOBJDIR=/usr/obj/ports >> /etc/mk.conf
> echo DISTDIR=/usr/distfiles   >> /etc/mk.conf
> echo PACKAGE_REPOSITORY=/usr/cache/pub/OpenBSD/$osver/packages >>
> /etc/mk.conf
>
>
> At this point metheuser can "cd /usr/ports/math/minisat"
> and "make package" and it will work.
>
> Note that the original tar file creates files with group = wheel so you
> can simplify by adding yourself to wheel.
>
> Note that the tar files are incomplete because tar and you have to
> update with
>
>     cd /usr/ports
>     cvs -d $YOURMIRROR:/cvs -q up -Pd
>
> where YOURMIRROR is one of the published ones, but probably not one of
> the first two or three.
>
>
> J