#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

# Use recursive variables since this variable must not be expanded until 
# files have been installed.
LIBMOZJS = $(shell objdump -p debian/tmp/usr/lib/libcjs.so | awk '$$1=="NEEDED" && $$2~/^libmozjs/ { print $$2 }' | sed s/\\.so\\./-/ )
DEB_DH_MAKESHLIBS_ARGS_libcjs0e = -Xusr/lib/cjs-1.0/ -V'libcjs0e (>= $(DEB_UPSTREAM_VERSION)), libcjs0-$(LIBMOZJS)' -- -c4

DEB_MAKE_CHECK_TARGET := check

ifeq ($(DEB_HOST_ARCH), powerpc)
    DEB_MAKE_CHECK_TARGET := check || true
endif

install/libcjs0e::
	echo cjs:Provides=libcjs0-$(LIBMOZJS) >> debian/$(cdbs_curpkg).substvars
