diff options
Diffstat (limited to 'meta/recipes-extended/cpio/cpio_2.15.bb')
-rw-r--r-- | meta/recipes-extended/cpio/cpio_2.15.bb | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/meta/recipes-extended/cpio/cpio_2.15.bb b/meta/recipes-extended/cpio/cpio_2.15.bb new file mode 100644 index 0000000000..fa011251e2 --- /dev/null +++ b/meta/recipes-extended/cpio/cpio_2.15.bb | |||
@@ -0,0 +1,90 @@ | |||
1 | SUMMARY = "GNU cpio is a program to manage archives of files" | ||
2 | DESCRIPTION = "GNU cpio is a tool for creating and extracting archives, or copying files from one place to \ | ||
3 | another. It handles a number of cpio formats as well as reading and writing tar files." | ||
4 | HOMEPAGE = "http://www.gnu.org/software/cpio/" | ||
5 | SECTION = "base" | ||
6 | LICENSE = "GPL-3.0-only" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949" | ||
8 | |||
9 | SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \ | ||
10 | file://run-ptest \ | ||
11 | file://test.sh \ | ||
12 | " | ||
13 | |||
14 | SRC_URI[sha256sum] = "efa50ef983137eefc0a02fdb51509d624b5e3295c980aa127ceee4183455499e" | ||
15 | |||
16 | inherit autotools gettext texinfo ptest | ||
17 | |||
18 | CVE_STATUS[CVE-2010-4226] = "not-applicable-platform: Issue applies to use of cpio in SUSE/OBS" | ||
19 | CVE_STATUS[CVE-2023-7216] = "disputed: intended behaviour, see https://lists.gnu.org/archive/html/bug-cpio/2024-03/msg00000.html" | ||
20 | |||
21 | EXTRA_OECONF += "DEFAULT_RMT_DIR=${sbindir}" | ||
22 | |||
23 | CFLAGS += "-std=gnu17" | ||
24 | |||
25 | do_install () { | ||
26 | autotools_do_install | ||
27 | if [ "${base_bindir}" != "${bindir}" ]; then | ||
28 | install -d ${D}${base_bindir}/ | ||
29 | mv "${D}${bindir}/cpio" "${D}${base_bindir}/cpio" | ||
30 | if [ "${sbindir}" != "${bindir}" ]; then | ||
31 | rmdir ${D}${bindir}/ | ||
32 | fi | ||
33 | fi | ||
34 | |||
35 | # Avoid conflicts with the version from tar | ||
36 | mv "${D}${mandir}/man8/rmt.8" "${D}${mandir}/man8/rmt-cpio.8" | ||
37 | } | ||
38 | |||
39 | do_compile_ptest() { | ||
40 | # Forcibly regenerate this script so we get our --am-fmt option | ||
41 | rm -f ${S}/tests/testsuite | ||
42 | oe_runmake -C ${B}/tests/ testsuite | ||
43 | |||
44 | oe_runmake -C ${B}/tests/ genfile | ||
45 | } | ||
46 | |||
47 | do_install_ptest() { | ||
48 | install -d ${D}${PTEST_PATH}/tests/ | ||
49 | sed -i "/abs_/d" ${B}/tests/atconfig | ||
50 | install --mode=755 ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/ | ||
51 | sed -i "s%${B}/tests:%%g" ${B}/tests/atlocal | ||
52 | sed -i "s%${B}/src:%%g" ${B}/tests/atlocal | ||
53 | install --mode=755 ${B}/tests/atlocal ${D}${PTEST_PATH}/tests/ | ||
54 | install --mode=755 ${B}/tests/genfile ${D}${PTEST_PATH}/tests/ | ||
55 | install --mode=755 ${S}/tests/testsuite ${D}${PTEST_PATH}/tests/ | ||
56 | install --mode=755 ${UNPACKDIR}/test.sh ${D}${PTEST_PATH}/test.sh | ||
57 | sed -i "s#@PTEST_PATH@#${PTEST_PATH}#g" ${D}${PTEST_PATH}/test.sh | ||
58 | } | ||
59 | |||
60 | # ptest.bbclass currently chowns the ptest directory explicitly, so we need to | ||
61 | # change permission after that has happened so the ptest user can write a | ||
62 | # temporary directory. | ||
63 | do_install_ptest_base:append() { | ||
64 | chgrp -R ptest ${D}${PTEST_PATH}/ | ||
65 | chmod -R g+w ${D}${PTEST_PATH}/ | ||
66 | } | ||
67 | |||
68 | # The tests need to run as a non-root user, so pull in the ptest user | ||
69 | DEPENDS:append:class-target = " ${@bb.utils.contains('PTEST_ENABLED', '1', 'ptest-runner', '', d)}" | ||
70 | PACKAGE_WRITE_DEPS:append:class-target = " ${@bb.utils.contains('PTEST_ENABLED', '1', 'ptest-runner', '', d)}" | ||
71 | |||
72 | RDEPENDS:${PN}-ptest += "ptest-runner coreutils" | ||
73 | |||
74 | PACKAGES =+ "${PN}-rmt" | ||
75 | |||
76 | FILES:${PN}-rmt = "${sbindir}/rmt*" | ||
77 | |||
78 | inherit update-alternatives | ||
79 | |||
80 | ALTERNATIVE_PRIORITY = "100" | ||
81 | |||
82 | ALTERNATIVE:${PN} = "cpio" | ||
83 | ALTERNATIVE:${PN}-rmt = "rmt" | ||
84 | |||
85 | ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio" | ||
86 | |||
87 | ALTERNATIVE_PRIORITY[rmt] = "50" | ||
88 | ALTERNATIVE_LINK_NAME[rmt] = "${sbindir}/rmt" | ||
89 | |||
90 | BBCLASSEXTEND = "native nativesdk" | ||