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

# source: james
TARBALL=squashfs-tools-2018.05.tar.bz2
MD5SUM=ddb69ff4e83932a527f7e5b69ef3c6f2
#SRC_URL=http://downloads.sourceforge.net/squashfs/$TARBALL
SRC_URL=http://distro.ibiblio.org/fatdog/source/800/$TARBALL
BUNDLE=

SLACKREQ=xz
SLACKDESC="squashfs-tools: squashfs-tools $PKGVER (SquashFS utilities)  
squashfs-tools:  
squashfs-tools: Squashfs is a compressed read-only filesystem for Linux. 
squashfs-tools: Squashfs is intended for general read-only filesystem use, for 
squashfs-tools: archival use (i.e. in cases where a .tar.gz file may be used), 
squashfs-tools: and in constrained block device/memory systems (e.g. embedded 
squashfs-tools: systems) where low overhead is needed. This package provides 
squashfs-tools: utilites to create, view and unpack files from SquashFS 
squashfs-tools: filesystems.  
squashfs-tools: 
squashfs-tools: https://github.com/plougher/squashfs-tools/
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/squashfs* &&
	patch -Np1 -i ../pkg/static-inline.patch
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/squashfs*/squashfs* &&

	# note: the latest supports zstd as well but who cares
	make $MAKEFLAGS XZ_SUPPORT=1 LZO_SUPPORT=1 LZ4_SUPPORT=1 LZMA_XZ_SUPPORT=1 &&
	make install INSTALL_DIR=/usr/bin &&

	# docs
	cd .. &&
	mkdir -p /usr/share/doc/squashfs-$PKGVER &&
	install -m644 RELEASE-READMEs/pseudo-file.example RELEASE-README \
		/usr/share/doc/squashfs-$PKGVER &&

	pkg_build_slackdesc
}


