vinix-ports / openssh-client / PKGBUILD.vile
44 lines · 44 sloc · 2.71 KB · 73ce2171ae35895d87442ccbc8f43104ce63a4fc
Raw
1defpkgbuild(openssh-client,
2 #:pkgname, "openssh-client",
3 #:pkgver, "9.9p2",
4 #:pkgrel, 1,
5 #:pkgdesc, "OpenSSH client, file transfer, key generation and authentication agent",
6 #:arch, [#:x86-64, #:aarch64],
7 #:license, "SSH-OpenSSH",
8 #:url, "https://www.openssh.com/portable.html",
9 #:depends, ["musl", "libedit", "openssl", "zlib"],
10 #:makedepends, ["linux-headers"],
11 #:backup, ["etc/ssh/ssh_config"],
12 #:source, ["https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.9p2.tar.gz",
13 "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/openssh/include-config-dir.patch"],
14 #:sha256sums, ["91aadb603e08cc285eddf965e1199d02585fa94d994d6cae5b41e1721e215673",
15 "d64820f473f3421922c0b4d88b067b2816cd22323af3157af503688e1003f8c1"],
16 #:prepare, fn() {
17 run("patch", "-d", "openssh-9.9p2", "-p1", "-i", string-append(srcdir(), "/include-config-dir.patch"))
18 },
19 #:build, fn() {
20 run("vinix-configure", "openssh-9.9p2/configure", "--sysconfdir=/etc/ssh", "--libexecdir=/usr/lib/ssh",
21 "--with-libedit", "--with-xauth=/usr/bin/xauth", "--with-pid-dir=/run",
22 "--disable-utmp", "--disable-wtmp", "--disable-lastlog")
23 run("make", "ssh", "scp", "sftp", "ssh-keygen", "ssh-agent", "ssh-add", "ssh-keyscan", "ssh-pkcs11-helper")
24 },
25 #:check, fn() {
26 run("vinix-run", "./ssh", "-V")
27 run("vinix-run", "./ssh", "-Q", "cipher")
28 run("vinix-run", "./ssh-keygen", "-q", "-t", "ed25519", "-N", "", "-f", "test-key")
29 run("vinix-run", "./ssh-keygen", "-lf", "test-key.pub")
30 run("vinix-run", "./ssh-keygen", "-Y", "sign", "-f", "test-key", "-n", "vinix", "openssh-9.9p2/LICENCE")
31 run("test", "-s", "openssh-9.9p2/LICENCE.sig")
32 },
33 #:package, fn() {
34 for-each(fn(tool) {
35 run("install", "-Dm755", tool, string-append(pkgdir(), "/usr/bin/", tool))
36 }, list("ssh", "scp", "sftp", "ssh-keygen", "ssh-agent", "ssh-add", "ssh-keyscan", "ssh-pkcs11-helper"))
37 run("mkdir", "-p", string-append(pkgdir(), "/usr/lib/ssh"), string-append(pkgdir(), "/etc/ssh/ssh_config.d"))
38 run("ln", "-s", "../../bin/ssh-pkcs11-helper", string-append(pkgdir(), "/usr/lib/ssh/ssh-pkcs11-helper"))
39 run("install", "-Dm755", "openssh-9.9p2/contrib/ssh-copy-id", string-append(pkgdir(), "/usr/bin/ssh-copy-id"))
40 run("install", "-Dm755", "openssh-9.9p2/contrib/findssl.sh", string-append(pkgdir(), "/usr/bin/findssl.sh"))
41 run("install", "-Dm644", "openssh-9.9p2/ssh_config", string-append(pkgdir(), "/etc/ssh/ssh_config"))
42 run("install", "-Dm644", "openssh-9.9p2/moduli", string-append(pkgdir(), "/etc/ssh/moduli"))
43 run("install", "-Dm644", "openssh-9.9p2/LICENCE", string-append(pkgdir(), "/usr/share/licenses/openssh-client/LICENCE"))
44 })
45