xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-extended/tar/tar_1.34.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "GNU file archiving program"
2*4882a593SmuzhiyunDESCRIPTION = "GNU tar saves many files together into a single tape \
3*4882a593Smuzhiyunor disk archive, and can restore individual files from the archive."
4*4882a593SmuzhiyunHOMEPAGE = "http://www.gnu.org/software/tar/"
5*4882a593SmuzhiyunSECTION = "base"
6*4882a593SmuzhiyunLICENSE = "GPL-3.0-only"
7*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunSRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2 \
10*4882a593Smuzhiyun           file://CVE-2022-48303.patch \
11*4882a593Smuzhiyun"
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunSRC_URI[sha256sum] = "b44cc67f8a1f6b0250b7c860e952b37e8ed932a90bd9b1862a511079255646ff"
14*4882a593Smuzhiyun
15*4882a593Smuzhiyuninherit autotools gettext texinfo
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunPACKAGECONFIG ??= ""
18*4882a593SmuzhiyunPACKAGECONFIG:append:class-target = " ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)}"
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunPACKAGECONFIG[acl] = "--with-posix-acls,--without-posix-acls,acl"
21*4882a593SmuzhiyunPACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunEXTRA_OECONF += "DEFAULT_RMT_DIR=${sbindir}"
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunCACHED_CONFIGUREVARS += "tar_cv_path_RSH=no"
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun# Let aclocal use the relative path for the m4 file rather than the
28*4882a593Smuzhiyun# absolute since tar has a lot of m4 files, otherwise there might
29*4882a593Smuzhiyun# be an "Argument list too long" error when it is built in a long/deep
30*4882a593Smuzhiyun# directory.
31*4882a593Smuzhiyunacpaths = "-I ./m4"
32*4882a593Smuzhiyun
33*4882a593Smuzhiyundo_install () {
34*4882a593Smuzhiyun    autotools_do_install
35*4882a593Smuzhiyun    ln -s tar ${D}${bindir}/gtar
36*4882a593Smuzhiyun}
37*4882a593Smuzhiyun
38*4882a593Smuzhiyundo_install:append:class-target() {
39*4882a593Smuzhiyun    if [ "${base_bindir}" != "${bindir}" ]; then
40*4882a593Smuzhiyun        install -d ${D}${base_bindir}
41*4882a593Smuzhiyun        mv ${D}${bindir}/tar ${D}${base_bindir}/tar
42*4882a593Smuzhiyun        mv ${D}${bindir}/gtar ${D}${base_bindir}/gtar
43*4882a593Smuzhiyun        rmdir ${D}${bindir}/
44*4882a593Smuzhiyun    fi
45*4882a593Smuzhiyun}
46*4882a593Smuzhiyun
47*4882a593SmuzhiyunPACKAGES =+ "${PN}-rmt"
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunFILES:${PN}-rmt = "${sbindir}/rmt*"
50*4882a593Smuzhiyun
51*4882a593Smuzhiyuninherit update-alternatives
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunALTERNATIVE_PRIORITY = "100"
54*4882a593Smuzhiyun
55*4882a593SmuzhiyunALTERNATIVE:${PN} = "tar"
56*4882a593SmuzhiyunALTERNATIVE:${PN}-rmt = "rmt"
57*4882a593SmuzhiyunALTERNATIVE:${PN}:class-nativesdk = ""
58*4882a593SmuzhiyunALTERNATIVE:${PN}-rmt:class-nativesdk = ""
59*4882a593Smuzhiyun
60*4882a593SmuzhiyunALTERNATIVE_LINK_NAME[tar] = "${base_bindir}/tar"
61*4882a593SmuzhiyunALTERNATIVE_LINK_NAME[rmt] = "${sbindir}/rmt"
62*4882a593Smuzhiyun
63*4882a593SmuzhiyunPROVIDES:append:class-native = " tar-replacement-native"
64*4882a593SmuzhiyunNATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunBBCLASSEXTEND = "native nativesdk"
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun# Avoid false positives from CVEs in node-tar package
69*4882a593Smuzhiyun# For example CVE-2021-{32803,32804,37701,37712,37713}
70*4882a593SmuzhiyunCVE_PRODUCT = "gnu:tar"
71