vinix-ports / vinix-filesystem / PKGBUILD.vile
36 lines · 36 sloc · 2.03 KB
Raw
1defpkgbuild(vinix-filesystem,
2 #:pkgname, "vinix-filesystem",
3 #:pkgver, "0.1.0",
4 #:pkgrel, 1,
5 #:pkgdesc, "Vinix filesystem directories, runtime links, host policy and login environment",
6 #:arch, [#:any],
7 #:url, "https://github.com/vlang/vinix",
8 #:license, "GPL-2.0-or-later",
9 #:backup, ["etc/hosts", "etc/hostname", "etc/nsswitch.conf", "etc/shells", "etc/profile"],
10 #:source, ["hosts", "hostname", "nsswitch.conf", "shells", "profile"],
11 #:sha256sums, ["b69b2c741be48691edabe3771c644c70473ccd6aa8effd9f17cc07fa129917f9",
12 "251a9fbf3ef48f76ea758f161e04f8e2ffc27d712bd4993a4763e53163dbd0f4",
13 "2ad90a00ddc40e2931e9da1b7c943a5d40d15039436ea2e20442d47c0916959e",
14 "7da658925aa565924877b098d2d61eba65190943266973a37182fc96b8f89cdb",
15 "1ecc0432bad0127ea5747b9741c5706427b71536fd7ac4426b4a59b532753835"],
16 #:check, fn() {
17 run("sh", "-n", "profile")
18 run("grep", "-Fx", "/bin/sh", "shells")
19 run("grep", "-Fx", "hosts: files dns", "nsswitch.conf")
20 },
21 #:package, fn() {
22 for-each(fn(dir) {
23 run("install", "-d", "-m755", string-append(pkgdir(), "/", dir))
24 }, list("bin", "sbin", "dev", "dev/pts", "dev/shm", "proc", "sys", "home", "etc/profile.d",
25 "etc/sysctl.d", "run/lock", "mnt", "media", "opt", "srv", "lib", "usr/bin", "usr/lib",
26 "usr/sbin", "usr/share", "usr/local/bin", "usr/local/lib", "usr/local/sbin", "usr/local/share",
27 "var/cache", "var/lib", "var/log", "var/spool"))
28 run("install", "-d", "-m700", string-append(pkgdir(), "/root"))
29 run("install", "-d", "-m1777", string-append(pkgdir(), "/tmp"), string-append(pkgdir(), "/var/tmp"))
30 for-each(fn(file) {
31 run("install", "-Dm644", file, string-append(pkgdir(), "/etc/", file))
32 }, list("hosts", "hostname", "nsswitch.conf", "shells", "profile"))
33 run("ln", "-s", "../run", string-append(pkgdir(), "/var/run"))
34 run("ln", "-s", "../run/lock", string-append(pkgdir(), "/var/lock"))
35 run("ln", "-s", "/proc/mounts", string-append(pkgdir(), "/etc/mtab"))
36 })
37