summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass18
1 files changed, 15 insertions, 3 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 4955792916..7fc5e8ea96 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -2,7 +2,6 @@ inherit package
2inherit rpm_core 2inherit rpm_core
3 3
4RPMBUILD="rpmbuild --short-circuit ${RPMOPTS}" 4RPMBUILD="rpmbuild --short-circuit ${RPMOPTS}"
5PACKAGE_WRITE_FUNCS += "do_package_rpm"
6IMAGE_PKGTYPE ?= "rpm" 5IMAGE_PKGTYPE ?= "rpm"
7 6
8python write_specfile() { 7python write_specfile() {
@@ -54,7 +53,6 @@ python write_specfile() {
54 except OSError: 53 except OSError:
55 raise bb.build.FuncFailed("unable to open spec file for writing.") 54 raise bb.build.FuncFailed("unable to open spec file for writing.")
56 55
57# fd = sys.__stdout__
58 fd = specfile 56 fd = specfile
59 for var in out_vartranslate.keys(): 57 for var in out_vartranslate.keys():
60 if out_vartranslate[var][0] == "%": 58 if out_vartranslate[var][0] == "%":
@@ -123,7 +121,7 @@ python do_package_rpm () {
123 bb.data.setVar('OVERRIDES', '%s:%s' % (overrides, pkg), localdata) 121 bb.data.setVar('OVERRIDES', '%s:%s' % (overrides, pkg), localdata)
124 122
125 bb.data.update_data(localdata) 123 bb.data.update_data(localdata)
126# stuff 124
127 root = bb.data.getVar('ROOT', localdata) 125 root = bb.data.getVar('ROOT', localdata)
128 basedir = os.path.dirname(root) 126 basedir = os.path.dirname(root)
129 pkgoutdir = outdir 127 pkgoutdir = outdir
@@ -132,3 +130,17 @@ python do_package_rpm () {
132 bb.build.exec_func('write_specfile', localdata) 130 bb.build.exec_func('write_specfile', localdata)
133 del localdata 131 del localdata
134} 132}
133
134python () {
135 import bb
136 if bb.data.getVar('PACKAGES', d, True) != '':
137 bb.data.setVarFlag('do_package_write_rpm', 'depends', 'rpm-native:do_populate_staging', d)
138}
139
140
141python do_package_write_rpm () {
142 bb.build.exec_func("read_subpackage_metadata", d)
143 bb.build.exec_func("do_package_rpm", d)
144}
145do_package_write_rpm[dirs] = "${D}"
146addtask package_write_rpm before do_build after do_package