blob: 560038d2a676e281c2aca0cfdac4b7a4ff764526 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "GNU cpio is a program to manage archives of files"
2DESCRIPTION = "GNU cpio is a tool for creating and extracting archives, or copying files from one place to \
3another. It handles a number of cpio formats as well as reading and writing tar files."
4HOMEPAGE = "http://www.gnu.org/software/cpio/"
5SECTION = "base"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00006LICENSE = "GPL-3.0-only"
Andrew Geissler82c905d2020-04-13 13:39:40 -05007LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
8
9SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \
Patrick Williamse760df82023-05-26 11:10:49 -050010 file://0001-configure-Include-needed-header-for-major-minor-macr.patch \
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060011 file://run-ptest \
Andrew Geissler3eeda902023-05-19 10:14:02 -050012 file://test.sh \
Andrew Geissler82c905d2020-04-13 13:39:40 -050013 "
14
Patrick Williamse760df82023-05-26 11:10:49 -050015SRC_URI[sha256sum] = "145a340fd9d55f0b84779a44a12d5f79d77c99663967f8cfa168d7905ca52454"
Andrew Geissler82c905d2020-04-13 13:39:40 -050016
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060017inherit autotools gettext texinfo ptest
Andrew Geissler82c905d2020-04-13 13:39:40 -050018
Andrew Geissler8f840682023-07-21 09:09:43 -050019CVE_STATUS[CVE-2010-4226] = "not-applicable-platform: Issue applies to use of cpio in SUSE/OBS"
William A. Kennington IIIac69b482021-06-02 12:28:27 -070020
Andrew Geissler82c905d2020-04-13 13:39:40 -050021EXTRA_OECONF += "DEFAULT_RMT_DIR=${sbindir}"
22
23do_install () {
24 autotools_do_install
25 if [ "${base_bindir}" != "${bindir}" ]; then
26 install -d ${D}${base_bindir}/
27 mv "${D}${bindir}/cpio" "${D}${base_bindir}/cpio"
Andrew Geissler475cb722020-07-10 16:00:51 -050028 if [ "${sbindir}" != "${bindir}" ]; then
29 rmdir ${D}${bindir}/
30 fi
Andrew Geissler82c905d2020-04-13 13:39:40 -050031 fi
32
33 # Avoid conflicts with the version from tar
34 mv "${D}${mandir}/man8/rmt.8" "${D}${mandir}/man8/rmt-cpio.8"
35}
36
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060037do_compile_ptest() {
38 oe_runmake -C ${B}/gnu/ check
39 oe_runmake -C ${B}/lib/ check
40 oe_runmake -C ${B}/rmt/ check
41 oe_runmake -C ${B}/src/ check
42 oe_runmake -C ${B}/tests/ genfile
43}
44
45do_install_ptest() {
46 install -d ${D}${PTEST_PATH}/tests/
47 sed -i "/abs_/d" ${B}/tests/atconfig
48 install --mode=755 ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/
49 sed -i "s%${B}/tests:%%g" ${B}/tests/atlocal
50 sed -i "s%${B}/src:%%g" ${B}/tests/atlocal
51 install --mode=755 ${B}/tests/atlocal ${D}${PTEST_PATH}/tests/
52 install --mode=755 ${B}/tests/genfile ${D}${PTEST_PATH}/tests/
53 install --mode=755 ${S}/tests/testsuite ${D}${PTEST_PATH}/tests/
Andrew Geissler3eeda902023-05-19 10:14:02 -050054 install --mode=755 ${WORKDIR}/test.sh ${D}${PTEST_PATH}/test.sh
55 sed -i "s#@PTEST_PATH@#${PTEST_PATH}#g" ${D}${PTEST_PATH}/test.sh
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060056}
57
Andrew Geissler3eeda902023-05-19 10:14:02 -050058# ptest.bbclass currently chowns the ptest directory explicitly, so we need to
59# change permission after that has happened so the ptest user can write a
60# temporary directory.
61do_install_ptest_base:append() {
62 chgrp -R ptest ${D}${PTEST_PATH}/
63 chmod -R g+w ${D}${PTEST_PATH}/
64}
65
66# The tests need to run as a non-root user, so pull in the ptest user
67DEPENDS:append:class-target = "${@bb.utils.contains('PTEST_ENABLED', '1', ' ptest-runner', '', d)}"
Andrew Geissler8f840682023-07-21 09:09:43 -050068PACKAGE_WRITE_DEPS:append:class-target = " ${MLPREFIX}ptest-runner"
Andrew Geissler3eeda902023-05-19 10:14:02 -050069
70RDEPENDS:${PN}-ptest += "ptest-runner"
71
Andrew Geissler82c905d2020-04-13 13:39:40 -050072PACKAGES =+ "${PN}-rmt"
73
Patrick Williams213cb262021-08-07 19:21:33 -050074FILES:${PN}-rmt = "${sbindir}/rmt*"
Andrew Geissler82c905d2020-04-13 13:39:40 -050075
76inherit update-alternatives
77
78ALTERNATIVE_PRIORITY = "100"
79
Patrick Williams213cb262021-08-07 19:21:33 -050080ALTERNATIVE:${PN} = "cpio"
81ALTERNATIVE:${PN}-rmt = "rmt"
Andrew Geissler82c905d2020-04-13 13:39:40 -050082
83ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio"
84
85ALTERNATIVE_PRIORITY[rmt] = "50"
86ALTERNATIVE_LINK_NAME[rmt] = "${sbindir}/rmt"
87
Andrew Geissler475cb722020-07-10 16:00:51 -050088BBCLASSEXTEND = "native nativesdk"