diff options
Diffstat (limited to 'meta/classes/debian.bbclass')
| -rw-r--r-- | meta/classes/debian.bbclass | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/meta/classes/debian.bbclass b/meta/classes/debian.bbclass index 2484003e37..be7cacca98 100644 --- a/meta/classes/debian.bbclass +++ b/meta/classes/debian.bbclass @@ -8,7 +8,12 @@ # # Better expressed as ensure all RDEPENDS package before we package # This means we can't have circular RDEPENDS/RRECOMMENDS -DEBIANRDEP = "do_package" + +AUTO_LIBNAME_PKGS = "${PACKAGES}" + +inherit package + +DEBIANRDEP = "do_packagedata" do_package_write_ipk[rdeptask] = "${DEBIANRDEP}" do_package_write_deb[rdeptask] = "${DEBIANRDEP}" do_package_write_tar[rdeptask] = "${DEBIANRDEP}" @@ -47,27 +52,32 @@ python debian_package_name_hook () { return 0 return (s[stat.ST_MODE] & stat.S_IEXEC) + def add_rprovides(pkg, d): + newpkg = d.getVar('PKG_' + pkg, True) + if newpkg and newpkg != pkg: + provs = (d.getVar('RPROVIDES_' + pkg, True) or "").split() + if pkg not in provs: + d.appendVar('RPROVIDES_' + pkg, " " + pkg + " (=" + d.getVar("PKGV", True) + ")") + def auto_libname(packages, orig_pkg): sonames = [] has_bins = 0 has_libs = 0 - pkg_dir = os.path.join(pkgdest, orig_pkg) - for root, dirs, files in os.walk(pkg_dir): - if bin_re.match(root) and files: + for file in pkgfiles[orig_pkg]: + root = os.path.dirname(file) + if bin_re.match(root): has_bins = 1 - if lib_re.match(root) and files: + if lib_re.match(root): has_libs = 1 - for f in files: - if so_re.match(f): - fp = os.path.join(root, f) - cmd = (d.getVar('TARGET_PREFIX', True) or "") + "objdump -p " + fp + " 2>/dev/null" - fd = os.popen(cmd) - lines = fd.readlines() - fd.close() - for l in lines: - m = re.match("\s+SONAME\s+([^\s]*)", l) - if m and not m.group(1) in sonames: - sonames.append(m.group(1)) + if so_re.match(os.path.basename(file)): + cmd = (d.getVar('TARGET_PREFIX', True) or "") + "objdump -p " + file + " 2>/dev/null" + fd = os.popen(cmd) + lines = fd.readlines() + fd.close() + for l in lines: + m = re.match("\s+SONAME\s+([^\s]*)", l) + if m and not m.group(1) in sonames: + sonames.append(m.group(1)) bb.debug(1, 'LIBNAMES: pkg %s libs %d bins %d sonames %s' % (orig_pkg, has_libs, has_bins, sonames)) soname = None @@ -95,9 +105,10 @@ python debian_package_name_hook () { if soname_result: (pkgname, devname) = soname_result for pkg in packages.split(): - if (d.getVar('PKG_' + pkg) or d.getVar('DEBIAN_NOAUTONAME_' + pkg)): + if (d.getVar('PKG_' + pkg, False) or d.getVar('DEBIAN_NOAUTONAME_' + pkg, False)): + add_rprovides(pkg, d) continue - debian_pn = d.getVar('DEBIANNAME_' + pkg) + debian_pn = d.getVar('DEBIANNAME_' + pkg, False) if debian_pn: newpkg = debian_pn elif pkg == orig_pkg: @@ -110,6 +121,9 @@ python debian_package_name_hook () { newpkg = mlpre + newpkg if newpkg != pkg: d.setVar('PKG_' + pkg, newpkg) + add_rprovides(pkg, d) + else: + add_rprovides(orig_pkg, d) # reversed sort is needed when some package is substring of another # ie in ncurses we get without reverse sort: |
