### this file is sourced not run
PKGVER=8.8p1
PKGBUILD=1
PKGARCH=x86_64

# source: pre BLFS 8.3 2018-08-26 updated to latest
TARBALL=openssh-$PKGVER.tar.gz
MD5SUM=8ce5f390958baeeab635aafd0ef41453
SRC_URL=http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$TARBALL
BUNDLE=

SLACKREQ='openssl libncurses'
SLACKDESC="openssh: openssh $PKGVER (SSH client and server)  
openssh:  
openssh: The OpenSSH package contains ssh clients and the sshd daemon. This is 
openssh: useful for encrypting authentication and subsequent traffic over a 
openssh: network. The ssh and scp commands are secure implementions of telnet 
openssh: and rcp respectively.  
openssh: 
openssh: 
openssh: 
openssh: 
openssh: 
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/openssh*/ &&

	# re-enable ssh-rsa for KEX and CA signature for servers running ancient openssh
	patch -Rp1 -i /tmp/pkg/openssh-8.8p1-disable-ssh-rsa.patch &&      # removed in 8.8
	patch -Np1 -i /tmp/pkg/openssh-8.8p1-re-enable-ssh-rsa-ca.patch && # removed in 8.2

	CONFFLAGS="$CONFFLAGS \
            --sysconfdir=/etc/ssh             \
            --datadir=/usr/share/sshd         \
            --with-md5-passwords              \
            --with-privsep-path=/var/lib/sshd \
            --with-pid-dir=/var/run \
            --with-xauth=/usr/bin/xauth" &&
	pkg_build_autoconf &&
	
	install -v -m755 contrib/ssh-copy-id /usr/bin &&
	install -v -m644 contrib/ssh-copy-id.1 /usr/share/man/man1 &&
	install -v -m755 -d /usr/share/doc/openssh-$PKGVER &&
	install -v -m644 INSTALL LICENCE OVERVIEW README* \
		/usr/share/doc/openssh-$PKGVER &&
		
	install -d /var/run/sshd &&
	install -d m700 /var/lib/sshd &&
	install -v -m700 -d /var/lib/sshd &&
	
	# startup script
	mkdir -p /etc/init.d &&
	install -m644 /tmp/pkg/65-sshd /etc/init.d &&
	pkg_build_slackdesc
}


