Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 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" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 6 | LICENSE = "GPL-3.0-only" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949" |
| 8 | |
| 9 | SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \ |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 10 | file://0001-configure-Include-needed-header-for-major-minor-macr.patch \ |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 11 | file://run-ptest \ |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 12 | file://test.sh \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 13 | " |
| 14 | |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 15 | SRC_URI[sha256sum] = "145a340fd9d55f0b84779a44a12d5f79d77c99663967f8cfa168d7905ca52454" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 16 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 17 | inherit autotools gettext texinfo ptest |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 18 | |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 19 | CVE_STATUS[CVE-2010-4226] = "not-applicable-platform: Issue applies to use of cpio in SUSE/OBS" |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 20 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 21 | EXTRA_OECONF += "DEFAULT_RMT_DIR=${sbindir}" |
| 22 | |
| 23 | do_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 Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 28 | if [ "${sbindir}" != "${bindir}" ]; then |
| 29 | rmdir ${D}${bindir}/ |
| 30 | fi |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 31 | 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 Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 37 | do_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 | |
| 45 | do_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 Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 54 | 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 Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 56 | } |
| 57 | |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 58 | # 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. |
| 61 | do_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 |
| 67 | DEPENDS:append:class-target = "${@bb.utils.contains('PTEST_ENABLED', '1', ' ptest-runner', '', d)}" |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 68 | PACKAGE_WRITE_DEPS:append:class-target = " ${MLPREFIX}ptest-runner" |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 69 | |
| 70 | RDEPENDS:${PN}-ptest += "ptest-runner" |
| 71 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 72 | PACKAGES =+ "${PN}-rmt" |
| 73 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 74 | FILES:${PN}-rmt = "${sbindir}/rmt*" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 75 | |
| 76 | inherit update-alternatives |
| 77 | |
| 78 | ALTERNATIVE_PRIORITY = "100" |
| 79 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 80 | ALTERNATIVE:${PN} = "cpio" |
| 81 | ALTERNATIVE:${PN}-rmt = "rmt" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 82 | |
| 83 | ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio" |
| 84 | |
| 85 | ALTERNATIVE_PRIORITY[rmt] = "50" |
| 86 | ALTERNATIVE_LINK_NAME[rmt] = "${sbindir}/rmt" |
| 87 | |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 88 | BBCLASSEXTEND = "native nativesdk" |