#!/usr/bin/make -f

DEB_DH_MAKESHLIBS_ARGS_libsqliteodbc=--noscripts
DEB_BUILD_PARALLEL:=1
DEB_DESTDIR:=$(CURDIR)/debian/tmp
DEB_INSTALL_DOCS_ALL:=
DEB_CONFIGURE_EXTRA_FLAGS += --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)
DEB_DH_STRIP_ARGS := --dbg-package=libsqliteodbc-dbg

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

 binary-install/libsqlite3-mod-csvtable binary-install/libsqlite3-mod-impexp binary-install/libsqlite3-mod-blobtoxy binary-install/libsqlite3-mod-xpath binary-install/libsqlite3-mod-zipfile::
	for file in $(wildcard debian/$(cdbs_curpkg)/usr/lib/$(DEB_HOST_MULTIARCH)/*.la); do \
		rm $$file; \
		done

common-build-arch::
	mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/odbc

binary-install/libsqliteodbc::
	for file in $(wildcard debian/$(cdbs_curpkg)/usr/lib/$(DEB_HOST_MULTIARCH)/odbc/*.la); do \
		sed -i "/dependency_libs/ s/'.*'/''/" $$file ; \
		done

update-config::
	if ! test -e libtool.upstream; then \
		mv libtool libtool.upstream; \
	fi
	if ! test -e aclocal.m4.upstream; then \
		mv aclocal.m4 aclocal.m4.upstream; \
	fi

reverse-config::
	if test -e libtool.upstream; then \
		mv libtool.upstream libtool; \
	fi
	if test -e aclocal.m4.upstream; then \
		mv aclocal.m4.upstream aclocal.m4; \
	fi
