2 if bb.data.inherits_class('rootfs_rpm', d):
3 rootfsdepends = d.getVarFlag("do_rootfs", "depends", True)
4 rootfsdepends = rootfsdepends.replace("rpmresolve-native:do_populate_sysroot", "")
5 d.setVarFlag("do_rootfs", "depends", rootfsdepends)
7 if bb.data.inherits_class('image-live', d):
8 bootimgdepends = d.getVarFlag("do_bootimg", "depends", True)
9 bootimgdepends = bootimgdepends.replace(d.expand("${INITRD_IMAGE}:do_rootfs"), "")
10 d.setVarFlag("do_bootimg", "depends", bootimgdepends)
11 d.setVar("INITRD_IMAGE", "")
12 d.setVar("INITRD", "")
17 # MANIFESTFILES_<pn> is the Tizen Smack .manifest file to be used for a binary .rpm.
18 # It must be part of the source tree (either at the root or in a sub-directory)
19 # or get created there during configure. Out-of-tree compilation is not supported.
21 # Enable extra code for the binary .rpm spec files which injects the %manifest
22 # lines for each package.
23 RPM_EXTRA_PKGDATA = "1"
24 def package_rpm_extra_pkgdata(splitname, spec_file, d):
25 if d.getVar('MANIFESTFILES', True):
26 # Must use .manifest files at the location where tizen_copy_manifest() put it.
27 spec_file.append('%%manifest ../packages-split/%s' % (d.getVar('MANIFESTFILES', True)))
29 fetch = bb.fetch2.Fetch([], d)
30 for url in fetch.urls:
31 local = fetch.localpath(url)
32 base = os.path.basename(local)
33 if base.endswith('.manifest.in'):
37 if manifest.endswith('.manifest'):
38 urldata = fetch.ud[url]
39 if 'pkg' in urldata.parm:
40 pkg = urldata.parm['pkg'].split(',')
41 enabled = splitname in pkg or not pkg
45 # Optionally replace placeholders with content of the corresponding variables,
46 # otherwise just copy to a place where rpm can find it. Absolute paths
47 # refering to a file on the host do not work, because rpm interprets them
48 # relative to the build dir.
49 content = open(local).read()
54 # Must be a known variable.
55 return d.getVar(word, True)
56 content = re.sub('@([a-zA-Z0-9_]+)@', replace, content)
57 # Create relative to _builddir = $S, see package_rpm.bbclass/do_package_rpm ().
58 dvar = d.getVar('S', True)
59 copy = os.path.join(dvar, manifest)
61 if not os.path.exists(dvar):
66 spec_file.append('%%manifest %s' % manifest)
69 # Copies manifest files from source to packages-split. Necessary because
70 # source is not always available during packaging (for example, when
71 # using sstate), only $PKGDEST is.
72 PACKAGESPLITFUNCS_append = " tizen_copy_manifest"
73 python tizen_copy_manifest () {
74 dest = d.getVar('S', True)
75 dvar = d.getVar('PKGDEST', True)
77 packages = d.getVar('PACKAGES', True)
78 for pkg in packages.split():
79 manifest_path=d.getVar('MANIFESTFILES_%s' % pkg, True)
81 manifest_dir = os.path.dirname(manifest_path)
84 cmd = 'mkdir -p %s/%s' % (dvar,manifest_dir)
85 (retval, output) = oe.utils.getstatusoutput(cmd)
87 bb.fatal("directory failed to be created with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
89 cmd = 'cp %s/%s %s/%s' % (dest, manifest_path , dvar,manifest_dir)
91 (retval, output) = oe.utils.getstatusoutput(cmd)
93 bb.fatal("file copy failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))