summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2010-09-29 10:11:24 -0500
committerRichard Purdie <rpurdie@linux.intel.com>2010-10-11 22:13:14 +0100
commitb2f2590e6c566d1ed4df87cf52279106497d584d (patch)
tree3e0b27e130a0f878f87b8843e9486411925e5a96 /meta/classes/package_rpm.bbclass
parent5783e717ee9f503d8e03992306a6b9ddfda6f73e (diff)
downloadast2050-yocto-poky-b2f2590e6c566d1ed4df87cf52279106497d584d.zip
ast2050-yocto-poky-b2f2590e6c566d1ed4df87cf52279106497d584d.tar.gz
Add Summary/Description support to packaging
[BUGID #281] Add the ability for the deb, ipk and rpm classes to use the new summary and description fields. The Description is wrapped around 75 characters to ensure a reasonably nice, presentable description. (Summary defaults to the description if Summary is not defined.) Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass16
1 files changed, 10 insertions, 6 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 49468bb..b31830f 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -72,6 +72,8 @@ package_generate_rpm_conf () {
}
python write_specfile () {
+ import textwrap
+
# We need to change '-' in a version field to '+'
# This needs to be done BEFORE the mapping_rename_hook
def translate_vers(varname, d):
@@ -136,7 +138,7 @@ python write_specfile () {
# Construct the SPEC file...
srcname = bb.data.getVar('PN', d, True)
- srcsummary = (bb.data.getVar('SUMMARY', d, True) or ".")
+ srcsummary = (bb.data.getVar('SUMMARY', d, True) or bb.data.getVar('DESCRIPTION', d, True) or ".")
srcversion = bb.data.getVar('PV', d, True).replace('-', '+')
srcrelease = bb.data.getVar('PR', d, True)
srcepoch = (bb.data.getVar('PE', d, True) or "")
@@ -144,7 +146,7 @@ python write_specfile () {
srcsection = bb.data.getVar('SECTION', d, True)
srcmaintainer = bb.data.getVar('MAINTAINER', d, True)
srchomepage = bb.data.getVar('HOMEPAGE', d, True)
- srcdescription = bb.data.getVar('DESCRIPTION', d, True)
+ srcdescription = bb.data.getVar('DESCRIPTION', d, True) or "."
srcdepends = bb.data.getVar('DEPENDS', d, True)
srcrdepends = []
@@ -191,13 +193,13 @@ python write_specfile () {
splitname = pkgname
- splitsummary = (bb.data.getVar('SUMMARY', d, True) or ".")
+ splitsummary = (bb.data.getVar('SUMMARY', d, True) or bb.data.getVar('DESCRIPTION', d, True) or ".")
splitversion = (bb.data.getVar('PV', localdata, True) or "").replace('-', '+')
splitrelease = (bb.data.getVar('PR', localdata, True) or "")
splitepoch = (bb.data.getVar('PE', localdata, True) or "")
splitlicense = (bb.data.getVar('LICENSE', localdata, True) or "")
splitsection = (bb.data.getVar('SECTION', localdata, True) or "")
- splitdescription = (bb.data.getVar('DESCRIPTION', localdata, True) or "")
+ splitdescription = (bb.data.getVar('DESCRIPTION', localdata, True) or ".")
translate_vers('RDEPENDS', localdata)
translate_vers('RRECOMMENDS', localdata)
@@ -295,7 +297,8 @@ python write_specfile () {
spec_preamble_bottom.append('')
spec_preamble_bottom.append('%%description -n %s' % splitname)
- spec_preamble_bottom.append('%s' % splitdescription)
+ dedent_text = textwrap.dedent(splitdescription).strip()
+ spec_preamble_bottom.append('%s' % textwrap.fill(dedent_text, width=75))
spec_preamble_bottom.append('')
@@ -379,7 +382,8 @@ python write_specfile () {
spec_preamble_top.append('')
spec_preamble_top.append('%description')
- spec_preamble_top.append('%s' % srcdescription)
+ dedent_text = textwrap.dedent(srcdescription).strip()
+ spec_preamble_top.append('%s' % textwrap.fill(dedent_text, width=75))
spec_preamble_top.append('')
OpenPOWER on IntegriCloud