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

# source: james
TARBALL=dropbear-$PKGVER.tar.bz2
MD5SUM=c3912f7fcdcc57c99937e4a79480d2c2
SRC_URL=https://matt.ucc.asn.au/dropbear/releases/$TARBALL
BUNDLE=

SLACKREQ= # musl-libc build-time
SLACKDESC="dropbear-static: dropbear-static $PKGVER (Small SSH Server)
dropbear-static: 
dropbear-static: Dropbear is a relatively small SSH server and client.
dropbear-static: This package contains a statically linked binary build with
dropbear-static: musl-gcc. It is built as a single multi-binary.
dropbear-static: It is meant to be used in initrd
dropbear-static: 
dropbear-static: https://matt.ucc.asn.au/dropbear/dropbear.html
dropbear-static: 
dropbear-static: 
dropbear-static: 
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	export CC="musl-gcc"
	export PKG_CONFIG_PATH=/tmp/static/lib/pkgconfig/
	
	cd /tmp/dropbear* &&
	./configure $CONFFLAGS --enable-static --disable-zlib --enable-bundled-libtom &&
	make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp scp-progress" MULTI=1 &&
	
	# install binaries
	install -m755 dropbearmulti /usr/sbin/dropbear &&
	ln -sfv ../sbin/dropbear /usr/bin/dbclient &&
	ln -sfv ../sbin/dropbear /usr/bin/dropbearkey &&
	ln -sfv ../sbin/dropbear /usr/bin/dropbearconvert &&
	ln -sfv ../sbin/dropbear /usr/bin/scp &&	

	# install docs
	mkdir -p /usr/share/man/man{1,8} &&
	install -m644 dropbear.8 /usr/share/man/man8 &&
	install -m644 dbclient.1 /usr/share/man/man1 &&
	install -m644 dropbearkey.1 /usr/share/man/man1 &&
	install -m644 dropbearconvert.1 /usr/share/man/man1 &&
	
	pkg_build_slackdesc
}


