#Packager: Dimitris Tzemos <djemos~AT~slackel.gr>

pkgname=sqlite
pkgver=3.13.0
pkgrel=1dj
_srcver=3130000
source=("http://www.sqlite.org/2016/sqlite-src-${_srcver}.zip")
docs=("README")
url='http://www.sqlite.org/'

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"sqlite (a small zero-configuration SQL database engine)"
"SQLite is a C library that implements an SQL database engine."
"A large subset of SQL92 is supported. A complete database is stored"
"in a single disk file. The API is designed for convenience and ease"
"of use.  Applications that link against SQLite can enjoy the power"
"and flexiblity of an SQL database without the administrative hassles"
"of supporting a separate database server."
""
"Homepage:  http://www.sqlite.org/"

)


build() {
# Enable some features:
SLKCFLAGS="$SLKCFLAGS -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 -DSQLITE_ENABLE_ICU -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_STAT2=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_FTS3_TOKENIZER=1"
	
	cd $SRC/sqlite-src-$_srcver
	CFLAGS="$SLKCFLAGS" \
	CXXFLAGS="$SLKCFLAGS $(icu-config --cppflags)" \
	LDFLAGS="$(icu-config --ldflags)" \
	./configure \
	--prefix=/usr \
	--libdir=/usr/lib${LIBDIRSUFFIX} \
	--sysconfdir=/etc \
	--localstatedir=/var \
	--mandir=/usr/man \
	--enable-threadsafe \
	--enable-cross-thread-connections \
	--enable-tempstore=yes \
	--enable-load-extension \
	--enable-static=no \
	--build=$arch-slackware-linux || return 1
		
	make -j $numjobs || return 1
	make install DESTDIR=$PKG || return 1
}

