Name:          tar
Version:       1.32
Release:       2
Epoch:         2
Summary:       An organized and systematic method of controlling a large amount of data
License:       GPLv3+
URL:           http://www.gnu.org/software/tar/
Source0:       https://ftp.gnu.org/gnu/tar/tar-%{version}.tar.xz
Source1:       https://ftp.gnu.org/gnu/tar/tar-%{version}.tar.xz.sig

Patch6000:     backport-CVE-2021-20193.patch

BuildRequires: autoconf automake texinfo gettext libacl-devel attr acl policycoreutils
Provides:      bundled(gnulib) /bin/tar /bin/gtar

Patch0001:     tar-1.28-loneZeroWarning.patch
Patch0002:     tar-1.28-vfatTruncate.patch
Patch0003:     tar-1.29-wildcards.patch
Patch0004:     tar-1.28-atime-rofs.patch
Patch0005:     tar-1.28-document-exclude-mistakes.patch

%description
GNU Tar provides the ability to create tar archives, as well as various other
kinds of manipulation. For example, you can use Tar on previously created archives
to extract files, to store additional files, or to update or list files which were
already stored.

%package     help
Summary:     help document for tar
Requires:    %{name} = %{epoch}:%{version}-%{release}
BuildArch:   noarch

%description help
Help document for tar.

%prep
%autosetup -n tar-%{version} -p1
autoreconf -v

%build
export FORCE_UNSAFE_CONFIGURE=1
%configure --without-selinux --with-lzma="xz --format=lzma" \
           DEFAULT_RMT_DIR=%{_sysconfdir} RSH=/usr/bin/ssh
%make_build

%install
%make_install

ln -s tar      %{buildroot}%{_bindir}/gtar
ln -s tar.1.gz %{buildroot}%{_mandir}/man1/gtar.1

rm -f          %{buildroot}%{_infodir}/dir
rm -f          %{buildroot}%{_sysconfdir}/rmt
rm -f          %{buildroot}%{_mandir}/man8/rmt.8*

%find_lang tar


%check
make check

%pre

%preun

%post

%postun

%files -f tar.lang
%doc AUTHORS README THANKS NEWS ChangeLog COPYING
%{_bindir}/*tar

%files help
%{_mandir}/man1/*tar.1*
%{_infodir}/tar.info*

%changelog
* Wed Apr 14 2021 shixuantong <shixuantong> - 2:1.32-2 
- fix CVE-2021-20193

* Tue Aug 04 2020 shanzhikun <shanzhikun@huawei.com> - 2:1.32-1
- upgrade tar to 1.32.

* Tue Feb 18 2020 openEuler Buildteam <buildteam@openeuler.org> - 2:1.30-11
- Enable check

* Wed Jan 22 2020 openEuler Buildteam <buildteam@openeuler.org> - 2:1.30-10
- set FORCE_UNSAFE_CONFIGURE to 1

* Wed Jan 22 2020 openEuler Buildteam <buildteam@openeuler.org> - 2:1.30-9
- cancel make check

* Sat Dec 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 2:1.30-8
- Fix CVE-2018-20482

* Tue Sep 10 2019 Huiming Xie <xiehuiming@huawei.com> - 2:1.30-7
- Package init
