From fd1517e2b51a170f2427122c6b95396db251d827 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 10 Aug 2022 14:35:29 +0100 Subject: classes: Update classes to match new bitbake class scope functionality Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. (From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045) Signed-off-by: Richard Purdie --- meta/classes-recipe/bin_package.bbclass | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 meta/classes-recipe/bin_package.bbclass (limited to 'meta/classes-recipe/bin_package.bbclass') diff --git a/meta/classes-recipe/bin_package.bbclass b/meta/classes-recipe/bin_package.bbclass new file mode 100644 index 0000000000..3a1befc29c --- /dev/null +++ b/meta/classes-recipe/bin_package.bbclass @@ -0,0 +1,42 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +# Common variable and task for the binary package recipe. +# Basic principle: +# * The files have been unpacked to ${S} by base.bbclass +# * Skip do_configure and do_compile +# * Use do_install to install the files to ${D} +# +# Note: +# The "subdir" parameter in the SRC_URI is useful when the input package +# is rpm, ipk, deb and so on, for example: +# +# SRC_URI = "http://foo.com/foo-1.0-r1.i586.rpm;subdir=foo-1.0" +# +# Then the files would be unpacked to ${WORKDIR}/foo-1.0, otherwise +# they would be in ${WORKDIR}. +# + +# Skip the unwanted steps +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +# Install the files to ${D} +bin_package_do_install () { + # Do it carefully + [ -d "${S}" ] || exit 1 + if [ -z "$(ls -A ${S})" ]; then + bbfatal bin_package has nothing to install. Be sure the SRC_URI unpacks into S. + fi + cd ${S} + install -d ${D}${base_prefix} + tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \ + | tar --no-same-owner -xpf - -C ${D}${base_prefix} +} + +FILES:${PN} = "/" + +EXPORT_FUNCTIONS do_install -- cgit v1.2.3-54-g00ecf