# Description: SQL database engine
# URL:         http://www.sqlite.org/
# Maintainer: CRUX compat-32 Team, compat-32-ports at crux dot nu
# Depends on:  ncurses-32 readline-32 sqlite3

name=sqlite3-32
version=3.10.2
release=1
_version=$(printf "%i%.2i%.2i%.2i" ${version//./ })

source=(http://www.sqlite.org/2016/sqlite-autoconf-${_version}.tar.gz)

build() {
    cd sqlite-autoconf-${_version}

    CFLAGS="-DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 \
            -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_DBSTAT_VTAB=1 \
            $CFLAGS" \
    ./configure --prefix=/usr --mandir=/usr/man --libdir=/usr/lib32

    make -j1
    make DESTDIR=$PKG install

    rm -r $PKG/usr/{bin,include,man}
}