gegl: Update from 0.3.30 to 0.3.32
[termux-packages] / packages / openssh / build.sh
CommitLineData
cff3a76b 1TERMUX_PKG_HOMEPAGE=https://www.openssh.com/
59f0d218 2TERMUX_PKG_DESCRIPTION="Secure shell for logging into a remote machine"
1ff10e5c
FF
3TERMUX_PKG_VERSION=7.7p1
4TERMUX_PKG_SHA256=d73be7e684e99efcd024be15a30bffcbe41b012b2f7b3c9084aed621775e6b8f
bbfa4e7a 5TERMUX_PKG_SRCURL=https://fastly.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${TERMUX_PKG_VERSION}.tar.gz
1ee955a1 6TERMUX_PKG_DEPENDS="libandroid-support, ldns, openssl, libedit, libutil"
59f0d218 7# --disable-strip to prevent host "install" command to use "-s", which won't work for target binaries:
cff3a76b
FF
8TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
9--disable-etc-default-login
10--disable-lastlog
11--disable-libutil
12--disable-pututline
13--disable-pututxline
14--disable-strip
15--disable-utmp
16--disable-utmpx
17--disable-wtmp
18--disable-wtmpx
19--sysconfdir=$TERMUX_PREFIX/etc/ssh
20--with-cflags=-Dfd_mask=int
21--with-ldns
1ee955a1 22--with-libedit
da5a3586 23--with-mantype=man
cff3a76b
FF
24--without-ssh1
25--without-stackprotect
26--with-pid-dir=$TERMUX_PREFIX/var/run
27--with-privsep-path=$TERMUX_PREFIX/var/empty
7504becc 28--with-xauth=$TERMUX_PREFIX/bin/xauth
cff3a76b
FF
29ac_cv_func_endgrent=yes
30ac_cv_func_fmt_scaled=no
31ac_cv_func_getlastlogxbyname=no
32ac_cv_func_readpassphrase=no
33ac_cv_func_strnvis=no
34ac_cv_header_sys_un_h=yes
35ac_cv_search_getrrsetbyname=no
1ff10e5c 36ac_cv_func_bzero=yes
cff3a76b 37"
59f0d218
FF
38TERMUX_PKG_MAKE_INSTALL_TARGET="install-nokeys"
39TERMUX_PKG_RM_AFTER_INSTALL="bin/slogin share/man/man1/slogin.1"
40
7ce56385 41termux_step_pre_configure() {
cff3a76b
FF
42 autoreconf
43
7504becc
LP
44 ## Configure script require this variable to set
45 ## prefixed path to program 'passwd'
46 export PATH_PASSWD_PROG="${TERMUX_PREFIX}/bin/passwd"
47
c7ce60b7 48 CPPFLAGS+=" -DHAVE_ATTRIBUTE__SENTINEL__=1"
7ce56385
FF
49 LD=$CC # Needed to link the binaries
50 LDFLAGS+=" -llog" # liblog for android logging in syslog hack
51}
59f0d218 52
7b1f1bd3 53termux_step_post_configure() {
59f0d218
FF
54 # We need to remove this file before installing, since otherwise the
55 # install leaves it alone which means no updated timestamps.
56 rm -Rf $TERMUX_PREFIX/etc/moduli
57}
58
59termux_step_post_make_install () {
8773737e 60 # "PrintMotd no" is due to our login program already showing it.
62c37b97 61 # OpenSSH 7.0 disabled ssh-dss by default, keep it for a while in Termux:
8773737e
FF
62 echo -e "PrintMotd no\nPasswordAuthentication no\nPubkeyAcceptedKeyTypes +ssh-dss\nSubsystem sftp $TERMUX_PREFIX/libexec/sftp-server" > $TERMUX_PREFIX/etc/ssh/sshd_config
63 echo "PubkeyAcceptedKeyTypes +ssh-dss" > $TERMUX_PREFIX/etc/ssh/ssh_config
59f0d218
FF
64 cp $TERMUX_PKG_BUILDER_DIR/source-ssh-agent.sh $TERMUX_PREFIX/bin/source-ssh-agent
65 cp $TERMUX_PKG_BUILDER_DIR/ssh-with-agent.sh $TERMUX_PREFIX/bin/ssha
66
b0c457ae
FF
67 # Install ssh-copy-id:
68 cp $TERMUX_PKG_SRCDIR/contrib/ssh-copy-id.1 $TERMUX_PREFIX/share/man/man1/
69 cp $TERMUX_PKG_SRCDIR/contrib/ssh-copy-id $TERMUX_PREFIX/bin/
70 chmod +x $TERMUX_PREFIX/bin/ssh-copy-id
71
59f0d218
FF
72 mkdir -p $TERMUX_PREFIX/var/run
73 echo "OpenSSH needs this folder to put sshd.pid in" >> $TERMUX_PREFIX/var/run/README.openssh
74
75 mkdir -p $TERMUX_PREFIX/etc/ssh/
76 cp $TERMUX_PKG_SRCDIR/moduli $TERMUX_PREFIX/etc/ssh/moduli
77}
78
87566986
FF
79termux_step_post_massage () {
80 # Verify that we have man pages packaged (#1538).
81 local manpage
82 for manpage in ssh-keyscan.1 ssh-add.1 scp.1 ssh-agent.1 ssh.1; do
83 if [ ! -f share/man/man1/$manpage ]; then
84 termux_error_exit "Missing man page $manpage"
85 fi
86 done
87}
88
59f0d218 89termux_step_create_debscripts () {
aa605e89 90 echo "#!$TERMUX_PREFIX/bin/sh" > postinst
91 echo "mkdir -p \$HOME/.ssh" >> postinst
d8425dcd 92 echo "touch \$HOME/.ssh/authorized_keys" >> postinst
93 echo "chmod 700 \$HOME/.ssh" >> postinst
94 echo "chmod 600 \$HOME/.ssh/authorized_keys" >> postinst
59f0d218
FF
95 echo "" >> postinst
96 echo "for a in rsa dsa ecdsa ed25519; do" >> postinst
97 echo " KEYFILE=$TERMUX_PREFIX/etc/ssh/ssh_host_\${a}_key" >> postinst
98 echo " test ! -f \$KEYFILE && ssh-keygen -N '' -t \$a -f \$KEYFILE" >> postinst
99 echo "done" >> postinst
100 echo "exit 0" >> postinst
101 chmod 0755 postinst
102}