]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blobdiff - pkgs/build-essentials/buildsystem-tools/functions-packager-find
avahi: Update to 0.6.30.
[people/ms/ipfire-3.x.git] / pkgs / build-essentials / buildsystem-tools / functions-packager-find
index bc97483cf6d8dcd74d93cefb66c01c093a459b70..1b488d9f7b9144d04a515ea7068abbed55d0008e 100644 (file)
@@ -38,17 +38,19 @@ function find_requires() {
        local others=$(find_python_requires ${dirs})
        others="${others} $(find_weak_symbols_requires ${dirs})"
        others="${others} $(find_perl_requires ${dirs})"
-
-       # Get provides, because packages should not depend on features they provide
-       # by themselves.
-       local provides=$(find_provides ${dirs})
+       others="${others} $(find_pkgconfig_requires ${dirs})"
 
        # Return a sorted and unique(!) list
        local require
        local requires
        for require in $(listsort ${PKG_DEPS} ${interpreters} ${neededs} ${links} ${others}); do
                [ "${require:0:3}" = "ld-" ] && continue
-               listmatch ${require} ${provides} || requires="${requires} ${require}"
+
+               if [ -n "${PKG_REQUIRES_FILTER}" ]; then
+                       grep -qE "${PKG_REQUIRES_FILTER}" <<< "${require}" && continue
+               fi
+
+               requires="${requires} ${require}"
        done
 
        echo ${requires}
@@ -68,8 +70,19 @@ function find_provides() {
        local others=$(find_python_provides ${dirs})
        others="${others} $(find_weak_symbols_provides ${dirs})"
        others="${others} $(find_perl_provides ${dirs})"
+       others="${others} $(find_pkgconfig_provides ${dirs})"
+
+       local provide
+       local provides
+       for provide in $(listsort ${PKG_PROVIDES} ${sonames} ${others}); do
+               if [ -n "${PKG_PROVIDES_FILTER}" ]; then
+                       grep -qE "${PKG_PROVIDES_FILTER}" <<< "${provide}" && continue
+               fi
 
-       listsort ${PKG_PROVIDES} ${sonames} ${others}
+               provides="${provides} ${provide}"
+       done
+
+       echo ${provides}
 }
 
 function find_interpreters() {
@@ -163,12 +176,22 @@ function find_perl_files() {
 
 function find_perl_provides() {
        [ -x "/usr/bin/perl" ] || return 0
-       ${BASEDIR}/perl.prov $(find_perl_files $@) | sort -u
+       perl ${BASEDIR}/perl.prov $(find_perl_files $@) | sort -u
 }
 
 function find_perl_requires() {
        [ -x "/usr/bin/perl" ] || return 0
-       ${BASEDIR}/perl.req $(find_perl_files $@) | sort -u
+       perl ${BASEDIR}/perl.req $(find_perl_files $@) | sort -u
+}
+
+function find_pkgconfig_provides() {
+       [ -x "/usr/bin/pkg-config" ] || return 0
+       find $@ | ${BASEDIR}/pkg-config.prov
+}
+
+function find_pkgconfig_requires() {
+       [ -x "/usr/bin/pkg-config" ] || return 0
+       find $@ | ${BASEDIR}/pkg-config.req
 }
 
 function find_weak_symbols_provides() {