defpkgbuild(vinix-filesystem, #:pkgname, "vinix-filesystem", #:pkgver, "0.1.0", #:pkgrel, 1, #:pkgdesc, "Vinix filesystem directories, runtime links, host policy and login environment", #:arch, [#:any], #:url, "https://github.com/vlang/vinix", #:license, "GPL-2.0-or-later", #:backup, ["etc/hosts", "etc/hostname", "etc/nsswitch.conf", "etc/shells", "etc/profile"], #:source, ["hosts", "hostname", "nsswitch.conf", "shells", "profile"], #:sha256sums, ["b69b2c741be48691edabe3771c644c70473ccd6aa8effd9f17cc07fa129917f9", "251a9fbf3ef48f76ea758f161e04f8e2ffc27d712bd4993a4763e53163dbd0f4", "2ad90a00ddc40e2931e9da1b7c943a5d40d15039436ea2e20442d47c0916959e", "7da658925aa565924877b098d2d61eba65190943266973a37182fc96b8f89cdb", "1ecc0432bad0127ea5747b9741c5706427b71536fd7ac4426b4a59b532753835"], #:check, fn() { run("sh", "-n", "profile") run("grep", "-Fx", "/bin/sh", "shells") run("grep", "-Fx", "hosts: files dns", "nsswitch.conf") }, #:package, fn() { for-each(fn(dir) { run("install", "-d", "-m755", string-append(pkgdir(), "/", dir)) }, list("bin", "sbin", "dev", "dev/pts", "dev/shm", "proc", "sys", "home", "etc/profile.d", "etc/sysctl.d", "run/lock", "mnt", "media", "opt", "srv", "lib", "usr/bin", "usr/lib", "usr/sbin", "usr/share", "usr/local/bin", "usr/local/lib", "usr/local/sbin", "usr/local/share", "var/cache", "var/lib", "var/log", "var/spool")) run("install", "-d", "-m700", string-append(pkgdir(), "/root")) run("install", "-d", "-m1777", string-append(pkgdir(), "/tmp"), string-append(pkgdir(), "/var/tmp")) for-each(fn(file) { run("install", "-Dm644", file, string-append(pkgdir(), "/etc/", file)) }, list("hosts", "hostname", "nsswitch.conf", "shells", "profile")) run("ln", "-s", "../run", string-append(pkgdir(), "/var/run")) run("ln", "-s", "../run/lock", string-append(pkgdir(), "/var/lock")) run("ln", "-s", "/proc/mounts", string-append(pkgdir(), "/etc/mtab")) })