diff options
Diffstat (limited to 'meta/recipes-extended/cpio')
6 files changed, 101 insertions, 112 deletions
diff --git a/meta/recipes-extended/cpio/cpio-2.13/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-extended/cpio/cpio-2.13/0001-Unset-need_charset_alias-when-building-for-musl.patch deleted file mode 100644 index 6ae213942c..0000000000 --- a/meta/recipes-extended/cpio/cpio-2.13/0001-Unset-need_charset_alias-when-building-for-musl.patch +++ /dev/null @@ -1,30 +0,0 @@ -From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Mon, 13 Apr 2015 17:02:13 -0700 -Subject: [PATCH] Unset need_charset_alias when building for musl - -localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 -which actually shoudl be fixed in gnulib and then all downstream -projects will get it eventually. For now we apply the fix to -coreutils - -Upstream-Status: Pending - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - lib/gnulib.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: cpio-2.11/gnu/Makefile.am -=================================================================== ---- cpio-2.11.orig/gnu/Makefile.am -+++ cpio-2.11/gnu/Makefile.am -@@ -734,7 +734,7 @@ install-exec-localcharset: all-local - case '$(host_os)' in \ - darwin[56]*) \ - need_charset_alias=true ;; \ -- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ -+ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ - need_charset_alias=false ;; \ - *) \ - need_charset_alias=true ;; \ diff --git a/meta/recipes-extended/cpio/cpio-2.13/0002-src-global.c-Remove-superfluous-declaration-of-progr.patch b/meta/recipes-extended/cpio/cpio-2.13/0002-src-global.c-Remove-superfluous-declaration-of-progr.patch deleted file mode 100644 index 478324c1c4..0000000000 --- a/meta/recipes-extended/cpio/cpio-2.13/0002-src-global.c-Remove-superfluous-declaration-of-progr.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 33e6cb5a28fab3d99bd6818f8c01e6f33805390f Mon Sep 17 00:00:00 2001 -From: Sergey Poznyakoff <gray@gnu.org> -Date: Mon, 20 Jan 2020 07:45:39 +0200 -Subject: [PATCH] src/global.c: Remove superfluous declaration of program_name - -Upstream-Status: Backport (commit 641d3f4) -Signed-off-by: Richard Leitner <richard.leitner@skidata.com> ---- - src/global.c | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/src/global.c b/src/global.c -index fb3abe9..acf92bc 100644 ---- a/src/global.c -+++ b/src/global.c -@@ -184,9 +184,6 @@ unsigned int warn_option = 0; - /* Extract to standard output? */ - bool to_stdout_option = false; - --/* The name this program was run with. */ --char *program_name; -- - /* A pointer to either lstat or stat, depending on whether - dereferencing of symlinks is done for input files. */ - int (*xstat) (); --- -2.26.2 - diff --git a/meta/recipes-extended/cpio/cpio_2.13.bb b/meta/recipes-extended/cpio/cpio_2.13.bb deleted file mode 100644 index f4df826ed9..0000000000 --- a/meta/recipes-extended/cpio/cpio_2.13.bb +++ /dev/null @@ -1,54 +0,0 @@ -SUMMARY = "GNU cpio is a program to manage archives of files" -DESCRIPTION = "GNU cpio is a tool for creating and extracting archives, or copying files from one place to \ -another. It handles a number of cpio formats as well as reading and writing tar files." -HOMEPAGE = "http://www.gnu.org/software/cpio/" -SECTION = "base" -LICENSE = "GPLv3" -LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949" - -SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \ - file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ - file://0002-src-global.c-Remove-superfluous-declaration-of-progr.patch \ - " - -SRC_URI[md5sum] = "389c5452d667c23b5eceb206f5000810" -SRC_URI[sha256sum] = "e87470d9c984317f658567c03bfefb6b0c829ff17dbf6b0de48d71a4c8f3db88" - -inherit autotools gettext texinfo - -# Issue applies to use of cpio in SUSE/OBS, doesn't apply to us -CVE_CHECK_WHITELIST += "CVE-2010-4226" - -EXTRA_OECONF += "DEFAULT_RMT_DIR=${sbindir}" - -do_install () { - autotools_do_install - if [ "${base_bindir}" != "${bindir}" ]; then - install -d ${D}${base_bindir}/ - mv "${D}${bindir}/cpio" "${D}${base_bindir}/cpio" - if [ "${sbindir}" != "${bindir}" ]; then - rmdir ${D}${bindir}/ - fi - fi - - # Avoid conflicts with the version from tar - mv "${D}${mandir}/man8/rmt.8" "${D}${mandir}/man8/rmt-cpio.8" -} - -PACKAGES =+ "${PN}-rmt" - -FILES_${PN}-rmt = "${sbindir}/rmt*" - -inherit update-alternatives - -ALTERNATIVE_PRIORITY = "100" - -ALTERNATIVE_${PN} = "cpio" -ALTERNATIVE_${PN}-rmt = "rmt" - -ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio" - -ALTERNATIVE_PRIORITY[rmt] = "50" -ALTERNATIVE_LINK_NAME[rmt] = "${sbindir}/rmt" - -BBCLASSEXTEND = "native nativesdk" 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..95f82cdf3a --- /dev/null +++ b/meta/recipes-extended/cpio/cpio_2.15.bb @@ -0,0 +1,88 @@ +SUMMARY = "GNU cpio is a program to manage archives of files" +DESCRIPTION = "GNU cpio is a tool for creating and extracting archives, or copying files from one place to \ +another. It handles a number of cpio formats as well as reading and writing tar files." +HOMEPAGE = "http://www.gnu.org/software/cpio/" +SECTION = "base" +LICENSE = "GPL-3.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949" + +SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \ + file://run-ptest \ + file://test.sh \ + " + +SRC_URI[sha256sum] = "efa50ef983137eefc0a02fdb51509d624b5e3295c980aa127ceee4183455499e" + +inherit autotools gettext texinfo ptest + +CVE_STATUS[CVE-2010-4226] = "not-applicable-platform: Issue applies to use of cpio in SUSE/OBS" +CVE_STATUS[CVE-2023-7216] = "disputed: intended behaviour, see https://lists.gnu.org/archive/html/bug-cpio/2024-03/msg00000.html" + +EXTRA_OECONF += "DEFAULT_RMT_DIR=${sbindir}" + +do_install () { + autotools_do_install + if [ "${base_bindir}" != "${bindir}" ]; then + install -d ${D}${base_bindir}/ + mv "${D}${bindir}/cpio" "${D}${base_bindir}/cpio" + if [ "${sbindir}" != "${bindir}" ]; then + rmdir ${D}${bindir}/ + fi + fi + + # Avoid conflicts with the version from tar + mv "${D}${mandir}/man8/rmt.8" "${D}${mandir}/man8/rmt-cpio.8" +} + +do_compile_ptest() { + oe_runmake -C ${B}/gnu/ check + oe_runmake -C ${B}/lib/ check + oe_runmake -C ${B}/rmt/ check + oe_runmake -C ${B}/src/ check + oe_runmake -C ${B}/tests/ genfile +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests/ + sed -i "/abs_/d" ${B}/tests/atconfig + install --mode=755 ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/ + sed -i "s%${B}/tests:%%g" ${B}/tests/atlocal + sed -i "s%${B}/src:%%g" ${B}/tests/atlocal + install --mode=755 ${B}/tests/atlocal ${D}${PTEST_PATH}/tests/ + install --mode=755 ${B}/tests/genfile ${D}${PTEST_PATH}/tests/ + install --mode=755 ${S}/tests/testsuite ${D}${PTEST_PATH}/tests/ + install --mode=755 ${WORKDIR}/test.sh ${D}${PTEST_PATH}/test.sh + sed -i "s#@PTEST_PATH@#${PTEST_PATH}#g" ${D}${PTEST_PATH}/test.sh +} + +# ptest.bbclass currently chowns the ptest directory explicitly, so we need to +# change permission after that has happened so the ptest user can write a +# temporary directory. +do_install_ptest_base:append() { + chgrp -R ptest ${D}${PTEST_PATH}/ + chmod -R g+w ${D}${PTEST_PATH}/ +} + +# The tests need to run as a non-root user, so pull in the ptest user +DEPENDS:append:class-target = "${@bb.utils.contains('PTEST_ENABLED', '1', ' ptest-runner', '', d)}" +PACKAGE_WRITE_DEPS += "ptest-runner" + +RDEPENDS:${PN}-ptest += "ptest-runner" + +PACKAGES =+ "${PN}-rmt" + +FILES:${PN}-rmt = "${sbindir}/rmt*" + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE:${PN} = "cpio" +ALTERNATIVE:${PN}-rmt = "rmt" + +ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio" + +ALTERNATIVE_PRIORITY[rmt] = "50" +ALTERNATIVE_LINK_NAME[rmt] = "${sbindir}/rmt" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-extended/cpio/files/run-ptest b/meta/recipes-extended/cpio/files/run-ptest new file mode 100755 index 0000000000..f35a756d6b --- /dev/null +++ b/meta/recipes-extended/cpio/files/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +su -c ./test.sh ptest diff --git a/meta/recipes-extended/cpio/files/test.sh b/meta/recipes-extended/cpio/files/test.sh new file mode 100644 index 0000000000..f027574e86 --- /dev/null +++ b/meta/recipes-extended/cpio/files/test.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Define cpio test work dir +WORKDIR=@PTEST_PATH@/tests/ + +# Run test +cd ${WORKDIR} +./atconfig ./atlocal ./testsuite + +./testsuite 2>&1 | grep -E '[0-9]{1,3}: ' | sed -e 's/^.....//' -e '/[ok]$/s/^/PASS: /;/FAILED (.*)/s/^/FAIL: /;/skipped (.*)/s/^/SKIP: /;/expected failure/ s/^/PASS: /;/UNEXPECTED PASS/s/^/FAIL: /' -e 's/ok$//g' -e 's/FAILED.*//g' -e 's/skipped.*//g' -e 's/expected failure.*//g' -e 's/UNEXPECTED PASS.*//g' |