#!/usr/bin/make -f
# -*- makefile -*-

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
DEB_BUILD_OPTIONS = parallel=4

%:
	dh $@
#	dh $@ -plua-cnrun --buildsystem=lua --with lua

override_dh_auto_configure:
	dh_auto_configure -- --enable-tools --enable-lua-api-docs

# Perhaps I didn't try hard enough, but there was a conflict between
# upstream's own, independent way to install Lua module as
# /usr/lib/lua/5.x/cnrun.so, and Debian's recommended, using
# dh-lua.conf.  I stuck with the former, simply because upstream has
# the full right to handle lua module himself.  Just let debian
# maintainers pick up ready-made lua/cnrun.so already installed where
# it belongs.
#
# And, not to mention the need to write %.lo: target in top Makefile.am.

override_dh_clean:
	rm -f config.log
	dh_clean

override_dh_shlibdeps:
	dh_shlibdeps -L libcnrun2-dev

# Here, we want dependencies to be scanned including a package not yet
# installed, which I believe gets fixed by making an explicit mention
# of libcnrun2-dev here.

override_dh_makeshlibs:
	dh_makeshlibs -plibcnrun2 -V -- -t -c1 -q -v2.0.0

# This is nasty; not sure supplying symbols in demangled form is of
# any help; but -q and -c1 obviously is.

override_dh_missing:
	dh_missing --list-missing
