summaryrefslogtreecommitdiffstats
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)
downloadpoky-7c097c78121bc03a105116ff46de4d3ce3fc245f.tar.gz
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 55d9684683..eb43856c55 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -152,7 +152,7 @@ def runstrip(file, d):
152 # If the file is in a .debug directory it was already stripped, 152 # If the file is in a .debug directory it was already stripped,
153 # don't do it again... 153 # don't do it again...
154 if os.path.dirname(file).endswith(".debug"): 154 if os.path.dirname(file).endswith(".debug"):
155 bb.note("Already run strip") 155 bb.note("Already ran strip")
156 return 0 156 return 0
157 157
158 strip = bb.data.getVar("STRIP", d, 1) 158 strip = bb.data.getVar("STRIP", d, 1)
@@ -472,25 +472,31 @@ python emit_pkgdata() {
472 if val: 472 if val:
473 f.write('%s_%s: %s\n' % (var, pkg, encode(val))) 473 f.write('%s_%s: %s\n' % (var, pkg, encode(val)))
474 474
475 packages = bb.data.getVar('PACKAGES', d, 1) 475 packages = bb.data.getVar('PACKAGES', d, True)
476 pkgdatadir = bb.data.getVar('PKGDATA_DIR', d, True)
477
478 pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
479 if pstageactive == "1":
480 lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
476 481
477 data_file = bb.data.expand("${PKGDATA_DIR}/${PN}", d) 482 data_file = pkgdatadir + bb.data.expand("/${PN}" , d)
478 f = open(data_file, 'w') 483 f = open(data_file, 'w')
479 f.write("PACKAGES: %s\n" % packages) 484 f.write("PACKAGES: %s\n" % packages)
480 f.close() 485 f.close()
486 package_stagefile(data_file, d)
481 487
482 workdir = bb.data.getVar('WORKDIR', d, 1) 488 workdir = bb.data.getVar('WORKDIR', d, 1)
483 489
484 for pkg in packages.split(): 490 for pkg in packages.split():
485 subdata_file = bb.data.expand("${PKGDATA_DIR}/runtime/%s" % pkg, d) 491 subdata_file = pkgdatadir + "/runtime/%s" % pkg
486 sf = open(subdata_file, 'w') 492 sf = open(subdata_file, 'w')
487 write_if_exists(sf, pkg, 'PN') 493 write_if_exists(sf, pkg, 'PN')
494 write_if_exists(sf, pkg, 'PR')
488 write_if_exists(sf, pkg, 'DESCRIPTION') 495 write_if_exists(sf, pkg, 'DESCRIPTION')
489 write_if_exists(sf, pkg, 'RDEPENDS') 496 write_if_exists(sf, pkg, 'RDEPENDS')
490 write_if_exists(sf, pkg, 'RPROVIDES') 497 write_if_exists(sf, pkg, 'RPROVIDES')
491 write_if_exists(sf, pkg, 'RRECOMMENDS') 498 write_if_exists(sf, pkg, 'RRECOMMENDS')
492 write_if_exists(sf, pkg, 'RSUGGESTS') 499 write_if_exists(sf, pkg, 'RSUGGESTS')
493 write_if_exists(sf, pkg, 'RPROVIDES')
494 write_if_exists(sf, pkg, 'RREPLACES') 500 write_if_exists(sf, pkg, 'RREPLACES')
495 write_if_exists(sf, pkg, 'RCONFLICTS') 501 write_if_exists(sf, pkg, 'RCONFLICTS')
496 write_if_exists(sf, pkg, 'PKG') 502 write_if_exists(sf, pkg, 'PKG')
@@ -502,6 +508,10 @@ python emit_pkgdata() {
502 write_if_exists(sf, pkg, 'pkg_prerm') 508 write_if_exists(sf, pkg, 'pkg_prerm')
503 sf.close() 509 sf.close()
504 510
511 package_stagefile(subdata_file, d)
512 #if pkgdatadir2:
513 # bb.copyfile(subdata_file, pkgdatadir2 + "/runtime/%s" % pkg)
514
505 allow_empty = bb.data.getVar('ALLOW_EMPTY_%s' % pkg, d, 1) 515 allow_empty = bb.data.getVar('ALLOW_EMPTY_%s' % pkg, d, 1)
506 if not allow_empty: 516 if not allow_empty:
507 allow_empty = bb.data.getVar('ALLOW_EMPTY', d, 1) 517 allow_empty = bb.data.getVar('ALLOW_EMPTY', d, 1)
@@ -509,18 +519,21 @@ python emit_pkgdata() {
509 os.chdir(root) 519 os.chdir(root)
510 g = glob('*') 520 g = glob('*')
511 if g or allow_empty == "1": 521 if g or allow_empty == "1":
512 packagedfile = bb.data.expand('${PKGDATA_DIR}/runtime/%s.packaged' % pkg, d) 522 packagedfile = pkgdatadir + '/runtime/%s.packaged' % pkg
513 file(packagedfile, 'w').close() 523 file(packagedfile, 'w').close()
524 package_stagefile(packagedfile, d)
525 if pstageactive == "1":
526 bb.utils.unlockfile(lf)
514} 527}
515emit_pkgdata[dirs] = "${PKGDATA_DIR}/runtime" 528emit_pkgdata[dirs] = "${PKGDATA_DIR}/runtime"
516 529
517ldconfig_postinst_fragment() { 530ldconfig_postinst_fragment() {
518if [ x"$D" = "x" ]; then 531if [ x"$D" = "x" ]; then
519 ldconfig 532 [ -x /sbin/ldconfig ] && /sbin/ldconfig
520fi 533fi
521} 534}
522 535
523SHLIBSDIR = "${STAGING_DIR}/${HOST_SYS}/shlibs" 536SHLIBSDIR = "${STAGING_DIR_HOST}/shlibs"
524 537
525python package_do_shlibs() { 538python package_do_shlibs() {
526 import os, re, os.path 539 import os, re, os.path
@@ -550,6 +563,10 @@ python package_do_shlibs() {
550 shlibs_dir = bb.data.getVar('SHLIBSDIR', d, 1) 563 shlibs_dir = bb.data.getVar('SHLIBSDIR', d, 1)
551 bb.mkdirhier(shlibs_dir) 564 bb.mkdirhier(shlibs_dir)
552 565
566 pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
567 if pstageactive == "1":
568 lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
569
553 needed = {} 570 needed = {}
554 private_libs = bb.data.getVar('PRIVATE_LIBS', d, 1) 571 private_libs = bb.data.getVar('PRIVATE_LIBS', d, 1)
555 for pkg in packages.split(): 572 for pkg in packages.split():
@@ -591,9 +608,11 @@ python package_do_shlibs() {
591 for s in sonames: 608 for s in sonames:
592 fd.write(s + '\n') 609 fd.write(s + '\n')
593 fd.close() 610 fd.close()
611 package_stagefile(shlibs_file, d)
594 fd = open(shver_file, 'w') 612 fd = open(shver_file, 'w')
595 fd.write(ver + '\n') 613 fd.write(ver + '\n')
596 fd.close() 614 fd.close()
615 package_stagefile(shver_file, d)
597 if needs_ldconfig: 616 if needs_ldconfig:
598 bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg) 617 bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg)
599 postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) 618 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() {
602 postinst += bb.data.getVar('ldconfig_postinst_fragment', d, 1) 621 postinst += bb.data.getVar('ldconfig_postinst_fragment', d, 1)
603 bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) 622 bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
604 623
624 if pstageactive == "1":
625 bb.utils.unlockfile(lf)
626
605 shlib_provider = {} 627 shlib_provider = {}
606 list_re = re.compile('^(.*)\.list$') 628 list_re = re.compile('^(.*)\.list$')
607 for dir in [shlibs_dir]: 629 for dir in [shlibs_dir]:
@@ -623,6 +645,16 @@ python package_do_shlibs() {
623 for l in lines: 645 for l in lines:
624 shlib_provider[l.rstrip()] = (dep_pkg, lib_ver) 646 shlib_provider[l.rstrip()] = (dep_pkg, lib_ver)
625 647
648 assumed_libs = bb.data.getVar('ASSUME_SHLIBS', d, 1)
649 if assumed_libs:
650 for e in assumed_libs.split():
651 l, dep_pkg = e.split(":")
652 lib_ver = None
653 dep_pkg = dep_pkg.rsplit("_", 1)
654 if len(dep_pkg) == 2:
655 lib_ver = dep_pkg[1]
656 dep_pkg = dep_pkg[0]
657 shlib_provider[l] = (dep_pkg, lib_ver)
626 658
627 for pkg in packages.split(): 659 for pkg in packages.split():
628 bb.debug(2, "calculating shlib requirements for %s" % pkg) 660 bb.debug(2, "calculating shlib requirements for %s" % pkg)
@@ -706,6 +738,10 @@ python package_do_pkgconfig () {
706 if hdr == 'Requires': 738 if hdr == 'Requires':
707 pkgconfig_needed[pkg] += exp.replace(',', ' ').split() 739 pkgconfig_needed[pkg] += exp.replace(',', ' ').split()
708 740
741 pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
742 if pstageactive == "1":
743 lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
744
709 for pkg in packages.split(): 745 for pkg in packages.split():
710 pkgs_file = os.path.join(shlibs_dir, pkg + ".pclist") 746 pkgs_file = os.path.join(shlibs_dir, pkg + ".pclist")
711 if os.path.exists(pkgs_file): 747 if os.path.exists(pkgs_file):
@@ -715,6 +751,7 @@ python package_do_pkgconfig () {
715 for p in pkgconfig_provided[pkg]: 751 for p in pkgconfig_provided[pkg]:
716 f.write('%s\n' % p) 752 f.write('%s\n' % p)
717 f.close() 753 f.close()
754 package_stagefile(pkgs_file, d)
718 755
719 for dir in [shlibs_dir]: 756 for dir in [shlibs_dir]:
720 if not os.path.exists(dir): 757 if not os.path.exists(dir):
@@ -749,6 +786,10 @@ python package_do_pkgconfig () {
749 for dep in deps: 786 for dep in deps:
750 fd.write(dep + '\n') 787 fd.write(dep + '\n')
751 fd.close() 788 fd.close()
789 package_stagefile(deps_file, d)
790
791 if pstageactive == "1":
792 bb.utils.unlockfile(lf)
752} 793}
753 794
754python read_shlibdeps () { 795python read_shlibdeps () {