diff options
author | Richard Purdie <richard@openedhand.com> | 2007-09-01 22:17:06 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-09-01 22:17:06 +0000 |
commit | c6938aad87ce4b9ce25ecd020ecddfe62b319bcf (patch) | |
tree | bf38fd54cc10deb22025853094b3e33c4043d1b2 /meta/classes | |
parent | a7c63ec4828e08e0812f69a5be04422e5dd7b30a (diff) | |
download | openembedded-core-c6938aad87ce4b9ce25ecd020ecddfe62b319bcf.tar.gz openembedded-core-c6938aad87ce4b9ce25ecd020ecddfe62b319bcf.tar.bz2 openembedded-core-c6938aad87ce4b9ce25ecd020ecddfe62b319bcf.zip |
Factor ipkg index and conf file creation into package_ipk.bbclass
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2637 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/meta.bbclass | 4 | ||||
-rw-r--r-- | meta/classes/package_ipk.bbclass | 44 | ||||
-rw-r--r-- | meta/classes/rootfs_ipk.bbclass | 35 | ||||
-rw-r--r-- | meta/classes/task.bbclass | 27 |
4 files changed, 80 insertions, 30 deletions
diff --git a/meta/classes/meta.bbclass b/meta/classes/meta.bbclass new file mode 100644 index 0000000000..d35c40bccd --- /dev/null +++ b/meta/classes/meta.bbclass @@ -0,0 +1,4 @@ + +PACKAGES = "" + +do_build[recrdeptask] = "do_build"
\ No newline at end of file diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index d88d11b994..1175d1e751 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass @@ -4,6 +4,9 @@ BOOTSTRAP_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" IMAGE_PKGTYPE ?= "ipk" +IPKGCONF_TARGET = "${STAGING_ETCDIR_NATIVE}/ipkg.conf" +IPKGCONF_SDK = "${STAGING_ETCDIR_NATIVE}/ipkg-sdk.conf" + python package_ipk_fn () { from bb import data bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d) @@ -60,6 +63,47 @@ python package_ipk_install () { raise bb.build.FuncFailed } +# +# Update the Packages index files in ${DEPLOY_DIR_IPK} +# +package_update_index_ipk () { + set -x + + ipkgarchs="${PACKAGE_ARCHS}" + + if [ ! -z "${DEPLOY_KEEP_PACKAGES}" ]; then + return + fi + + touch ${DEPLOY_DIR_IPK}/Packages + ipkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK} + + for arch in $ipkgarchs; do + if [ -e ${DEPLOY_DIR_IPK}/$arch/ ] ; then + touch ${DEPLOY_DIR_IPK}/$arch/Packages + ipkg-make-index -r ${DEPLOY_DIR_IPK}/$arch/Packages -p ${DEPLOY_DIR_IPK}/$arch/Packages -l ${DEPLOY_DIR_IPK}/$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/$arch/ + fi + done +} + +# +# Generate an ipkg conf file ${IPKGCONF_TARGET} suitable for use against +# the target system and an ipkg conf file ${IPKGCONF_SDK} suitable for +# use against the host system in sdk builds +# +package_generate_ipkg_conf () { + mkdir -p ${STAGING_ETCDIR_NATIVE}/ + echo "src oe file:${DEPLOY_DIR_IPK}" > ${IPKGCONF_TARGET} + echo "src oe file:${DEPLOY_DIR_IPK}" > ${IPKGCONF_SDK} + ipkgarchs="${PACKAGE_ARCHS}" + priority=1 + for arch in $ipkgarchs; do + echo "arch $arch $priority" >> ${IPKGCONF_TARGET} + echo "arch ${BUILD_ARCH}-$arch-sdk $priority" >> ${IPKGCONF_SDK} + priority=$(expr $priority + 5) + done +} + python do_package_ipk () { import sys, re, fcntl, copy diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index 3709f89743..3c9d03f9dd 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass @@ -8,41 +8,16 @@ do_rootfs[depends] += "ipkg-native:do_populate_staging ipkg-utils-native:do_populate_staging" do_rootfs[recrdeptask] += "do_package_write_ipk" -IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}" - -rootfs_ipk_do_indexes () { - set -x - - ipkgarchs="${PACKAGE_ARCHS}" - - if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then - touch ${DEPLOY_DIR_IPK}/Packages - ipkg-make-index -r ${DEPLOY_DIR_IPK}/Packages -p ${DEPLOY_DIR_IPK}/Packages -l ${DEPLOY_DIR_IPK}/Packages.filelist -m ${DEPLOY_DIR_IPK} - fi - - for arch in $ipkgarchs; do - if [ -z "${DEPLOY_KEEP_PACKAGES}" ]; then - if [ -e ${DEPLOY_DIR_IPK}/$arch/ ] ; then - touch ${DEPLOY_DIR_IPK}/$arch/Packages - ipkg-make-index -r ${DEPLOY_DIR_IPK}/$arch/Packages -p ${DEPLOY_DIR_IPK}/$arch/Packages -l ${DEPLOY_DIR_IPK}/$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/$arch/ - fi - fi - done -} +IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS}" fakeroot rootfs_ipk_do_rootfs () { set -x - rootfs_ipk_do_indexes + package_update_index_ipk + package_generate_ipkg_conf mkdir -p ${T} - echo "src oe file:${DEPLOY_DIR_IPK}" > ${T}/ipkg.conf - ipkgarchs="${PACKAGE_ARCHS}" - priority=1 - for arch in $ipkgarchs; do - echo "arch $arch $priority" >> ${T}/ipkg.conf - priority=$(expr $priority + 5) - done + ipkg-cl ${IPKG_ARGS} update if [ ! -z "${LINGUAS_INSTALL}" ]; then ipkg-cl ${IPKG_ARGS} install glibc-localedata-i18n @@ -58,7 +33,7 @@ fakeroot rootfs_ipk_do_rootfs () { export OFFLINE_ROOT=${IMAGE_ROOTFS} export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS} mkdir -p ${IMAGE_ROOTFS}/etc/ipkg/ - grep "^arch" ${T}/ipkg.conf >${IMAGE_ROOTFS}/etc/ipkg/arch.conf + grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}/etc/ipkg/arch.conf for i in ${IMAGE_ROOTFS}${libdir}/ipkg/info/*.preinst; do if [ -f $i ] && ! sh $i; then diff --git a/meta/classes/task.bbclass b/meta/classes/task.bbclass new file mode 100644 index 0000000000..4edd704829 --- /dev/null +++ b/meta/classes/task.bbclass @@ -0,0 +1,27 @@ +# Task packages are only used to pull in other packages +# via their dependencies. They are empty. +ALLOW_EMPTY = "1" + +# By default, only the task package itself is in PACKAGES. +# -dbg and -dev flavours are handled by the anonfunc below. +# This means that task recipes used to build multiple task +# packages have to modify PACKAGES after inheriting task.bbclass. +PACKAGES = "${PN}" + +# By default, task packages do not depend on a certain architecture. +# Only if dependencies are modified by MACHINE_FEATURES, packages +# need to be set to MACHINE_ARCH after inheriting task.bbclass +PACKAGE_ARCH = "all" + +# This automatically adds -dbg and -dev flavours of all PACKAGES +# to the list. Their dependencies (RRECOMMENDS) are handled as usual +# by package_depchains in a following step. +python () { + packages = bb.data.getVar('PACKAGES', d, 1).split() + genpackages = [] + for pkg in packages: + for postfix in ['-dbg', '-dev']: + genpackages.append(pkg+postfix) + bb.data.setVar('PACKAGES', ' '.join(packages+genpackages), d) +} + |