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

# source: JakeSFR
TARBALL=gocryptfs_v${PKGVER}_src-deps.tar.gz
MD5SUM=f6cc333a3a3b5d017de7bf0f7e97ecf2
SRC_URL=https://github.com/rfjakob/gocryptfs/releases/download/v${PKGVER}/$TARBALL
BUNDLE=

SLACKREQ='openssl'

SLACKDESC="gocryptfs: gocryptfs $PKGVER (Encrypted overlay filesystem)
gocryptfs: 
gocryptfs: gocryptfs is built on top the excellent go-fuse FUSE library.
gocryptfs: This project was inspired by EncFS and strives to fix its security
gocryptfs: issues while providing good performance.
gocryptfs: 
gocryptfs: https://nuetzlich.net/gocryptfs/
gocryptfs: https://github.com/rfjakob/gocryptfs
gocryptfs: 
gocryptfs: 
gocryptfs: 
"

### default pkg_download
### prepare
pkg_prepare() {
	if pkg_download; then
		echo extracting $TARBALL ...
		tar --exclude=tests -xf $SRC_DIR/$TARBALL -C tmp	# tests: Cannot open: File name too long
	else
		return 1
	fi
}
### package
pkg_package() {
	rm -r root # for whatever reason this gets touched by go, so remove it
}

### build
pkg_build() {
	. /etc/profile.d/golang.sh && # get path for our go compiler
	export GOPATH=/tmp/go &&      # don't clutter our home directory

	cd /tmp/gocryptfs* &&
	make build &&
	make install &&
	strip --strip-unneeded /usr/bin/gocryptfs{,-xray} &&
	pkg_build_slackdesc
}
