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

# source: james
TARBALL=zstd-$PKGVER.tar.gz
MD5SUM=2352b1f9ccc7446641046bb3d440c3ed
BUNDLE=fatdog-base-11.3.tar
SRC_URL=http://distro.ibiblio.org/fatdog/source/900/$BUNDLE
#SRC_URL=https://github.com/facebook/zstd/archive/v$PKGVER.tar.gz

SLACKREQ=
SLACKDESC="zstd: zstd $PKGVER (Compression tool and library)
zstd: 
zstd: Zstandard, or zstd as short version, is a fast lossless compression 
zstd: algorithm, targeting real-time compression scenarios at zlib-level 
zstd: and better compression ratios. It's backed by a very fast entropy 
zstd: stage, provided by Huff0 and FSE library.
zstd: 
zstd: https://github.com/facebook/zstd
zstd: 
zstd: 
zstd: 
"

### override download for LFS sources
# $1-src-dir $2-tarball 
pkg_download() {
	echo downloading $BUNDLE for $TARBALL
	wget -P $1 $SRC_URL
	tar -xf $1/$BUNDLE --strip-components=1 -C $1 
	rm $1/$BUNDLE
}

### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/zstd* &&

	# upstream patch
	# patch -Np1 -i $SRC_DIR/zstd-1.5.2-upstream_fixes-1.patch &&

	true
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/zstd*
	MAKEFLAGS="$MAKEFLAGS prefix=/usr libdir=/usr/$LIBDIR"
	make $MAKEFLAGS && make $MAKEFLAGS install &&
	pkg_build_slackdesc
}


