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

# source: BLFS 11.3
TARBALL=gnupg-$PKGVER.tar.bz2
MD5SUM=1a9dd55be7a9d0a6ef34ec3ba0d674a5
SRC_URL=https://www.gnupg.org/ftp/gcrypt/gnupg/$TARBALL
BUNDLE=

SLACKREQ='libassuan libgcrypt libksba curl libnpth libusb curl libgnutls'
SLACKDESC="gnupg2: gnupg2 $PKGVER (GNU Privacy Guard version 2)  
gnupg2:  
gnupg2: GnuPG is the GNU project's complete and free implementation of the 
gnupg2: OpenPGP standard as defined by RFC4880. GnuPG allows to encrypt and 
gnupg2: sign your data and communication, features a versatile key management 
gnupg2: system as well as access modules for all kinds of public key 
gnupg2: directories. GnuPG, also known as GPG, is a command line tool with 
gnupg2: features for easy integration with other applications. A wealth of 
gnupg2: frontend applications and libraries are available. This is version 2 
gnupg2: of GnuPG, it supports S/MIME. It can be installed together with   
gnupg2: gnupg1.
"
SLACKSUG='pinentry-curses pinentry-gui pinentry-xlib'

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	CONFFLAGS="$CONFFLAGS \
		--docdir=/usr/share/doc/gnupg-$PKGVER \
		--enable-g13         \
		--enable-gpgtar      \
	" &&
	# --enable-gpg-is-gpg2 # this makes the binary called as gpg2, for compatility
	# with gnupg1. But we don't build gnupg1 anymore.

	cd /tmp/gnupg* &&
	mkdir build && cd build &&
	../configure $CONFFLAGS &&
	make $MAKEFlAGS &&

	# docs
	makeinfo --html --no-split -I doc -o doc/gnupg_nochunks.html ../doc/gnupg.texi &&
	makeinfo --plaintext       -I doc -o doc/gnupg.txt           ../doc/gnupg.texi &&
	make -C doc html &&
	make $MAKEINSTALLFLAGS install &&
	
	install -v -m755 -d /usr/share/doc/gnupg-$PKGVER/html            &&
	install -v -m644    doc/gnupg_nochunks.html \
						/usr/share/doc/gnupg-$PKGVER/html/gnupg.html &&
	install -v -m644    ../doc/*.texi doc/gnupg.txt \
						/usr/share/doc/gnupg-$PKGVER &&
	install -v -m644    doc/gnupg.html/* \
						/usr/share/doc/gnupg-$PKGVER/html &&
						
	pkg_build_slackdesc
}


