diff --git a/projects/openssh.com/package.yml b/projects/openssh.com/package.yml new file mode 100644 index 00000000..c021d6cb --- /dev/null +++ b/projects/openssh.com/package.yml @@ -0,0 +1,85 @@ +distributable: + url: https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-{{version.marketing}}p1.tar.gz + strip-components: 1 +versions: + url: https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ + match: /openssh-\d+\.\d+p1\.tar\.gz/ + strip: + - /^openssh-/ + - /p1\.tar\.gz/ +dependencies: + nlnetlabs.nl/ldns: '*' + developers.yubico.com/libfido2: '*' + openssl.org: '*' + kerberos.org: '*' + thrysoee.dk/editline: '*' + github.com/besser82/libxcrypt: '*' + zlib.net: '*' + linux: + linux-pam.org: '*' +build: + dependencies: + freedesktop.org/pkg-config: '*' + curl.se: '*' + darwin: + gnu.org/patch: '*' + linux: + gnu.org/gcc: '*' + gnu.org/make: '*' + script: + - run: | + curl -L "$PATCH1" | patch + curl -L "$PATCH2" | patch + if: darwin + - sed -i.bak "s|@PREFIX@/share/openssh|{{prefix}}/etc/ssh|g" sandbox-darwin.c + - rm -f sandbox-darwin.c.bak + - run: | + sed -i.bak "s|-fzero-call-used-regs=all|-fzero-call-used-regs=used|g" configure + rm -f configure.bak + if: darwin/x86-64 + - ./configure $CONFIGURE_ARGS + - run: | + sed -i.bak "s|prefix=/usr/local|prefix={{prefix}}|g" Makefile + rm -f Makefile.bak + if: linux + - make --jobs {{ hw.concurrency }} + - make --jobs 1 install + - run: ln -s ssh slogin + working-directory: "{{prefix}}/bin" + - run: curl -L "$RES_SSHD" -o org.openssh.sshd.sb + working-directory: "{{prefix}}/etc/ssh" + env: + PATCH1: https://raw.githubusercontent.com/Homebrew/patches/1860b0a745f1fe726900974845d1b0dd3c3398d6/openssh/patch-sandbox-darwin.c-apple-sandbox-named-external.diff + PATCH2: https://raw.githubusercontent.com/Homebrew/patches/d8b2d8c2612fd251ac6de17bf0cc5174c3aab94c/openssh/patch-sshd.c-apple-sandbox-named-external.diff + RES_SSHD: https://raw.githubusercontent.com/apple-oss-distributions/OpenSSH/OpenSSH-268.100.4/com.openssh.sshd.sb + CONFIGURE_ARGS: + - --disable-debug + - --disable-dependency-tracking + - --prefix="{{prefix}}" + - --libdir="{{prefix}}/lib" + - --sysconfdir={{prefix}}/etc/ssh + - --with-ldns + - --with-libedit + - --with-kerberos5 + - --with-pam + - --with-ssl-dir={{deps.openssl.org.prefix}} + - --with-security-key-builtin + linux: + CONFIGURE_ARGS: + --with-privsep-path={{prefix}}/var/lib/sshd + darwin: + CPPFLAGS: "$CPPFLAGS -D__APPLE_SANDBOX_NAMED_EXTERNAL__" +provides: + - bin/scp + - bin/sftp + - bin/slogin + - bin/ssh + - bin/ssh-add + - bin/ssh-agent + - bin/ssh-keygen + - bin/ssh-keyscan + - sbin/sshd +test: + script: + - which ssh | grep {{prefix}} + - ssh -V 2>&1| grep {{version.marketing}}