#!/bin/sh

ports=""
for f in $(find /opt/local/bin -type f) $(find /opt/local/lib -name \*.dylib); do
    if otool -L $f | grep -q 'libpng12\.0'; then
        ports+="\n$(port provides $f | cut -d ' ' -f 5)"
    fi
done
for f in $(find /opt/local/lib -name \*.la); do
    if grep -q libpng12 $f; then
        ports+="\n$(port provides $f | cut -d ' ' -f 5)"
    fi
done

echo $ports | sort | uniq
