#!/bin/bash # run this in toplevel build dir rm -f debdep.ldd # get all libs the compiled objects depend on for i in */*.so */*/*.pfo; do ldd $i | awk '{print $1}' >>debdep.ldd; done # sort cat debdep.ldd | sort -u >debdep.libs # query dpkg to map them to the deb packages they are contained in dpkg -S `cat debdep.libs` >debdep.dpkg 2>/dev/null # sort packages cat debdep.dpkg | awk -F : '{print $1}' | sort -u >debdep # clean up mess # rm debdep.*