diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2012-09-02 12:15:47 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-10 13:01:46 +0100 |
commit | 208ff62db4cf977828f16a906429f857e025a789 (patch) | |
tree | bdfd8c235efbf417c0d1bb993a0e117791ad27d8 /meta | |
parent | 4a015e57ccee4fec8ab1da6717f4e2d5c4bb9ff5 (diff) | |
download | poky-208ff62db4cf977828f16a906429f857e025a789.tar.gz |
bin_package.bbclass: binary package recipe class
This is used for the binary package recipe, it's been suggested that it
would be a useful feature to be able to easily take an RPM or similar
containing a software binary from a 3rd party software vendor and
integrate it into an image created by the build system.
* Brief introduction
- The binary pkg can be .rpm, .deb, .ipk and other formats which can
be unpacked by bitbake fetcher.
- Let bitbake unpack the bianry package, just like unpack the source
package.
- Skip the do_configure and do_compile.
- Install the files to ${D}
- Other steps are similar to the source package's recipe.
* Note:
- The "subdir" parameter in the SRC_URI is useful for the binary
package recipe, so I added an example in the comment.
- I have sent a patch to bitbake-devel mailing list to support
unpack the .rpm, .ipk, and .deb files.
[YOCTO #1592]
(From OE-Core rev: 7037f52909b8226d2afed4ac73c902d410afc112)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/bin_package.bbclass | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/classes/bin_package.bbclass b/meta/classes/bin_package.bbclass new file mode 100644 index 0000000000..a52b75be5c --- /dev/null +++ b/meta/classes/bin_package.bbclass | |||
@@ -0,0 +1,36 @@ | |||
1 | # | ||
2 | # ex:ts=4:sw=4:sts=4:et | ||
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
4 | # | ||
5 | # Common variable and task for the binary package recipe. | ||
6 | # Basic principle: | ||
7 | # * The files have been unpacked to ${S} by base.bbclass | ||
8 | # * Skip do_configure and do_compile | ||
9 | # * Use do_install to install the files to ${D} | ||
10 | # | ||
11 | # Note: | ||
12 | # The "subdir" parameter in the SRC_URI is useful when the input package | ||
13 | # is rpm, ipk, deb and so on, for example: | ||
14 | # | ||
15 | # SRC_URI = "http://foo.com/foo-1.0-r1.i586.rpm;subdir=foo-1.0" | ||
16 | # | ||
17 | # Then the files would be unpacked to ${WORKDIR}/foo-1.0, otherwise | ||
18 | # they would be in ${WORKDIR}. | ||
19 | # | ||
20 | |||
21 | # Skip the unwanted steps | ||
22 | do_configure[noexec] = "1" | ||
23 | do_compile[noexec] = "1" | ||
24 | |||
25 | # Install the files to ${D} | ||
26 | bin_package_do_install () { | ||
27 | # Do it carefully | ||
28 | [ -d "${S}" ] || exit 1 | ||
29 | cd ${S} || exit 1 | ||
30 | tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \ | ||
31 | | tar --no-same-owner -xpf - -C ${D} | ||
32 | } | ||
33 | |||
34 | FILES_${PN} = "/" | ||
35 | |||
36 | EXPORT_FUNCTIONS do_install | ||