summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-09-03 14:49:22 +0000
committerRichard Purdie <richard@openedhand.com>2008-09-03 14:49:22 +0000
commit6269c57167cd172d1fadb0d0efd50b953755e0cc (patch)
tree3e1d5fc6d8d7807b5605ffd8371e7b4a3ce36acd
parent5d24ea892f7c91771b0b703b14338baf8f3957fb (diff)
downloadpoky-6269c57167cd172d1fadb0d0efd50b953755e0cc.tar.gz
package_rpm.bbclass: Fix problems with package version with '-' in the version (replace with '+'), improve the Requires and Recommends generation code
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5129 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rw-r--r--meta/classes/package_rpm.bbclass32
1 files changed, 26 insertions, 6 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 5945c047b4..22604d2569 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -14,9 +14,14 @@ RPM="rpm ${RPMOPTS}"
14python write_specfile() { 14python write_specfile() {
15 from bb import data, build 15 from bb import data, build
16 import sys 16 import sys
17
18 version = bb.data.getVar('PV', d, 1)
19 version = version.replace('-', '+')
20 bb.data.setVar('RPMPV', version, d)
21
17 out_vartranslate = { 22 out_vartranslate = {
18 "PKG": "Name", 23 "PKG": "Name",
19 "PV": "Version", 24 "RPMPV": "Version",
20 "PR": "Release", 25 "PR": "Release",
21 "DESCRIPTION": "%description", 26 "DESCRIPTION": "%description",
22 "ROOT": "BuildRoot", 27 "ROOT": "BuildRoot",
@@ -71,9 +76,24 @@ python write_specfile() {
71 fd.write("AutoReqProv: no\n") 76 fd.write("AutoReqProv: no\n")
72 77
73 bb.build.exec_func("mapping_rename_hook", d) 78 bb.build.exec_func("mapping_rename_hook", d)
74 rdepends = " ".join(bb.utils.explode_deps(bb.data.getVar('RDEPENDS', d, True) or "")) 79 rdepends = bb.utils.explode_dep_versions(bb.data.getVar('RDEPENDS', d, True) or "")
75 if rdepends: 80 for dep in rdepends:
76 fd.write("Requires: %s\n" % rdepends) 81 ver = rdepends[dep]
82 if dep and ver:
83 ver = ver.replace('-', '+')
84 fd.write("Requires: %s %s\n" % (dep, ver))
85 elif dep:
86 fd.write("Requires: %s\n" % (dep))
87
88 rdepends = bb.utils.explode_dep_versions(bb.data.getVar('RRECOMMENDS', d, True) or "")
89 for dep in rdepends:
90 ver = rdepends[dep]
91 if dep and ver:
92 ver = ver.replace('-', '+')
93 fd.write("Recommends: %s %s\n" % (dep, ver))
94 elif dep:
95 fd.write("Recommends: %s\n" % (dep))
96
77 fd.write("Summary\t: .\n") 97 fd.write("Summary\t: .\n")
78 98
79 for var in out_vartranslate.keys(): 99 for var in out_vartranslate.keys():
@@ -99,8 +119,8 @@ python write_specfile() {
99 bb.build.exec_func('BUILDSPEC', d) 119 bb.build.exec_func('BUILDSPEC', d)
100 120
101 # move the rpm into the pkgoutdir 121 # move the rpm into the pkgoutdir
102 rpm = bb.data.expand('${RPMBUILDPATH}/RPMS/${TARGET_ARCH}/${PKG}-${PV}-${PR}.${TARGET_ARCH}.rpm', d) 122 rpm = bb.data.expand('${RPMBUILDPATH}/RPMS/${TARGET_ARCH}/${PKG}-${RPMPV}-${PR}.${TARGET_ARCH}.rpm', d)
103 outrpm = bb.data.expand('${DEPLOY_DIR_RPM}/${PKG}-${PV}-${PR}.${TARGET_ARCH}.rpm', d) 123 outrpm = bb.data.expand('${DEPLOY_DIR_RPM}/${PKG}-${RPMPV}-${PR}.${TARGET_ARCH}.rpm', d)
104 bb.movefile(rpm, outrpm) 124 bb.movefile(rpm, outrpm)
105} 125}
106 126