#!/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/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/bin/gjs | awk '$$1=="NEEDED" && $$2~/^libmozjs/ { print $$2 }' | sed s/\\.so\\./-/ )
DEB_DH_MAKESHLIBS_ARGS_libgjs0b = -Xusr/lib/gjs-1.0/ -V'libgjs0b (>= $(DEB_UPSTREAM_VERSION)), libgjs0-$(LIBMOZJS)' -- -c4

DEB_MAKE_CHECK_TARGET := check || true

install/libgjs0b::
	chrpath -d "$(CURDIR)"/debian/tmp/usr/lib/libgjs.so.0.0.0
	echo gjs:Provides=libgjs0-$(LIBMOZJS) >> debian/$(cdbs_curpkg).substvars
