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

# source: james
# release tarball
PKGVER=3.24
TARBALL=nbd-$PKGVER.tar.xz
MD5SUM=a6d9e7bbc311a2ed07ef84a58b82b5dd
SRC_URL=https://github.com/NetworkBlockDevice/nbd/releases/download/nbd-$PKGVER/$TARBALL
#BUNDLE=

# git-master tarball - too hard, obscure messages missing m4 autoconf macro ... 
#PKGVER=3.24.2023.04 # release is one year behind
#MD5SUM=67ef76df7b1b4a56619f0eb08db85923
#hash=fd2c5a60e36ef0ea0d7fd6f8a6bd908d24d5801d
#hash7=${hash#???????}; hash7=${hash%$hash7}
#TARBALL=nbd-$PKGVER-$hash7.tar.gz
#SRC_URL=https://github.com/NetworkBlockDevice/nbd/archive/$hash.tar.gz

SLACKREQ=glib
SLACKDESC="nbd: nbd $PKGVER (Linux Network Block Device (nbd) utilities)
nbd: 
nbd: Tools for the Linux Kernel network block device (nbd), allowing you 
nbd: to use remote block devices over a TCP/IP network.
nbd: 
nbd: Why do we keep using 3.9.1? This is the last version that still
nbd: supports the oldstyle protocol (required by qemu and a lot of 
nbd: other software).
nbd: 
nbd: http://sourceforge.net/projects/nbd/
nbd: https://github.com/yoe/nbd
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	CONFFLAGS="$CONFFLAGS --enable-gznbd --enable-syslog"
	cd /tmp/nbd* &&

	# if building from git checkout - this actually works
	#sed -i -e 's%-//OASIS//DTD DocBook V4.1//EN%-//OASIS//DTD DocBook V3.1//EN%' \
	#	-e 's%-//OASIS//DTD DocBook V4.5//EN%-//OASIS//DTD DocBook V3.1//EN%' \
	#	man/*sgml &&
	#./autogen.sh &&
	
	pkg_build_autoconf &&
	install -dm755 /usr/share/doc/nbd-$PKGVER &&
	install -m644 doc/{proto,uri}.md README.md /usr/share/doc/nbd-$PKGVER &&
	pkg_build_slackdesc
}


