### this file is sourced not run
PKGVER=5.3.28 # I think this is the last non-Oracle version
PKGBUILD=1
PKGARCH=x86_64

# source: post BLFS 8.3 2018-10-16 (no change in BLFS 11.3)
TARBALL=berkeley-db-5.3.28.tar.gz
MD5SUM=b99454564d5b4479750567031d66fe24
SRC_URL=http://anduin.linuxfromscratch.org/BLFS/bdb/db-5.3.28.tar.gz
BUNDLE=

SLACKREQ=
SLACKDESC="libbdb: libbdb $PKGVER (Berkeley DB library)  
libbdb:  
libbdb: The Berkeley DB package contains programs and utilities used by many 
libbdb: other applications for database related functions.  
libbdb: 
libbdb: 
libbdb: 
libbdb: 
libbdb: 
libbdb: 
libbdb: 
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/db* &&

	# BLFS gcc 6.x/7.x patch
	sed -i 's/\(__atomic_compare_exchange\)/\1_db/' src/dbinc/atomic.h &&
	
	cd build_unix
	../dist/configure $CONFFLAGS      \
		--enable-compat185 \
		--enable-dbm       \
		--disable-static   \
		--enable-cxx       \
		--enable-tcl --with-tcl=/usr/$LIBDIR &&
		
	make $MAKEFLAGS &&
	
	make docdir=/usr/share/doc/db-$PKGVER install &&
	
	chown -v -R root:root                        \
      /usr/bin/db_*                          \
      /usr/include/db{,_185,_cxx}.h          \
      /usr/$LIBDIR/libdb*.{so,la}                \
      /usr/share/doc/db-$PKGVER &&
      
    # remove odd inclusion of libdbus here
    rm -rf /usr/$LIBDIR/libdbus* &&
	pkg_build_slackdesc
}


