local initdir = "@INITDIR@"
options = {
build_threads = 4,
scan_threads = 4,
log_level = "info",
}
environment = {
clear = true,
inherit = { "TERM", "HOME" },
set = {
PATH = "/sbin:/bin:/usr/sbin:/usr/bin",
},
}
pkgsrc = {
basedir = "/Volumes/data/pkgsrc",
bootstrap = initdir .. "/bootstrap.tar.gz",
make = "/opt/pkg/bin/bmake",
pkgpaths = {
"mail/mutt",
"sysutils/coreutils",
},
tar = "/usr/bin/tar",
cachevars = {
"NATIVE_OPSYS",
"NATIVE_OPSYS_VERSION",
"NATIVE_OS_VERSION",
},
}
scripts = {
["pre-build"] = initdir .. "/scripts/pre-build",
["post-build"] = initdir .. "/scripts/post-build",
}
sandboxes = {
basedir = "/Volumes/data/chroot",
actions = {
{ action = "mount", fs = "dev", dir = "/dev" },
{ action = "mount", fs = "tmp", dir = "/tmp", opts = "-e -s 384m" },
{ action = "mount", fs = "tmp", dir = "/var", opts = "-e -s 512m" },
{ action = "cmd", create = "mkdir -m 1777 var/tmp; chmod 1777 tmp" },
{ action = "mount", fs = "bind", dir = "/Library", opts = "-r" },
{ action = "mount", fs = "bind", dir = "/System", opts = "-r" },
{ action = "mount", fs = "bind", dir = "/bin", opts = "-r" },
{ action = "mount", fs = "bind", src = "/private/etc", dest = "/etc", opts = "-r" },
{ action = "mount", fs = "bind", dir = "/sbin", opts = "-r" },
{ action = "mount", fs = "bind", dir = "/usr", opts = "-r" },
{ action = "mount", fs = "bind", dir = "/private/var/spool/postfix" },
{ action = "cmd", create = initdir .. "/scripts/mdns-listener create",
destroy = initdir .. "/scripts/mdns-listener destroy" },
{ action = "cmd", chroot = true, create = [[
mkdir -p /var/{folders,select}
mkdir -p $(getconf DARWIN_USER_TEMP_DIR)
]] },
{ action = "cmd", ifset = "pkgsrc.build_user",
create = [[
tempdir=$(sudo -u ${bob_build_user} getconf DARWIN_USER_TEMP_DIR)
for dir in ${bob_build_user_home} ${tempdir}; do \
mkdir -p ${bob_sandbox_path}${dir}
chown ${bob_build_user} ${bob_sandbox_path}${dir}
done
]],
destroy = "rm -rf ${bob_sandbox_path}${bob_build_user_home}" },
{ action = "mount", fs = "bind", dir = pkgsrc.basedir },
{ action = "mount", fs = "bind", dir = initdir },
},
}