summaryrefslogtreecommitdiff
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-03-19 16:05:35 +0000
committerRichard Purdie <richard@openedhand.com>2008-03-19 16:05:35 +0000
commit7c097c78121bc03a105116ff46de4d3ce3fc245f (patch)
tree6d0ca1773f4beade21ec0738da967e1f05ba031d /meta/classes/package.bbclass
parent75d9692ecc20a9c3d5469c0ff870f53ac32adc40 (diff)
downloadopenembedded-core-7c097c78121bc03a105116ff46de4d3ce3fc245f.tar.gz
openembedded-core-7c097c78121bc03a105116ff46de4d3ce3fc245f.tar.bz2
openembedded-core-7c097c78121bc03a105116ff46de4d3ce3fc245f.tar.xz
openembedded-core-7c097c78121bc03a105116ff46de4d3ce3fc245f.zip
package.bbclass: Sync with OE.dev
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4062 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass57
1 files changed, 49 insertions, 8 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 55d968468..eb43856c5 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -152,7 +152,7 @@ def runstrip(file, d):
# If the file is in a .debug directory it was already stripped,
# don't do it again...
if os.path.dirname(file).endswith(".debug"):
- bb.note("Already run strip")
+ bb.note("Already ran strip")
return 0
strip = bb.data.getVar("STRIP", d, 1)
@@ -472,25 +472,31 @@ python emit_pkgdata() {
if val:
f.write('%s_%s: %s\n' % (var, pkg, encode(val)))
- packages = bb.data.getVar('PACKAGES', d, 1)
+ packages = bb.data.getVar('PACKAGES', d, True)
+ pkgdatadir = bb.data.getVar('PKGDATA_DIR', d, True)
+
+ pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
+ if pstageactive == "1":
+ lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
- data_file = bb.data.expand("${PKGDATA_DIR}/${PN}", d)
+ data_file = pkgdatadir + bb.data.expand("/${PN}" , d)
f = open(data_file, 'w')
f.write("PACKAGES: %s\n" % packages)
f.close()
+ package_stagefile(data_file, d)
workdir = bb.data.getVar('WORKDIR', d, 1)
for pkg in packages.split():
- subdata_file = bb.data.expand("${PKGDATA_DIR}/runtime/%s" % pkg, d)
+ subdata_file = pkgdatadir + "/runtime/%s" % pkg
sf = open(subdata_file, 'w')
write_if_exists(sf, pkg, 'PN')
+ write_if_exists(sf, pkg, 'PR')
write_if_exists(sf, pkg, 'DESCRIPTION')
write_if_exists(sf, pkg, 'RDEPENDS')
write_if_exists(sf, pkg, 'RPROVIDES')
write_if_exists(sf, pkg, 'RRECOMMENDS')
write_if_exists(sf, pkg, 'RSUGGESTS')
- write_if_exists(sf, pkg, 'RPROVIDES')
write_if_exists(sf, pkg, 'RREPLACES')
write_if_exists(sf, pkg, 'RCONFLICTS')
write_if_exists(sf, pkg, 'PKG')
@@ -502,6 +508,10 @@ python emit_pkgdata() {
write_if_exists(sf, pkg, 'pkg_prerm')
sf.close()
+ package_stagefile(subdata_file, d)
+ #if pkgdatadir2:
+ # bb.copyfile(subdata_file, pkgdatadir2 + "/runtime/%s" % pkg)
+
allow_empty = bb.data.getVar('ALLOW_EMPTY_%s' % pkg, d, 1)
if not allow_empty:
allow_empty = bb.data.getVar('ALLOW_EMPTY', d, 1)
@@ -509,18 +519,21 @@ python emit_pkgdata() {
os.chdir(root)
g = glob('*')
if g or allow_empty == "1":
- packagedfile = bb.data.expand('${PKGDATA_DIR}/runtime/%s.packaged' % pkg, d)
+ packagedfile = pkgdatadir + '/runtime/%s.packaged' % pkg
file(packagedfile, 'w').close()
+ package_stagefile(packagedfile, d)
+ if pstageactive == "1":
+ bb.utils.unlockfile(lf)
}
emit_pkgdata[dirs] = "${PKGDATA_DIR}/runtime"
ldconfig_postinst_fragment() {
if [ x"$D" = "x" ]; then
- ldconfig
+ [ -x /sbin/ldconfig ] && /sbin/ldconfig
fi
}
-SHLIBSDIR = "${STAGING_DIR}/${HOST_SYS}/shlibs"
+SHLIBSDIR = "${STAGING_DIR_HOST}/shlibs"
python package_do_shlibs() {
import os, re, os.path
@@ -550,6 +563,10 @@ python package_do_shlibs() {
shlibs_dir = bb.data.getVar('SHLIBSDIR', d, 1)
bb.mkdirhier(shlibs_dir)
+ pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
+ if pstageactive == "1":
+ lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
+
needed = {}
private_libs = bb.data.getVar('PRIVATE_LIBS', d, 1)
for pkg in packages.split():
@@ -591,9 +608,11 @@ python package_do_shlibs() {
for s in sonames:
fd.write(s + '\n')
fd.close()
+ package_stagefile(shlibs_file, d)
fd = open(shver_file, 'w')
fd.write(ver + '\n')
fd.close()
+ package_stagefile(shver_file, d)
if needs_ldconfig:
bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg)
postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1)
@@ -602,6 +621,9 @@ python package_do_shlibs() {
postinst += bb.data.getVar('ldconfig_postinst_fragment', d, 1)
bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
+ if pstageactive == "1":
+ bb.utils.unlockfile(lf)
+
shlib_provider = {}
list_re = re.compile('^(.*)\.list$')
for dir in [shlibs_dir]:
@@ -623,6 +645,16 @@ python package_do_shlibs() {
for l in lines:
shlib_provider[l.rstrip()] = (dep_pkg, lib_ver)
+ assumed_libs = bb.data.getVar('ASSUME_SHLIBS', d, 1)
+ if assumed_libs:
+ for e in assumed_libs.split():
+ l, dep_pkg = e.split(":")
+ lib_ver = None
+ dep_pkg = dep_pkg.rsplit("_", 1)
+ if len(dep_pkg) == 2:
+ lib_ver = dep_pkg[1]
+ dep_pkg = dep_pkg[0]
+ shlib_provider[l] = (dep_pkg, lib_ver)
for pkg in packages.split():
bb.debug(2, "calculating shlib requirements for %s" % pkg)
@@ -706,6 +738,10 @@ python package_do_pkgconfig () {
if hdr == 'Requires':
pkgconfig_needed[pkg] += exp.replace(',', ' ').split()
+ pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
+ if pstageactive == "1":
+ lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
+
for pkg in packages.split():
pkgs_file = os.path.join(shlibs_dir, pkg + ".pclist")
if os.path.exists(pkgs_file):
@@ -715,6 +751,7 @@ python package_do_pkgconfig () {
for p in pkgconfig_provided[pkg]:
f.write('%s\n' % p)
f.close()
+ package_stagefile(pkgs_file, d)
for dir in [shlibs_dir]:
if not os.path.exists(dir):
@@ -749,6 +786,10 @@ python package_do_pkgconfig () {
for dep in deps:
fd.write(dep + '\n')
fd.close()
+ package_stagefile(deps_file, d)
+
+ if pstageactive == "1":
+ bb.utils.unlockfile(lf)
}
python read_shlibdeps () {