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 = "/usr/pkgsrc",
bootstrap = initdir .. "/bootstrap.tar.gz",
logdir = initdir .. "/logs",
make = "/usr/pkg/bin/bmake",
pkgpaths = {
"mail/mutt",
"sysutils/coreutils",
},
tar = "/bin/tar",
cachevars = {
"NATIVE_OPSYS",
"NATIVE_OPSYS_VERSION",
"NATIVE_OS_VERSION",
},
env = function(pkg)
local env = {}
return env
end,
}
scripts = {
["pre-build"] = initdir .. "/scripts/pre-build",
["post-build"] = initdir .. "/scripts/post-build",
}
sandboxes = {
basedir = "/data/chroot",
actions = {
{ action = "mount", fs = "dev", dir = "/dev" },
{ action = "mount", fs = "proc", dir = "/proc" },
{ action = "mount", fs = "tmp", dir = "/tmp", opts = "size=1G" },
{ action = "mount", fs = "tmp", dir = "/var/tmp", opts = "size=1G" },
{ action = "mount", fs = "bind", dir = "/usr/bin", opts = "ro" },
{ action = "mount", fs = "bind", dir = "/usr/sbin", opts = "ro" },
{ action = "mount", fs = "bind", dir = "/usr/lib", opts = "ro" },
{ action = "mount", fs = "bind", dir = "/usr/lib64", opts = "ro" },
{ action = "mount", fs = "bind", dir = "/usr/libexec", opts = "ro" },
{ action = "mount", fs = "bind", dir = "/usr/include", opts = "ro" },
{ action = "mount", fs = "bind", dir = "/usr/share", opts = "ro" },
{ action = "symlink", src = "usr/bin", dest = "/bin" },
{ action = "symlink", src = "usr/lib", dest = "/lib" },
{ action = "symlink", src = "usr/lib64", dest = "/lib64" },
{ action = "symlink", src = "usr/sbin", dest = "/sbin" },
{ action = "copy", dir = "/etc" },
{ action = "cmd", chroot = true, create = "chmod 1777 /tmp /var/tmp" },
{ action = "cmd", chroot = true, ifset = "pkgsrc.build_user", create = [[
user="{pkgsrc.build_user}"
homedir=$(su ${user} -c 'echo ${HOME}')
mkdir -p ${homedir}
chown ${user} ${homedir}
]] },
{ action = "mount", fs = "bind", dir = pkgsrc.basedir },
{ action = "mount", fs = "bind", dir = initdir },
},
}