Commit | Line | Data |
---|---|---|
cff3a76b | 1 | TERMUX_PKG_HOMEPAGE=https://www.openssh.com/ |
59f0d218 | 2 | TERMUX_PKG_DESCRIPTION="Secure shell for logging into a remote machine" |
cff3a76b | 3 | TERMUX_PKG_VERSION=7.5p1 |
68db79da | 4 | TERMUX_PKG_REVISION=4 |
a8b61adf | 5 | TERMUX_PKG_SRCURL=http://mirrors.evowise.com/pub/OpenBSD/OpenSSH/portable/openssh-${TERMUX_PKG_VERSION}.tar.gz |
cff3a76b | 6 | TERMUX_PKG_SHA256=9846e3c5fab9f0547400b4d2c017992f914222b3fd1f8eee6c7dc6bc5e59f9f0 |
1ee955a1 | 7 | TERMUX_PKG_DEPENDS="libandroid-support, ldns, openssl, libedit, libutil" |
59f0d218 | 8 | # --disable-strip to prevent host "install" command to use "-s", which won't work for target binaries: |
cff3a76b FF |
9 | TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" |
10 | --disable-etc-default-login | |
11 | --disable-lastlog | |
12 | --disable-libutil | |
13 | --disable-pututline | |
14 | --disable-pututxline | |
15 | --disable-strip | |
16 | --disable-utmp | |
17 | --disable-utmpx | |
18 | --disable-wtmp | |
19 | --disable-wtmpx | |
20 | --sysconfdir=$TERMUX_PREFIX/etc/ssh | |
21 | --with-cflags=-Dfd_mask=int | |
22 | --with-ldns | |
1ee955a1 | 23 | --with-libedit |
cff3a76b FF |
24 | --without-ssh1 |
25 | --without-stackprotect | |
26 | --with-pid-dir=$TERMUX_PREFIX/var/run | |
27 | --with-privsep-path=$TERMUX_PREFIX/var/empty | |
28 | ac_cv_func_endgrent=yes | |
29 | ac_cv_func_fmt_scaled=no | |
30 | ac_cv_func_getlastlogxbyname=no | |
31 | ac_cv_func_readpassphrase=no | |
32 | ac_cv_func_strnvis=no | |
33 | ac_cv_header_sys_un_h=yes | |
34 | ac_cv_search_getrrsetbyname=no | |
35 | " | |
59f0d218 FF |
36 | TERMUX_PKG_MAKE_INSTALL_TARGET="install-nokeys" |
37 | TERMUX_PKG_RM_AFTER_INSTALL="bin/slogin share/man/man1/slogin.1" | |
38 | ||
7ce56385 | 39 | termux_step_pre_configure() { |
cff3a76b FF |
40 | autoreconf |
41 | ||
c7ce60b7 | 42 | CPPFLAGS+=" -DHAVE_ATTRIBUTE__SENTINEL__=1" |
7ce56385 FF |
43 | LD=$CC # Needed to link the binaries |
44 | LDFLAGS+=" -llog" # liblog for android logging in syslog hack | |
45 | } | |
59f0d218 | 46 | |
7b1f1bd3 | 47 | termux_step_post_configure() { |
59f0d218 FF |
48 | # We need to remove this file before installing, since otherwise the |
49 | # install leaves it alone which means no updated timestamps. | |
50 | rm -Rf $TERMUX_PREFIX/etc/moduli | |
51 | } | |
52 | ||
53 | termux_step_post_make_install () { | |
62c37b97 | 54 | # OpenSSH 7.0 disabled ssh-dss by default, keep it for a while in Termux: |
b79434aa | 55 | echo -e "PasswordAuthentication no\nPubkeyAcceptedKeyTypes +ssh-dss\nSubsystem sftp $TERMUX_PREFIX/libexec/sftp-server" > $TERMUX_PREFIX/etc/ssh/sshd_config |
62c37b97 | 56 | echo "PubkeyAcceptedKeyTypes +ssh-dss" > $TERMUX_PREFIX/etc/ssh/ssh_config |
59f0d218 FF |
57 | cp $TERMUX_PKG_BUILDER_DIR/source-ssh-agent.sh $TERMUX_PREFIX/bin/source-ssh-agent |
58 | cp $TERMUX_PKG_BUILDER_DIR/ssh-with-agent.sh $TERMUX_PREFIX/bin/ssha | |
59 | ||
b0c457ae FF |
60 | # Install ssh-copy-id: |
61 | cp $TERMUX_PKG_SRCDIR/contrib/ssh-copy-id.1 $TERMUX_PREFIX/share/man/man1/ | |
62 | cp $TERMUX_PKG_SRCDIR/contrib/ssh-copy-id $TERMUX_PREFIX/bin/ | |
63 | chmod +x $TERMUX_PREFIX/bin/ssh-copy-id | |
64 | ||
59f0d218 FF |
65 | mkdir -p $TERMUX_PREFIX/var/run |
66 | echo "OpenSSH needs this folder to put sshd.pid in" >> $TERMUX_PREFIX/var/run/README.openssh | |
67 | ||
68 | mkdir -p $TERMUX_PREFIX/etc/ssh/ | |
69 | cp $TERMUX_PKG_SRCDIR/moduli $TERMUX_PREFIX/etc/ssh/moduli | |
70 | } | |
71 | ||
72 | termux_step_create_debscripts () { | |
aa605e89 | 73 | echo "#!$TERMUX_PREFIX/bin/sh" > postinst |
74 | echo "mkdir -p \$HOME/.ssh" >> postinst | |
d8425dcd | 75 | echo "touch \$HOME/.ssh/authorized_keys" >> postinst |
76 | echo "chmod 700 \$HOME/.ssh" >> postinst | |
77 | echo "chmod 600 \$HOME/.ssh/authorized_keys" >> postinst | |
59f0d218 FF |
78 | echo "" >> postinst |
79 | echo "for a in rsa dsa ecdsa ed25519; do" >> postinst | |
80 | echo " KEYFILE=$TERMUX_PREFIX/etc/ssh/ssh_host_\${a}_key" >> postinst | |
81 | echo " test ! -f \$KEYFILE && ssh-keygen -N '' -t \$a -f \$KEYFILE" >> postinst | |
82 | echo "done" >> postinst | |
83 | echo "exit 0" >> postinst | |
84 | chmod 0755 postinst | |
85 | } |