vinix-ports / ports / vinix-filesystem / PKGBUILD.vile
48 lines · 48 sloc · 3.15 KB · c33d8afc2906b8dd9a8b905224eccd49a44f7ad5
Raw
1defpkgbuild(vinix-filesystem,
2 #:pkgname, "vinix-filesystem",
3 #:pkgver, "0.1.0",
4 #:pkgrel, 2,
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 "etc/crontabs/root", "etc/fstab", "etc/profile.d/20locale.sh", "etc/sysctl.conf"],
11 #:source, ["hosts", "hostname", "nsswitch.conf", "shells", "profile", "20locale.sh", "root.crontab", "fstab", "sysctl.conf"],
12 #:sha256sums, ["b69b2c741be48691edabe3771c644c70473ccd6aa8effd9f17cc07fa129917f9",
13 "251a9fbf3ef48f76ea758f161e04f8e2ffc27d712bd4993a4763e53163dbd0f4",
14 "2ad90a00ddc40e2931e9da1b7c943a5d40d15039436ea2e20442d47c0916959e",
15 "7da658925aa565924877b098d2d61eba65190943266973a37182fc96b8f89cdb",
16 "1ecc0432bad0127ea5747b9741c5706427b71536fd7ac4426b4a59b532753835",
17 "73fa681126789a1c8e73f04b436b028b1940f32d85ba6a2ea36a9401bc43a87d",
18 "2a04bebac7881eb2d6c9627e028a6819480f308741107f6989a405b44c5adaa8",
19 "5fed085bb3a0938b04e8b53e4d92049153c42954f077b5ed3aadfc53a217eea6",
20 "3134041675887f0fe3493fde7820bb49382840223c6cb02dbd822f4accac371c"],
21 #:check, fn() {
22 run("sh", "-n", "profile")
23 run("sh", "-n", "20locale.sh")
24 run("grep", "-Fx", "/bin/sh", "shells")
25 run("grep", "-Fx", "hosts: files dns", "nsswitch.conf")
26 },
27 #:package, fn() {
28 for-each(fn(dir) {
29 run("install", "-d", "-m755", string-append(pkgdir(), "/", dir))
30 }, list("bin", "sbin", "dev", "dev/pts", "dev/shm", "proc", "sys", "home", "etc/profile.d",
31 "etc/sysctl.d", "etc/crontabs", "run/lock", "mnt", "media/cdrom", "media/usb", "opt", "srv", "lib", "usr/bin", "usr/lib",
32 "usr/sbin", "usr/share", "usr/local/bin", "usr/local/lib", "usr/local/sbin", "usr/local/share",
33 "var/cache", "var/lib", "var/log", "var/mail", "var/spool/cron"))
34 for-each(fn(period) { run("install", "-d", "-m755", string-append(pkgdir(), "/etc/periodic/", period)) },
35 list("15min", "hourly", "daily", "weekly", "monthly"))
36 run("install", "-d", "-m700", string-append(pkgdir(), "/root"))
37 run("install", "-d", "-m1777", string-append(pkgdir(), "/tmp"), string-append(pkgdir(), "/var/tmp"))
38 for-each(fn(file) {
39 run("install", "-Dm644", file, string-append(pkgdir(), "/etc/", file))
40 }, list("hosts", "hostname", "nsswitch.conf", "shells", "profile", "fstab", "sysctl.conf"))
41 run("install", "-Dm644", "20locale.sh", string-append(pkgdir(), "/etc/profile.d/20locale.sh"))
42 run("install", "-Dm600", "root.crontab", string-append(pkgdir(), "/etc/crontabs/root"))
43 run("ln", "-s", "../mail", string-append(pkgdir(), "/var/spool/mail"))
44 run("ln", "-s", "../../../etc/crontabs", string-append(pkgdir(), "/var/spool/cron/crontabs"))
45 run("ln", "-s", "../run", string-append(pkgdir(), "/var/run"))
46 run("ln", "-s", "../run/lock", string-append(pkgdir(), "/var/lock"))
47 run("ln", "-s", "/proc/mounts", string-append(pkgdir(), "/etc/mtab"))
48 })
49