1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7# Common variable and task for the binary package recipe.
8# Basic principle:
9# * The files have been unpacked to ${S} by base.bbclass
10# * Skip do_configure and do_compile
11# * Use do_install to install the files to ${D}
12#
13# Note:
14# The "subdir" parameter in the SRC_URI is useful when the input package
15# is rpm, ipk, deb and so on, for example:
16#
17# SRC_URI = "http://foo.com/foo-1.0-r1.i586.rpm;subdir=foo-1.0"
18#
19# Then the files would be unpacked to ${WORKDIR}/foo-1.0, otherwise
20# they would be in ${WORKDIR}.
21#
22
23# Skip the unwanted steps
24do_configure[noexec] = "1"
25do_compile[noexec] = "1"
26
27# Install the files to ${D}
28bin_package_do_install () {
29    # Do it carefully
30    [ -d "${S}" ] || exit 1
31    if [ -z "$(ls -A ${S})" ]; then
32        bbfatal bin_package has nothing to install. Be sure the SRC_URI unpacks into S.
33    fi
34    cd ${S}
35    install -d ${D}${base_prefix}
36    tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \
37        | tar --no-same-owner -xpf - -C ${D}${base_prefix}
38}
39
40FILES:${PN} = "/"
41
42EXPORT_FUNCTIONS do_install
43