Blob Blame History Raw
#!/bin/sh

# Finds requirements provided outside of the current file set
# $Id$

FIND_PROVIDES=$(rpm --eval %__find_provides)

# FIXME: for some reason objdump -p doesn't include libxul,
# thus using the traditional ldd way to craft dependencies
FIND_REQUIRES="$(rpm --eval %__find_requires) ldd"

filelist=$(sed "s/[]['\"*?{}]/\\\\\&/g")
provides=$(echo $filelist | $FIND_PROVIDES)

{
for f in $filelist ; do
	echo $f | $FIND_REQUIRES | while read req ; do

		# XXX: If a lightning file has a dependency
		# on some thunderbird file... how to do this
		# correctly?
		echo $f | grep -q thunderbird-lightning &&
			echo $req | egrep "($(echo	\
				libgfxpsshar.so		\
				libgkgfx.so		\
				libgtkembedmoz.so	\
				libgtkxtbin.so		\
				libldap50.so		\
				libmozjs.so		\
				libprldap50.so		\
				libxpcom.so		\
				libxpcom_compat.so	\
				libxpcom_core.so	\
				libxpistub.so		|
				sed 's/ /|/g'))" &&
				found=1

		found=0
		for p in $provides ; do
			if [ "$req" = "$p" ]; then
				found=1
			fi
		done
		if [ "$found" = "0" ]; then
			echo $req
		fi
	done
done
} | sort -u