Advertisement
devinteske

ssh-agent-sierra-build.sh

Sep 7th, 2017
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.04 KB | None | 0 0
  1. #!/bin/sh
  2. set -x
  3. realpath() { perl -le 'use Cwd; print Cwd::abs_path(@ARGV)' -- "$@"; }
  4. progdir=$( realpath "${0%/*}" )
  5. APPLE="https://opensource.apple.com/tarballs"
  6. OPENSSL="/usr/local/Cellar/openssl/1.0.2l"
  7. OPENSSH="OpenSSH-209.50.1"
  8. OPENSSH_PATCH="$progdir/ssh-agent-sierra-patch.txt"
  9. OPENSSH_PATCH_URL="https://pastebin.com/raw/32f0Mape"
  10. SECURITY="Security-57740.60.18"
  11. set -e
  12. if [ ! -e "$OPENSSH" ]; then
  13.         [ -e "$OPENSSH.tar.gz" ] || curl -LO $APPLE/OpenSSH/$OPENSSH.tar.gz
  14.         tar zxf "$OPENSSH.tar.gz"
  15. fi
  16. [ -e "$OPENSSL" ] || brew install openssl
  17. CFLAGS="$CFLAGS -I$OPENSSL/include"
  18. LDFLAGS="-L$OPENSSL/lib"
  19. if [ ! -e "$SECURITY" ]; then
  20.         [ -e "$SECURITY.tar.gz" ] || curl -LO $APPLE/Security/$SECURITY.tar.gz
  21.         tar zxf "$SECURITY.tar.gz"
  22. fi
  23. CFLAGS="$CFLAGS -I$progdir/$SECURITY/header_symlinks"
  24. [ -e "$OPENSSH_PATCH" ] || curl -L "$OPENSSH_PATCH_URL" -o "$OPENSSH_PATCH"
  25. cd "$OPENSSH/openssh"
  26. patch -N < "$OPENSSH_PATCH"
  27. export CFLAGS LDFLAGS
  28. ./configure --with-pam --with-audit=bsm
  29. make
  30. echo SUCCESS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement