python do_package_deb () {
import re, copy
+ import textwrap
workdir = bb.data.getVar('WORKDIR', d, True)
if not workdir:
# check for required fields
try:
for (c, fs) in fields:
- ctrlfile.write(unicode(c % tuple(pullData(fs, localdata))))
+ for f in fs:
+ if bb.data.getVar(f, localdata) is None:
+ raise KeyError(f)
+ # Special behavior for description...
+ if 'DESCRIPTION' in fs:
+ summary = bb.data.getVar('SUMMARY', localdata, True) or bb.data.getVar('DESCRIPTION', localdata, True) or "."
+ description = bb.data.getVar('DESCRIPTION', localdata, True) or "."
+ description = textwrap.dedent(description).strip()
+ ctrlfile.write('Description: %s\n' % unicode(summary))
+ ctrlfile.write('%s\n' % unicode(textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' ')))
+ else:
+ ctrlfile.write(unicode(c % tuple(pullData(fs, localdata))))
except KeyError:
import sys
(type, value, traceback) = sys.exc_info()
python do_package_ipk () {
import re, copy
+ import textwrap
workdir = bb.data.getVar('WORKDIR', d, True)
outdir = bb.data.getVar('PKGWRITEDIRIPK', d, True)
for f in fs:
if bb.data.getVar(f, localdata) is None:
raise KeyError(f)
- ctrlfile.write(c % tuple(pullData(fs, localdata)))
+ # Special behavior for description...
+ if 'DESCRIPTION' in fs:
+ summary = bb.data.getVar('SUMMARY', localdata, True) or bb.data.getVar('DESCRIPTION', localdata, True) or "."
+ description = bb.data.getVar('DESCRIPTION', localdata, True) or "."
+ description = textwrap.dedent(description).strip()
+ ctrlfile.write('Description: %s\n' % summary)
+ ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))
+ else:
+ ctrlfile.write(c % tuple(pullData(fs, localdata)))
except KeyError:
import sys
(type, value, traceback) = sys.exc_info()
}
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):
# 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 "")
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 = []
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)
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('')
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('')