vinix-ports / ports / vinix-release / PKGBUILD.vile
38 lines · 38 sloc · 1.87 KB · c33d8afc2906b8dd9a8b905224eccd49a44f7ad5
Raw
1; Use the identity generator from the Vinix release checkout.
2defpkgbuild(vinix-release,
3 #:pkgname, "vinix-release",
4 #:pkgver, "0.1.0",
5 #:pkgrel, 1,
6 #:pkgdesc, "Vinix operating system identification and login banners",
7 #:arch, [#:any],
8 #:url, "https://github.com/vlang/vinix",
9 #:license, "GPL-2.0-or-later",
10 #:depends, ["busybox"],
11 #:source, ["https://raw.githubusercontent.com/vlang/vinix/a58255423edea821aef9b2a0d10cb4091d59355a/build-support/identitycore/core.v",
12 "https://raw.githubusercontent.com/vlang/vinix/a58255423edea821aef9b2a0d10cb4091d59355a/build-support/stage-identity.v",
13 "https://raw.githubusercontent.com/vlang/vinix/a58255423edea821aef9b2a0d10cb4091d59355a/build-support/uname"],
14 #:sha256sums, ["286d89c66615cc3d67eda836f4fd468d9425fda201f2fa6ddc0f84d07d0b877a",
15 "fdec51d3df1da79c92b80d67d007f184db14c52050c12711730a8e912eb3a30b",
16 "3dc823187cbee58f337ad6bca9f802a23ee00b94be035f911140701bd5ea1bd0"],
17 #:prepare, fn() {
18 run("mkdir", "identitycore")
19 run("mv", "core.v", "identitycore/core.v")
20 },
21 #:build, fn() {
22 run("v", "-path", ".|@vlib|@vmodules", "-o", "stage-identity", "stage-identity.v")
23 run("mkdir", "identity")
24 run("./stage-identity", "identity")
25 },
26 #:check, fn() {
27 run("grep", "-Fx", "ID=vinix", "identity/usr/lib/os-release")
28 run("cmp", "identity/etc/os-release", "identity/usr/lib/os-release")
29 run("grep", "-Fx", "DISTRIB_ID=Vinix", "identity/etc/lsb-release")
30 run("test", "-s", "identity/etc/issue")
31 run("test", "-s", "identity/etc/motd")
32 },
33 #:package, fn() {
34 run("cp", "-a", "identity/etc", string-append(pkgdir(), "/etc"))
35 run("cp", "-a", "identity/usr", string-append(pkgdir(), "/usr"))
36 ; The relative /usr/bin/uname link resolves to the applet owned by BusyBox.
37 ; Release assembly writes the image-specific /etc/vinix-release tag.
38 })
39