if d.getVar('MANIFESTFILES', True):
# Must use .manifest files at the location where tizen_copy_manifest() put it.
spec_file.append('%%manifest ../packages-split/%s' % (d.getVar('MANIFESTFILES', True)))
+ else:
+ fetch = bb.fetch2.Fetch([], d)
+ for url in fetch.urls:
+ local = fetch.localpath(url)
+ base = os.path.basename(local)
+ if base.endswith('.manifest.in'):
+ manifest = base[:-3]
+ else:
+ manifest = base
+ if manifest.endswith('.manifest'):
+ urldata = fetch.ud[url]
+ if 'pkg' in urldata.parm:
+ pkg = urldata.parm['pkg'].split(',')
+ enabled = splitname in pkg or not pkg
+ else:
+ enabled = True
+ if enabled:
+ # Optionally replace placeholders with content of the corresponding variables,
+ # otherwise just copy to a place where rpm can find it. Absolute paths
+ # refering to a file on the host do not work, because rpm interprets them
+ # relative to the build dir.
+ content = open(local).read()
+ if base != manifest:
+ import re
+ def replace(m):
+ word = m.group(1)
+ # Must be a known variable.
+ return d.getVar(word, True)
+ content = re.sub('@([a-zA-Z0-9_]+)@', replace, content)
+ # Create relative to _builddir = $S, see package_rpm.bbclass/do_package_rpm ().
+ dvar = d.getVar('S', True)
+ copy = os.path.join(dvar, manifest)
+ print '***', copy
+ if not os.path.exists(dvar):
+ os.makedirs(dvar)
+ f = open(copy, 'w')
+ f.write(content)
+ f.close()
+ spec_file.append('%%manifest %s' % manifest)
+ break
# Copies manifest files from source to packages-split. Necessary because
# source is not always available during packaging (for example, when