%bcond_with check Name: libarchive Version: 3.4.1 Release: 3 Summary: Multi-format archive and compression library License: BSD URL: https://www.%{name}.org/ Source0: https://www.%{name}.org/downloads/%{name}-%{version}.tar.gz BuildRequires: gcc bison sharutils zlib-devel bzip2-devel xz-devel BuildRequires: lzo-devel e2fsprogs-devel libacl-devel libattr-devel BuildRequires: openssl-devel libxml2-devel lz4-devel automake libzstd-devel Provides: bsdtar bsdcpio bsdcat Obsoletes: bsdtar bsdcpio bsdcat Patch6001: libarchive-uninitialized-value.patch Patch6002: CVE-2020-9308.patch %description %{name} is an open-source BSD-licensed C programming library that provides streaming access to a variety of different archive formats, including tar, cpio, pax, zip, and ISO9660 images. The distribution also includes bsdtar and bsdcpio, full-featured implementations of tar and cpio that use %{name}. %package devel Summary: Development files for %{name} Requires: %{name} = %{version}-%{release} %description devel %{name}-devel contains the header files for developing applications that want to make use of %{name}. %package_help %prep %autosetup -n %{name}-%{version} -p1 %build %configure --disable-rpath %disable_rpath %make_build %install %make_install %delete_la replace () { filename=$1 file=`basename "$filename"` binary=${file%%.*} pattern=${binary##bsd} awk " /^.Dt ${pattern^^} 1/ { print \".Dt ${binary^^} 1\"; next; } !stop && /^.Nm $pattern/ { print \".Nm $binary\" ; stop = 1 ; next; } 1; " "$filename" > "$filename.new" mv "$filename".new "$filename" } for manpage in bsdtar.1 bsdcpio.1 do installed_manpage=`find "$RPM_BUILD_ROOT" -name "$manpage"` replace "$installed_manpage" done %check %if %{with check} logfiles () { find -name '*_test.log' -or -name test-suite.log } tempdirs () { cat `logfiles` \ | awk "match(\$0, /[^[:space:]]*`date -I`[^[:space:]]*/) { print substr(\$0, RSTART, RLENGTH); }" \ | sort | uniq } cat_logs () { for i in `logfiles` do echo "=== $i ===" cat "$i" done } run_testsuite () { rc=0 LD_LIBRARY_PATH=`pwd`/.libs make %{?_smp_mflags} check -j1 || { cat_logs for i in `tempdirs`; do if test -d "$i" ; then find $i -printf "%p\n ~> a: %a\n ~> c: %c\n ~> t: %t\n ~> %s B\n" cat $i/*.log fi done return 1 } cat_logs } run_testsuite %endif %ldconfig_scriptlets %files %defattr(-,root,root) %{!?_licensedir:%global license %%doc} %license COPYING %{_libdir}/%{name}.so.13* %{_bindir}/bsdtar %{_bindir}/bsdcpio %{_bindir}/bsdcat %files devel %defattr(-,root,root) %{_includedir}/*.h %{_libdir}/%{name}.so %{_libdir}/pkgconfig/%{name}.pc %{_libdir}/*.a %files help %defattr(-,root,root) %doc NEWS README.md %{_mandir}/man1/* %{_mandir}/man3/* %{_mandir}/man5/* %changelog * Mon Apr 20 2020 openEuler Buildteam - 3.4.1-3 - Type:cves - ID:CVE-2020-9308 - SUG:NA - DESC:fix CVE-2020-9308 * Tue Mar 10 2020 songnannan - 3.4.1-2 - bugfix about uninitialized value * Wed Jan 8 2020 openEuler Buildteam - 3.4.1-1 - Type:bugfix - ID:NA - SUG:NA - DESC: update to 3.4.1 * Fri Jan 3 2020 openEuler Buildteam - 3.4.0-3 - Type:bugfix - ID:NA - SUG:NA - DESC:bugfix about CVE-2019-19221.patch * Wed Oct 9 2019 openEuler Buildteam - 3.4.0-2 - Type:bugfix - Id:NA - SUG:NA - DESC:delete the comment for patch0 * Mon Sep 16 2019 openEuler Buildteam - 3.4.0-1 - Package init