1SUMMARY = "GNU file archiving program" 2DESCRIPTION = "GNU tar saves many files together into a single tape \ 3or disk archive, and can restore individual files from the archive." 4HOMEPAGE = "http://www.gnu.org/software/tar/" 5SECTION = "base" 6LICENSE = "GPL-3.0-only" 7LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" 8 9SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2 \ 10 file://CVE-2022-48303.patch \ 11" 12 13SRC_URI[sha256sum] = "b44cc67f8a1f6b0250b7c860e952b37e8ed932a90bd9b1862a511079255646ff" 14 15inherit autotools gettext texinfo 16 17PACKAGECONFIG ??= "" 18PACKAGECONFIG:append:class-target = " ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)}" 19 20PACKAGECONFIG[acl] = "--with-posix-acls,--without-posix-acls,acl" 21PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux" 22 23EXTRA_OECONF += "DEFAULT_RMT_DIR=${sbindir}" 24 25CACHED_CONFIGUREVARS += "tar_cv_path_RSH=no" 26 27# Let aclocal use the relative path for the m4 file rather than the 28# absolute since tar has a lot of m4 files, otherwise there might 29# be an "Argument list too long" error when it is built in a long/deep 30# directory. 31acpaths = "-I ./m4" 32 33do_install () { 34 autotools_do_install 35 ln -s tar ${D}${bindir}/gtar 36} 37 38do_install:append:class-target() { 39 if [ "${base_bindir}" != "${bindir}" ]; then 40 install -d ${D}${base_bindir} 41 mv ${D}${bindir}/tar ${D}${base_bindir}/tar 42 mv ${D}${bindir}/gtar ${D}${base_bindir}/gtar 43 rmdir ${D}${bindir}/ 44 fi 45} 46 47PACKAGES =+ "${PN}-rmt" 48 49FILES:${PN}-rmt = "${sbindir}/rmt*" 50 51inherit update-alternatives 52 53ALTERNATIVE_PRIORITY = "100" 54 55ALTERNATIVE:${PN} = "tar" 56ALTERNATIVE:${PN}-rmt = "rmt" 57ALTERNATIVE:${PN}:class-nativesdk = "" 58ALTERNATIVE:${PN}-rmt:class-nativesdk = "" 59 60ALTERNATIVE_LINK_NAME[tar] = "${base_bindir}/tar" 61ALTERNATIVE_LINK_NAME[rmt] = "${sbindir}/rmt" 62 63PROVIDES:append:class-native = " tar-replacement-native" 64NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}" 65 66BBCLASSEXTEND = "native nativesdk" 67 68# Avoid false positives from CVEs in node-tar package 69# For example CVE-2021-{32803,32804,37701,37712,37713} 70CVE_PRODUCT = "gnu:tar" 71