#Packager: George Vlahavas <gapan~at~salixos~dot~org>

pkgname=bitcoin
pkgver=28.1
pkgrel=1gv
source=("https://bitcoincore.org/bin/bitcoin-core-${pkgver}/bitcoin-${pkgver}.tar.gz" "bitcoin-qt.desktop" "icons.tar.gz")
docs=("readme" "install.md" "copying" "changelog" "authors" "news" "todo")
url=https://bitcoin.org
options=("nosrcpack")

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"bitcoin (P2P electronic cash system)"
"Bitcoin is a free open source peer-to-peer electronic cash system that"
"is completely decentralized, without the need for a central server or"
"trusted parties.  Users hold the crypto keys to their own money and"
"transact directly with each other, with the help of a P2P network to"
"check for double-spending."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	./autogen.sh
	./configure --prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--with-qrencode \
		--with-gui=qt5 \
		--disable-static \
		--disable-tests \
		--disable-gui-tests \
		--disable-bench \
		--build=$arch-slackware-linux
	BITCOIN_GENBUILD_NO_GIT=1 make -j $numjobs || return 1
	make install DESTDIR=$startdir/pkg

	mkdir -p $startdir/pkg/usr/share/applications
	cp $startdir/src/bitcoin-qt.desktop $startdir/pkg/usr/share/applications

	mkdir -p $startdir/pkg/usr/share/icons/hicolor/scalable/apps
	cp $startdir/src/bitcoin.svg $startdir/pkg/usr/share/icons/hicolor/scalable/apps/
	for i in 48 32 24 22 16; do
		mkdir -p $startdir/pkg/usr/share/icons/hicolor/${i}x${i}/apps
		cp $startdir/src/bitcoin-${i}.png $startdir/pkg/usr/share/icons/hicolor/${i}x${i}/apps/bitcoin.png
	done

	mkdir -p $startdir/pkg/usr/doc/$pkgname-$pkgver
	cp $startdir/src/$pkgname-$pkgver/share/examples/bitcoin.conf $startdir/pkg/usr/doc/$pkgname-$pkgver/
} 
