diff options
100 files changed, 3476 insertions, 325 deletions
diff --git a/classes/debian.bbclass b/classes/debian.bbclass index d66c1fc763..5688dad93b 100644 --- a/classes/debian.bbclass +++ b/classes/debian.bbclass @@ -1,3 +1,11 @@ +STAGING_PKGMAPS_DIR = "${STAGING_DIR}/pkgmaps/debian" + +# Debain package renaming only occurs when a package is built +# We therefore have to make sure we build all runtime packages +# before building the current package to make the packages runtime +# depends are correct +BUILD_ALL_DEPS = "1" + python debian_package_name_hook () { import glob, copy, stat, errno, re @@ -74,7 +82,7 @@ python debian_package_name_hook () { if soname_result: (pkgname, devname) = soname_result for pkg in packages.split(): - if (bb.data.getVar('PKG_' + pkg, d)): + if (bb.data.getVar('PKG_' + pkg, d) or bb.data.getVar('DEBIAN_NOAUTONAME_' + pkg, d)): continue if pkg == orig_pkg: newpkg = pkgname diff --git a/classes/efl.bbclass b/classes/efl.bbclass index b438ca61b4..e5968b9aec 100644 --- a/classes/efl.bbclass +++ b/classes/efl.bbclass @@ -73,9 +73,9 @@ do_stage_append () { fi } -PACKAGES = "${SRCNAME} ${SRCNAME}-themes ${SRCNAME}-dev ${SRCNAME}-examples" -FILES_${SRCNAME} = "${libdir}/lib*.so*" -FILES_${SRCNAME}-themes = "${datadir}/${SRCNAME}/themes ${datadir}/${SRCNAME}/data ${datadir}/${SRCNAME}/fonts ${datadir}/${SRCNAME}/pointers ${datadir}/${SRCNAME}/images ${datadir}/${SRCNAME}/users ${datadir}/${SRCNAME}/images ${datadir}/${SRCNAME}/styles" -FILES_${SRCNAME}-dev += "${bindir}/${SRCNAME}-config ${libdir}/pkgconfig ${libdir}/lib*.?a ${datadir}/${SRCNAME}/include" -FILES_${SRCNAME}-examples = "${bindir} ${datadir}" +PACKAGES = "${PN} ${PN}-themes ${PN}-dev ${PN}-examples " +FILES_${PN} = "${libdir}/lib*.so*" +FILES_${PN}-themes = "${datadir}/${PN}/themes ${datadir}/${PN}/data ${datadir}/${PN}/fonts ${datadir}/${PN}/pointers ${datadir}/${PN}/images ${datadir}/${PN}/users ${datadir}/${PN}/images ${datadir}/${PN}/styles" +FILES_${PN}-dev = "${bindir}/${PN}-config ${libdir}/pkgconfig ${libdir}/lib*.?a ${libdir}/lib*.a" +FILES_${PN}-examples = "${bindir} ${datadir}" diff --git a/classes/insane.bbclass b/classes/insane.bbclass new file mode 100644 index 0000000000..067fa64dff --- /dev/null +++ b/classes/insane.bbclass @@ -0,0 +1,32 @@ +# +# BB Class inspired by ebuild.sh +# +# As I will be copying code from from ebuild.sh this is +# Copyright Gentoo Foundation 1999-2006 +# GPLv2 +# +# This class will test files after installation for certain +# security issues and other kind of issues. +# +# Checks we do: +# -Check the ownership and permissions +# -Check the RUNTIME path for the $TMPDIR +# +# Checks that are planned: +# -Check installed and stages .la files + + +# +# We need to have the scanelf utility as soon as +# possible. +# +DEPENDS_prepend = " pax-utilities-native " + +# We play a special package function +inherit packages + + +PACKAGEFUNCS += "do_package_qa" + +python do_package_qa () { +} diff --git a/classes/package.bbclass b/classes/package.bbclass index fd8d1b7b09..ab1cea37c0 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -1,6 +1,73 @@ def legitimize_package_name(s): return s.lower().replace('_', '-').replace('@', '+').replace(',', '+').replace('/', '-') +STAGING_PKGMAPS_DIR ?= "${STAGING_DIR}/pkgmaps" + +def add_package_mapping (pkg, new_name, d): + import bb, os + + def encode(str): + import codecs + c = codecs.getencoder("string_escape") + return c(str)[0] + + pmap_dir = bb.data.getVar('STAGING_PKGMAPS_DIR', d, 1) + + bb.mkdirhier(pmap_dir) + + data_file = os.path.join(pmap_dir, pkg) + + f = open(data_file, 'w') + f.write("%s\n" % encode(new_name)) + f.close() + +def get_package_mapping (pkg, d): + import bb, os + + def decode(str): + import codecs + c = codecs.getdecoder("string_escape") + return c(str)[0] + + data_file = bb.data.expand("${STAGING_PKGMAPS_DIR}/%s" % pkg, d) + + if os.access(data_file, os.R_OK): + f = file(data_file, 'r') + lines = f.readlines() + f.close() + for l in lines: + return decode(l).strip() + return pkg + +def runtime_mapping_rename (varname, d): + import bb, os + + #bb.note("%s before: %s" % (varname, bb.data.getVar(varname, d, 1))) + + new_depends = [] + for depend in explode_deps(bb.data.getVar(varname, d, 1) or ""): + # Have to be careful with any version component of the depend + split_depend = depend.split(' (') + new_depend = get_package_mapping(split_depend[0].strip(), d) + if len(split_depend) > 1: + new_depends.append("%s (%s" % (new_depend, split_depend[1])) + else: + new_depends.append(new_depend) + + bb.data.setVar(varname, " ".join(new_depends) or None, d) + + #bb.note("%s after: %s" % (varname, bb.data.getVar(varname, d, 1))) + +python package_mapping_rename_hook () { + runtime_mapping_rename("RDEPENDS", d) + runtime_mapping_rename("RRECOMMENDS", d) + runtime_mapping_rename("RSUGGESTS", d) + runtime_mapping_rename("RPROVIDES", d) + runtime_mapping_rename("RREPLACES", d) + runtime_mapping_rename("RCONFLICTS", d) +} + + def do_split_packages(d, root, file_regex, output_pattern, description, postinst=None, recursive=False, hook=None, extra_depends=None, aux_files_pattern=None, postrm=None, allow_dirs=False, prepend=False, match_path=False): import os, os.path, bb @@ -240,8 +307,11 @@ python populate_packages () { bb.build.exec_func("package_name_hook", d) for pkg in packages.split(): - if bb.data.getVar('PKG_%s' % pkg, d, 1) is None: + pkgname = bb.data.getVar('PKG_%s' % pkg, d, 1) + if pkgname is None: bb.data.setVar('PKG_%s' % pkg, pkg, d) + else: + add_package_mapping(pkg, pkgname, d) dangling_links = {} pkg_files = {} @@ -641,5 +711,5 @@ python package_do_package () { do_package[dirs] = "${D}" populate_packages[dirs] = "${D}" -EXPORT_FUNCTIONS do_package do_shlibs do_split_locales +EXPORT_FUNCTIONS do_package do_shlibs do_split_locales mapping_rename_hook addtask package before do_build after do_populate_staging diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass index a70b1e8cdd..9ae526bb3b 100644 --- a/classes/package_ipk.bbclass +++ b/classes/package_ipk.bbclass @@ -165,6 +165,9 @@ python do_package_ipk () { ctrlfile.close() raise bb.build.FuncFailed("Missing field for ipk generation: %s" % value) # more fields + + bb.build.exec_func("mapping_rename_hook", localdata) + rdepends = explode_deps(bb.data.getVar("RDEPENDS", localdata, 1) or "") rrecommends = explode_deps(bb.data.getVar("RRECOMMENDS", localdata, 1) or "") rsuggests = (bb.data.getVar("RSUGGESTS", localdata, 1) or "").split() diff --git a/conf/bitbake.conf b/conf/bitbake.conf index 89ab4ff924..c28e3a7e22 100644 --- a/conf/bitbake.conf +++ b/conf/bitbake.conf @@ -304,6 +304,7 @@ XORG_MIRROR = "http://xorg.freedesktop.org/releases" GNOME_MIRROR = "http://ftp.gnome.org/pub/GNOME/sources" FREEBSD_MIRROR = "ftp://ftp.freebsd.org/pub/FreeBSD/" HANDHELDS_CVS = "cvs://anoncvs:anoncvs@anoncvs.handhelds.org/cvs" +GENTOO_MIRROR = "http://distro.ibiblio.org/pub/linux/distributions/gentoo/distfiles" # You can use the m |
