blob: 1ef5fe221e467b950be536307be51124cef49c52 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "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"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00006LICENSE = "GPL-3.0-only"
Brad Bishopc342db32019-05-15 21:57:59 -04007LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
8
Andrew Geissler6aa7eec2023-03-03 12:41:14 -06009SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2 \
10 file://CVE-2022-48303.patch \
11"
Brad Bishopc342db32019-05-15 21:57:59 -040012
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060013SRC_URI[sha256sum] = "b44cc67f8a1f6b0250b7c860e952b37e8ed932a90bd9b1862a511079255646ff"
Brad Bishopc342db32019-05-15 21:57:59 -040014
15inherit autotools gettext texinfo
16
17PACKAGECONFIG ??= ""
Patrick Williams213cb262021-08-07 19:21:33 -050018PACKAGECONFIG:append:class-target = " ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)}"
Brad Bishopc342db32019-05-15 21:57:59 -040019
20PACKAGECONFIG[acl] = "--with-posix-acls,--without-posix-acls,acl"
Andrew Geissler5199d832021-09-24 16:47:35 -050021PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
Brad Bishopc342db32019-05-15 21:57:59 -040022
23EXTRA_OECONF += "DEFAULT_RMT_DIR=${sbindir}"
24
Andrew Geissler82c905d2020-04-13 13:39:40 -050025CACHED_CONFIGUREVARS += "tar_cv_path_RSH=no"
26
Brad Bishopc342db32019-05-15 21:57:59 -040027# 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
Patrick Williams213cb262021-08-07 19:21:33 -050038do_install:append:class-target() {
Brad Bishopc342db32019-05-15 21:57:59 -040039 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
Patrick Williams213cb262021-08-07 19:21:33 -050049FILES:${PN}-rmt = "${sbindir}/rmt*"
Brad Bishopc342db32019-05-15 21:57:59 -040050
51inherit update-alternatives
52
53ALTERNATIVE_PRIORITY = "100"
54
Patrick Williams213cb262021-08-07 19:21:33 -050055ALTERNATIVE:${PN} = "tar"
56ALTERNATIVE:${PN}-rmt = "rmt"
57ALTERNATIVE:${PN}:class-nativesdk = ""
58ALTERNATIVE:${PN}-rmt:class-nativesdk = ""
Brad Bishopc342db32019-05-15 21:57:59 -040059
60ALTERNATIVE_LINK_NAME[tar] = "${base_bindir}/tar"
61ALTERNATIVE_LINK_NAME[rmt] = "${sbindir}/rmt"
62
Patrick Williams213cb262021-08-07 19:21:33 -050063PROVIDES:append:class-native = " tar-replacement-native"
Brad Bishopc342db32019-05-15 21:57:59 -040064NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
65
66BBCLASSEXTEND = "native nativesdk"
Patrick Williams0ca19cc2021-08-16 14:03:13 -050067
Andrew Geisslereff27472021-10-29 15:35:00 -050068# Avoid false positives from CVEs in node-tar package
69# For example CVE-2021-{32803,32804,37701,37712,37713}
70CVE_PRODUCT = "gnu:tar"