+if [ $IGNORE_CONFIG_SCAN -eq 0 ] ; then
+
+rpm_config_REQUIRES=$(
+ # Parse the xml .config files to see what native binaries we call into
+ # TODO: also check monodis --moduleref
+ for i in "${configlist[@]}"; do
+ awk 'match($_, /<dllmap .*target=.*/) {
+ ignore=0
+ req=""
+ split($_, toks, "\"")
+ toks_size=0
+ for(tok in toks) { toks_size++ }
+ for(i=1; i <= toks_size; i++) {
+ if(toks[i] ~ /target=/) {
+ req=toks[i+1]
+ }
+ if(toks[i] ~ /os=/) {
+ negate=0
+ found=0
+
+ attr=toks[i+1]
+ if(attr ~ /^!/) {
+ attr=substr(attr, 2, length(attr)-1)
+ negate=1
+ }
+
+ split(attr, os_targets, ",")
+ os_targets_size=0
+ for(os_target in os_targets) { os_targets_size++ }
+ for(j=1; j <= os_targets_size; j++) {
+ if(os_targets[j] == "linux") {
+ found=1
+ }
+ }
+
+ if(negate) {
+ found=!found
+ }
+ if (!found) {
+ ignore=1
+ }
+ }
+ }
+ if(!ignore) {
+ print req"'$libext'"
+ }
+ } ' $i 2>/dev/null
+ done
+)
+
+# Resolve provides to packages, warning on missing to stderr
+config_REQUIRES=$(
+ first=1 # avoid an empty line if no .config reqs are found
+ for i in ${rpm_config_REQUIRES[@]} ; do
+ out=$(rpm -q --whatprovides --queryformat "%{NAME}\n" $i)
+ if [ $? -eq 0 ] ; then
+ if [ $first -eq 1 ] ; then
+ echo ""
+ first=0
+ fi
+ echo $out
+ else
+ # echo to stderr
+ echo "mono-find-requires: Warning, could not find package that provides: $i" >&2
+ fi
+ done
+)
+
+fi
+
+# Note about above:
+# Use to do: system("rpm -q --whatprovides --queryformat \"%{NAME}\n\" ""\""req"'$libext'""\"")
+# rpmlint prefers to have lib names instead of package names. There was a reason I was using package names but it slips me now...
+# Ah... now I remember... it's for noarch packs. The noarch packages can be built on either 32 or 64 bit... so we have to depend
+# on the package name instead.
+