vinix-ports / vinix-accounts / PKGBUILD.vile
26 lines · 26 sloc · 1.36 KB · 7dafff80bc0c1f931106d3b2a5d7d5cc1004e517
Raw
1defpkgbuild(vinix-accounts,
2 #:pkgname, "vinix-accounts",
3 #:pkgver, "0.1.0",
4 #:pkgrel, 1,
5 #:pkgdesc, "Initial account databases from the Vinix account service",
6 #:arch, [#:any],
7 #:url, "https://github.com/vlang/vinix",
8 #:license, "GPL-2.0-or-later",
9 #:backup, ["etc/passwd", "etc/group", "etc/shadow"],
10 #:source, ["https://raw.githubusercontent.com/vlang/vinix/a58255423edea821aef9b2a0d10cb4091d59355a/tools/accounts/defaults/passwd",
11 "https://raw.githubusercontent.com/vlang/vinix/a58255423edea821aef9b2a0d10cb4091d59355a/tools/accounts/defaults/group",
12 "https://raw.githubusercontent.com/vlang/vinix/a58255423edea821aef9b2a0d10cb4091d59355a/tools/accounts/defaults/shadow"],
13 #:sha256sums, ["79492b90d473e2387338ef1518dfbceb9e3392ae5740235a6696621e42218efa",
14 "7a696fcfba89a55a6d73fa1a03c7f071fad2141340027b17a25db249e26b9be8",
15 "5dffe858d3df0b14106a1bae99da509d4820468fcbb134044627fced7c2534e7"],
16 #:check, fn() {
17 run("grep", "-Fx", "root:x:0:0:root:/root:/bin/sh", "passwd")
18 run("grep", "-Fx", "root:x:0:", "group")
19 run("grep", "-Eq", "^root:[!*]", "shadow")
20 },
21 #:package, fn() {
22 for-each(fn(file) {
23 run("install", "-Dm644", file, string-append(pkgdir(), "/etc/", file))
24 }, list("passwd", "group"))
25 run("install", "-Dm600", "shadow", string-append(pkgdir(), "/etc/shadow"))
26 })
27