#!/usr/bin/make -f

DEB_BUILD_PARALLEL=yes

include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk

DEB_CONFIGURE_EXTRA_FLAGS := --with-driverdir=/usr/lib/tntdb --with-doxygen
DEB_DH_MAKESHLIBS_ARGS := -Xusr/lib/tntdb

post-patches::
	touch src/mysql/.specs

clean::
	rm -fr doc/html/ doc/latex/

binary-post-install/libtntdb-dev::
	rm -f debian/libtntdb-dev/usr/share/doc/libtntdb-dev/html/jquery.js
	cd debian/libtntdb-dev/usr/share/doc/libtntdb-dev/html/; ln -s ../../../javascript/jquery/jquery.js jquery.js
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	cd test; sqlite3 test.db < sqlite-test.sql; ./tntdb-test || /bin/true
endif
