defpkgbuild(openssh-client, #:pkgname, "openssh-client", #:pkgver, "9.9p2", #:pkgrel, 1, #:pkgdesc, "OpenSSH client, file transfer, key generation and authentication agent", #:arch, [#:x86-64, #:aarch64], #:license, "SSH-OpenSSH", #:url, "https://www.openssh.com/portable.html", #:depends, ["musl", "libedit", "openssl", "zlib"], #:makedepends, ["linux-headers"], #:backup, ["etc/ssh/ssh_config"], #:source, ["https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.9p2.tar.gz", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/openssh/include-config-dir.patch"], #:sha256sums, ["91aadb603e08cc285eddf965e1199d02585fa94d994d6cae5b41e1721e215673", "d64820f473f3421922c0b4d88b067b2816cd22323af3157af503688e1003f8c1"], #:prepare, fn() { run("patch", "-d", "openssh-9.9p2", "-p1", "-i", string-append(srcdir(), "/include-config-dir.patch")) }, #:build, fn() { run("vinix-configure", "openssh-9.9p2/configure", "--sysconfdir=/etc/ssh", "--libexecdir=/usr/lib/ssh", "--with-libedit", "--with-xauth=/usr/bin/xauth", "--with-pid-dir=/run", "--disable-utmp", "--disable-wtmp", "--disable-lastlog") run("make", "ssh", "scp", "sftp", "ssh-keygen", "ssh-agent", "ssh-add", "ssh-keyscan", "ssh-pkcs11-helper") }, #:check, fn() { target := get-environment-variable("VPAC_TARGET_ARCH") arm := if string?(target) { string=?("aarch64", target) } else { false } ; The emulated musl process resolves its UID through /etc/passwd, which ; lacks the build worker's systemd-managed account. Give the check an ; existing account without changing the package or the worker's users. runner := if arm { list("fakeroot", "--", "vinix-run") } else { list("vinix-run") } apply(run, append(runner, list("./ssh", "-V"))) apply(run, append(runner, list("./ssh", "-Q", "cipher"))) apply(run, append(runner, list("./ssh-keygen", "-q", "-t", "ed25519", "-N", "", "-f", "test-key"))) apply(run, append(runner, list("./ssh-keygen", "-lf", "test-key.pub"))) apply(run, append(runner, list("./ssh-keygen", "-Y", "sign", "-f", "test-key", "-n", "vinix", "openssh-9.9p2/LICENCE"))) run("test", "-s", "openssh-9.9p2/LICENCE.sig") }, #:package, fn() { for-each(fn(tool) { run("install", "-Dm755", tool, string-append(pkgdir(), "/usr/bin/", tool)) }, list("ssh", "scp", "sftp", "ssh-keygen", "ssh-agent", "ssh-add", "ssh-keyscan", "ssh-pkcs11-helper")) run("mkdir", "-p", string-append(pkgdir(), "/usr/lib/ssh"), string-append(pkgdir(), "/etc/ssh/ssh_config.d")) run("ln", "-s", "../../bin/ssh-pkcs11-helper", string-append(pkgdir(), "/usr/lib/ssh/ssh-pkcs11-helper")) run("install", "-Dm755", "openssh-9.9p2/contrib/ssh-copy-id", string-append(pkgdir(), "/usr/bin/ssh-copy-id")) run("install", "-Dm755", "openssh-9.9p2/contrib/findssl.sh", string-append(pkgdir(), "/usr/bin/findssl.sh")) run("install", "-Dm644", "openssh-9.9p2/ssh_config", string-append(pkgdir(), "/etc/ssh/ssh_config")) run("install", "-Dm644", "openssh-9.9p2/moduli", string-append(pkgdir(), "/etc/ssh/moduli")) run("install", "-Dm644", "openssh-9.9p2/LICENCE", string-append(pkgdir(), "/usr/share/licenses/openssh-client/LICENCE")) })