#!/bin/sh

set -eu

name="$1"
library="$2"
pkg="${3:-}"
if [ -z "${pkg}"]; then
	pkg=$(dh_listpackages | head -1)
fi

lib=$(dpkg -S "${library}" | head -1 | cut -d: -f1)
echo "${name}:Depends=${lib}" >> "debian/${pkg}.substvars"
