diff options
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r-- | meta/classes/package_rpm.bbclass | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index ac6ac2ca54..db379b4c96 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass | |||
@@ -46,7 +46,8 @@ python write_specfile() { | |||
46 | del files[files.index(r)] | 46 | del files[files.index(r)] |
47 | except ValueError: | 47 | except ValueError: |
48 | pass | 48 | pass |
49 | if not files: | 49 | |
50 | if not files and bb.data.getVar('ALLOW_EMPTY', d) != "1": | ||
50 | from bb import note | 51 | from bb import note |
51 | note("Not creating empty archive for %s-%s-%s" % (bb.data.getVar('PKG',d, 1), bb.data.getVar('PV', d, 1), bb.data.getVar('PR', d, 1))) | 52 | note("Not creating empty archive for %s-%s-%s" % (bb.data.getVar('PKG',d, 1), bb.data.getVar('PV', d, 1), bb.data.getVar('PR', d, 1))) |
52 | return | 53 | return |
@@ -65,10 +66,10 @@ python write_specfile() { | |||
65 | if out_vartranslate[var][0] == "%": | 66 | if out_vartranslate[var][0] == "%": |
66 | continue | 67 | continue |
67 | val = bb.data.getVar(var, d, 1) | 68 | val = bb.data.getVar(var, d, 1) |
68 | if var == "RDEPENDS": | ||
69 | val = val.split()[0] | ||
70 | fd.write("%s\t: %s\n" % (out_vartranslate[var], val)) | 69 | fd.write("%s\t: %s\n" % (out_vartranslate[var], val)) |
71 | rdepends = " ".join(bb.utils.explode_deps(bb.data.getVar('RDEPENDS', d, True))) | 70 | |
71 | bb.build.exec_func("mapping_rename_hook", d) | ||
72 | rdepends = " ".join(bb.utils.explode_deps(bb.data.getVar('RDEPENDS', d, True) or "")) | ||
72 | if rdepends: | 73 | if rdepends: |
73 | fd.write("Requires: %s\n" % rdepends) | 74 | fd.write("Requires: %s\n" % rdepends) |
74 | fd.write("Summary\t: .\n") | 75 | fd.write("Summary\t: .\n") |
@@ -160,6 +161,9 @@ python do_package_rpm () { | |||
160 | pkgoutdir = outdir | 161 | pkgoutdir = outdir |
161 | bb.mkdirhier(pkgoutdir) | 162 | bb.mkdirhier(pkgoutdir) |
162 | bb.data.setVar('OUTSPECFILE', os.path.join(workdir, "%s.spec" % pkg), localdata) | 163 | bb.data.setVar('OUTSPECFILE', os.path.join(workdir, "%s.spec" % pkg), localdata) |
164 | # Save the value of RPMBUILD expanded into the new dictonary so any | ||
165 | # changes in the compoents that make up workdir don't break packaging | ||
166 | bb.data.setVar('RPMBUILD', bb.data.getVar("RPMBUILD", d, True), localdata) | ||
163 | bb.build.exec_func('write_specfile', localdata) | 167 | bb.build.exec_func('write_specfile', localdata) |
164 | bb.utils.unlockfile(lf) | 168 | bb.utils.unlockfile(lf) |
165 | } | 169 | } |