diff options
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r-- | meta/classes/package_rpm.bbclass | 55 |
1 files changed, 11 insertions, 44 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index 4f4f8e4e11..07ab5cdd9e 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass | |||
@@ -101,27 +101,6 @@ python write_specfile () { | |||
101 | os.chown(f, 0, 0) | 101 | os.chown(f, 0, 0) |
102 | spec_preamble_top.append('Source%s: %s' % (source_number, source)) | 102 | spec_preamble_top.append('Source%s: %s' % (source_number, source)) |
103 | source_number += 1 | 103 | source_number += 1 |
104 | # We need a simple way to remove the MLPREFIX from the package name, | ||
105 | # and dependency information... | ||
106 | def strip_multilib(name, d): | ||
107 | multilibs = d.getVar('MULTILIBS') or "" | ||
108 | for ext in multilibs.split(): | ||
109 | eext = ext.split(':') | ||
110 | if len(eext) > 1 and eext[0] == 'multilib' and name and name.find(eext[1] + '-') >= 0: | ||
111 | name = "".join(name.split(eext[1] + '-')) | ||
112 | return name | ||
113 | |||
114 | def strip_multilib_deps(deps, d): | ||
115 | depends = bb.utils.explode_dep_versions2(deps or "") | ||
116 | newdeps = {} | ||
117 | for dep in depends: | ||
118 | newdeps[strip_multilib(dep, d)] = depends[dep] | ||
119 | return bb.utils.join_deps(newdeps) | ||
120 | |||
121 | # ml = d.getVar("MLPREFIX") | ||
122 | # if ml and name and len(ml) != 0 and name.find(ml) == 0: | ||
123 | # return ml.join(name.split(ml, 1)[1:]) | ||
124 | # return name | ||
125 | 104 | ||
126 | # In RPM, dependencies are of the format: pkg <>= Epoch:Version-Release | 105 | # In RPM, dependencies are of the format: pkg <>= Epoch:Version-Release |
127 | # This format is similar to OE, however there are restrictions on the | 106 | # This format is similar to OE, however there are restrictions on the |
@@ -283,7 +262,7 @@ python write_specfile () { | |||
283 | bb.fatal("No OUTSPECFILE") | 262 | bb.fatal("No OUTSPECFILE") |
284 | 263 | ||
285 | # Construct the SPEC file... | 264 | # Construct the SPEC file... |
286 | srcname = strip_multilib(d.getVar('PN'), d) | 265 | srcname = d.getVar('PN') |
287 | srcsummary = (d.getVar('SUMMARY') or d.getVar('DESCRIPTION') or ".") | 266 | srcsummary = (d.getVar('SUMMARY') or d.getVar('DESCRIPTION') or ".") |
288 | srcversion = d.getVar('PKGV').replace('-', '+') | 267 | srcversion = d.getVar('PKGV').replace('-', '+') |
289 | srcrelease = d.getVar('PKGR') | 268 | srcrelease = d.getVar('PKGR') |
@@ -295,7 +274,7 @@ python write_specfile () { | |||
295 | srcdescription = d.getVar('DESCRIPTION') or "." | 274 | srcdescription = d.getVar('DESCRIPTION') or "." |
296 | srccustomtagschunk = get_package_additional_metadata("rpm", d) | 275 | srccustomtagschunk = get_package_additional_metadata("rpm", d) |
297 | 276 | ||
298 | srcdepends = strip_multilib_deps(d.getVar('DEPENDS'), d) | 277 | srcdepends = d.getVar('DEPENDS') |
299 | srcrdepends = [] | 278 | srcrdepends = [] |
300 | srcrrecommends = [] | 279 | srcrrecommends = [] |
301 | srcrsuggests = [] | 280 | srcrsuggests = [] |
@@ -340,7 +319,7 @@ python write_specfile () { | |||
340 | if dirfiles is not None: | 319 | if dirfiles is not None: |
341 | dirfiles = dirfiles.split() | 320 | dirfiles = dirfiles.split() |
342 | 321 | ||
343 | splitname = strip_multilib(pkgname, d) | 322 | splitname = pkgname |
344 | 323 | ||
345 | splitsummary = (localdata.getVar('SUMMARY') or localdata.getVar('DESCRIPTION') or ".") | 324 | splitsummary = (localdata.getVar('SUMMARY') or localdata.getVar('DESCRIPTION') or ".") |
346 | splitversion = (localdata.getVar('PKGV') or "").replace('-', '+') | 325 | splitversion = (localdata.getVar('PKGV') or "").replace('-', '+') |
@@ -361,12 +340,12 @@ python write_specfile () { | |||
361 | # Map the dependencies into their final form | 340 | # Map the dependencies into their final form |
362 | mapping_rename_hook(localdata) | 341 | mapping_rename_hook(localdata) |
363 | 342 | ||
364 | splitrdepends = strip_multilib_deps(localdata.getVar('RDEPENDS'), d) | 343 | splitrdepends = localdata.getVar('RDEPENDS') |
365 | splitrrecommends = strip_multilib_deps(localdata.getVar('RRECOMMENDS'), d) | 344 | splitrrecommends = localdata.getVar('RRECOMMENDS') |
366 | splitrsuggests = strip_multilib_deps(localdata.getVar('RSUGGESTS'), d) | 345 | splitrsuggests = localdata.getVar('RSUGGESTS') |
367 | splitrprovides = strip_multilib_deps(localdata.getVar('RPROVIDES'), d) | 346 | splitrprovides = localdata.getVar('RPROVIDES') |
368 | splitrreplaces = strip_multilib_deps(localdata.getVar('RREPLACES'), d) | 347 | splitrreplaces = localdata.getVar('RREPLACES') |
369 | splitrconflicts = strip_multilib_deps(localdata.getVar('RCONFLICTS'), d) | 348 | splitrconflicts = localdata.getVar('RCONFLICTS') |
370 | splitrobsoletes = [] | 349 | splitrobsoletes = [] |
371 | 350 | ||
372 | splitrpreinst = localdata.getVar('pkg_preinst') | 351 | splitrpreinst = localdata.getVar('pkg_preinst') |
@@ -640,14 +619,6 @@ python write_specfile () { | |||
640 | write_specfile[vardepsexclude] = "OVERRIDES" | 619 | write_specfile[vardepsexclude] = "OVERRIDES" |
641 | 620 | ||
642 | python do_package_rpm () { | 621 | python do_package_rpm () { |
643 | # We need a simple way to remove the MLPREFIX from the package name, | ||
644 | # and dependency information... | ||
645 | def strip_multilib(name, d): | ||
646 | ml = d.getVar("MLPREFIX") | ||
647 | if ml and name and len(ml) != 0 and name.find(ml) >= 0: | ||
648 | return "".join(name.split(ml)) | ||
649 | return name | ||
650 | |||
651 | workdir = d.getVar('WORKDIR') | 622 | workdir = d.getVar('WORKDIR') |
652 | tmpdir = d.getVar('TMPDIR') | 623 | tmpdir = d.getVar('TMPDIR') |
653 | pkgd = d.getVar('PKGD') | 624 | pkgd = d.getVar('PKGD') |
@@ -665,7 +636,7 @@ python do_package_rpm () { | |||
665 | # If the spec file already exist, and has not been stored into | 636 | # If the spec file already exist, and has not been stored into |
666 | # pseudo's files.db, it maybe cause rpmbuild src.rpm fail, | 637 | # pseudo's files.db, it maybe cause rpmbuild src.rpm fail, |
667 | # so remove it before doing rpmbuild src.rpm. | 638 | # so remove it before doing rpmbuild src.rpm. |
668 | srcname = strip_multilib(d.getVar('PN'), d) | 639 | srcname = d.getVar('PN') |
669 | outspecfile = workdir + "/" + srcname + ".spec" | 640 | outspecfile = workdir + "/" + srcname + ".spec" |
670 | if os.path.isfile(outspecfile): | 641 | if os.path.isfile(outspecfile): |
671 | os.remove(outspecfile) | 642 | os.remove(outspecfile) |
@@ -684,11 +655,7 @@ python do_package_rpm () { | |||
684 | # Let's not fight against this. | 655 | # Let's not fight against this. |
685 | package_arch = (d.getVar('PACKAGE_ARCH') or "").replace("-", "_").replace("all", "noarch") | 656 | package_arch = (d.getVar('PACKAGE_ARCH') or "").replace("-", "_").replace("all", "noarch") |
686 | sdkpkgsuffix = (d.getVar('SDKPKGSUFFIX') or "nativesdk").replace("-", "_") | 657 | sdkpkgsuffix = (d.getVar('SDKPKGSUFFIX') or "nativesdk").replace("-", "_") |
687 | if package_arch not in "all any noarch".split() and not package_arch.endswith(sdkpkgsuffix): | 658 | d.setVar('PACKAGE_ARCH_EXTEND', package_arch) |
688 | ml_prefix = (d.getVar('MLPREFIX') or "").replace("-", "_") | ||
689 | d.setVar('PACKAGE_ARCH_EXTEND', ml_prefix + package_arch) | ||
690 | else: | ||
691 | d.setVar('PACKAGE_ARCH_EXTEND', package_arch) | ||
692 | pkgwritedir = d.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH_EXTEND}') | 659 | pkgwritedir = d.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH_EXTEND}') |
693 | d.setVar('RPM_PKGWRITEDIR', pkgwritedir) | 660 | d.setVar('RPM_PKGWRITEDIR', pkgwritedir) |
694 | bb.debug(1, 'PKGWRITEDIR: %s' % d.getVar('RPM_PKGWRITEDIR')) | 661 | bb.debug(1, 'PKGWRITEDIR: %s' % d.getVar('RPM_PKGWRITEDIR')) |