Tomas Bzatek 43b4cad
Name:           libarchive
7e034d8
Version:        3.1.2
f031e9b
Release:        14%{?dist}
b71c2f0
Summary:        A library for handling streaming archive formats
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
Group:          System Environment/Libraries
Tomas Bzatek 43b4cad
License:        BSD
7e034d8
URL:            http://www.libarchive.org/
f98ca6a
Source0:        http://www.libarchive.org/downloads/%{name}-%{version}.tar.gz
Tomas Bzatek 43b4cad
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Tomas Bzatek 43b4cad
Tomas Bzatek fb8561b
Tomas Bzatek fb8561b
BuildRequires: bison
Tomas Bzatek fb8561b
BuildRequires: sharutils
Tomas Bzatek 43b4cad
BuildRequires: zlib-devel
Tomas Bzatek 43b4cad
BuildRequires: bzip2-devel
Tomas Bzatek b7414a4
BuildRequires: xz-devel
a8db99e
BuildRequires: lzo-devel
Tomas Bzatek 134f127
BuildRequires: e2fsprogs-devel
Tomas Bzatek 134f127
BuildRequires: libacl-devel
Tomas Bzatek 134f127
BuildRequires: libattr-devel
Tomas Bzatek fb8561b
BuildRequires: openssl-devel
Tomas Bzatek e11ed8d
BuildRequires: libxml2-devel
3a6b649
BuildRequires: automake autoconf libtool
Tomas Bzatek fb8561b
Tomas Bzatek 46f6ae9
7e034d8
# CVE-2013-0211 libarchive: read buffer overflow on 64-bit systems
7e034d8
# https://bugzilla.redhat.com/show_bug.cgi?id=927105
7e034d8
Patch0: libarchive-3.1.3-CVE-2013-0211_read_buffer_overflow.patch
7e034d8
7615a7f
Patch1: libarchive-3.1.2-testsuite.patch
7e034d8
Jaromir Koncicky da58d4e
Patch2: libarchive-3.1.2-acl.patch
Jaromir Koncicky da58d4e
e7c1099
# ~> upstream patches: 3865cf2b e6c9668f 24f5de65
e7c1099
Patch3: libarchive-3.1.2-security-rhbz-1216891.patch
e7c1099
5c9ed8c
# upstream: d0331e8e
5c9ed8c
Patch5: libarchive-3.1.2-CVE-2016-1541.patch
5c9ed8c
Tomas Bzatek 43b4cad
%description
b71c2f0
Libarchive is a programming library that can create and read several different
b71c2f0
streaming archive formats, including most popular tar variants, several cpio
b71c2f0
formats, and both BSD and GNU ar variants. It can also write shar archives and
Tomas Bzatek 43b4cad
read ISO9660 CDROM images and ZIP archives.
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
%package        devel
Tomas Bzatek 43b4cad
Summary:        Development files for %{name}
Tomas Bzatek 43b4cad
Group:          Development/Libraries
cab6450
Requires:       %{name}%{?_isa} = %{version}-%{release}
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
%description    devel
Tomas Bzatek 43b4cad
The %{name}-devel package contains libraries and header files for
Tomas Bzatek 43b4cad
developing applications that use %{name}.
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
89564de
%package -n     bsdtar
b71c2f0
Summary:        Manipulate tape archives
89564de
Group:          Applications/File
8b39f7e
Requires:       %{name} = %{version}-%{release}
89564de
89564de
%description -n bsdtar
89564de
The bsdtar package contains standalone bsdtar utility split off regular
89564de
libarchive packages.
89564de
89564de
89564de
%package -n     bsdcpio
b71c2f0
Summary:        Copy files to and from archives
89564de
Group:          Applications/File
8b39f7e
Requires:       %{name} = %{version}-%{release}
89564de
89564de
%description -n bsdcpio
89564de
The bsdcpio package contains standalone bsdcpio utility split off regular
89564de
libarchive packages.
89564de
89564de
Tomas Bzatek 43b4cad
%prep
0284c0f
%setup -q -n %{name}-%{version}
7e034d8
%patch0 -p1 -b .CVE-2013-0211
7615a7f
# fix bugs in testsuite
7615a7f
# ~> upstream ~> 26629c191a & b539b2e597 & 9caa49246
7615a7f
%patch1 -p1 -b .fix-testsuite
Jaromir Koncicky da58d4e
# fix not working saving/restoring acl
Jaromir Koncicky da58d4e
# ~> downstream
Jaromir Koncicky da58d4e
%patch2 -p1 -b .fix-acl
e7c1099
%patch3 -p1 -b .segfault-cpio
5c9ed8c
%patch5 -p1 -b .cve-2016-1541
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
%build
3a6b649
build/autogen.sh
89564de
%configure --disable-static --disable-rpath
89564de
# remove rpaths
89564de
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
89564de
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
7615a7f
7615a7f
test -z "$V" && verbose_make="V=1"
7615a7f
make %{?_smp_mflags} $verbose_make
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
%install
Tomas Bzatek 43b4cad
rm -rf $RPM_BUILD_ROOT
Tomas Bzatek 43b4cad
make install DESTDIR=$RPM_BUILD_ROOT
Tomas Bzatek 43b4cad
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
Tomas Bzatek 43b4cad
f031e9b
# rhbz#1294252
f031e9b
replace ()
f031e9b
{
f031e9b
    filename=$1
f031e9b
    file=`basename "$filename"`
f031e9b
    binary=${file%%.*}
f031e9b
    pattern=${binary##bsd}
f031e9b
f031e9b
f031e9b
    awk "
f031e9b
        # replace the first occurence of \"$pattern\" by \"$binary\"
f031e9b
        !stop && /^.Nm $pattern/ {
f031e9b
            print \".Nm $binary\" ;
f031e9b
            stop = 1 ;
f031e9b
            next;
f031e9b
        }
f031e9b
        # print remaining lines
f031e9b
        1;
f031e9b
    " "$filename" > "$filename.new"
f031e9b
    mv "$filename".new "$filename"
f031e9b
}
f031e9b
f031e9b
for manpage in bsdtar.1 bsdcpio.1
f031e9b
do
f031e9b
    installed_manpage=`find "$RPM_BUILD_ROOT" -name "$manpage"`
f031e9b
    replace "$installed_manpage"
f031e9b
done
f031e9b
Tomas Bzatek 43b4cad
7615a7f
%check
bbde57d
run_testsuite()
bbde57d
{
bbde57d
    LD_LIBRARY_PATH=`pwd`/.libs make check -j1
bbde57d
    res=$?
bbde57d
    echo $res
bbde57d
    if [ $res -ne 0 ]; then
bbde57d
        # error happened - try to extract in koji as much info as possible
bbde57d
        cat test-suite.log
bbde57d
        echo "========================="
bbde57d
        err=`cat test-suite.log | grep "Details for failing tests" | cut -d: -f2`
bbde57d
        for i in $err; do
bbde57d
            find $i -printf "%p\n    ~> a: %a\n    ~> c: %c\n    ~> t: %t\n    ~> %s B\n"
bbde57d
            echo "-------------------------"
bbde57d
            cat $i/*.log
bbde57d
        done
bbde57d
        return 1
bbde57d
    else
bbde57d
        return 0
bbde57d
    fi
bbde57d
}
bbde57d
3518c10
# On a ppc/ppc64 is some race condition causing 'make check' fail on ppc
3518c10
# when both 32 and 64 builds are done in parallel on the same machine in
3518c10
# koji.  Try to run once again if failed.
bbde57d
%ifarch ppc
3518c10
run_testsuite || run_testsuite
3518c10
%else
3518c10
run_testsuite
bbde57d
%endif
7615a7f
3518c10
Tomas Bzatek 43b4cad
%clean
Tomas Bzatek 43b4cad
rm -rf $RPM_BUILD_ROOT
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
%post -p /sbin/ldconfig
Tomas Bzatek 43b4cad
7615a7f
Tomas Bzatek 43b4cad
%postun -p /sbin/ldconfig
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
%files
Tomas Bzatek 43b4cad
%defattr(-,root,root,-)
71ff6ca
%{!?_licensedir:%global license %%doc}
71ff6ca
%license COPYING
71ff6ca
%doc README NEWS
3a6b649
%{_libdir}/libarchive.so.13*
b71c2f0
%{_mandir}/*/cpio.*
b71c2f0
%{_mandir}/*/mtree.*
b71c2f0
%{_mandir}/*/tar.*
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
%files devel
Tomas Bzatek 43b4cad
%defattr(-,root,root,-)
Tomas Bzatek 43b4cad
%doc
cab6450
%{_includedir}/*.h
b71c2f0
%{_mandir}/*/archive*
b71c2f0
%{_mandir}/*/libarchive*
cab6450
%{_libdir}/libarchive.so
cab6450
%{_libdir}/pkgconfig/libarchive.pc
Tomas Bzatek 43b4cad
89564de
%files -n bsdtar
89564de
%defattr(-,root,root,-)
71ff6ca
%{!?_licensedir:%global license %%doc}
71ff6ca
%license COPYING
71ff6ca
%doc README NEWS
89564de
%{_bindir}/bsdtar
b71c2f0
%{_mandir}/*/bsdtar*
89564de
89564de
%files -n bsdcpio
89564de
%defattr(-,root,root,-)
71ff6ca
%{!?_licensedir:%global license %%doc}
71ff6ca
%license COPYING
71ff6ca
%doc README NEWS
89564de
%{_bindir}/bsdcpio
b71c2f0
%{_mandir}/*/bsdcpio*
89564de
Tomas Bzatek 43b4cad
Tomas Bzatek 43b4cad
%changelog
f031e9b
* Thu May 12 2016 Pavel Raiskup <praiskup@redhat.com> - 3.1.2-14
f031e9b
- fix manual pages to mention correctly spelled binary names (rhbz#1294252)
5c9ed8c
- fix CVE-2016-1541, rhbz#1334213
f031e9b
a3f6b95
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-13
a3f6b95
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
a3f6b95
e7c1099
* Wed Apr 29 2015 Pavel Raiskup <praiskup@redhat.com> - 3.1.2-12
e7c1099
- fix libarchive segfault for intentionally broken cpio archives (rhbz#1216892)
e7c1099
d46b2e1
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 3.1.2-11
d46b2e1
- Rebuilt for Fedora 23 Change
d46b2e1
  https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
d46b2e1
9f8894a
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-10
9f8894a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
9f8894a
71ff6ca
* Thu Jul 17 2014 Tom Callaway <spot@fedoraproject.org> - 3.1.2-9
71ff6ca
- fix license handling
71ff6ca
0725db5
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-8
0725db5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
0725db5
Jaromir Koncicky da58d4e
* Thu Aug 08 2013 Jaromir Koncicky <jkoncick@redhat.com> - 3.1.2-7
Jaromir Koncicky da58d4e
- Fixed Bug 993048 - added #ifdef ACL_TYPE_NFS4 to code which requires
Jaromir Koncicky da58d4e
  NFS4 ACL support
Jaromir Koncicky da58d4e
bf786a6
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-6
bf786a6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
bf786a6
bbde57d
* Mon Jul 22 2013 Pavel Raiskup <praiskup@redhat.com> - 3.1.2-5
bbde57d
- try to workaround racy testsuite fail
bbde57d
7615a7f
* Sun Jun 30 2013 Pavel Raiskup <praiskup@redhat.com> - 3.1.2-4
7615a7f
- enable testsuite in the %%check phase
7615a7f
8b39f7e
* Mon Jun 24 2013 Pavel Raiskup <praiskup@redhat.com> - 3.1.2-3
8b39f7e
- bsdtar/bsdcpio should require versioned libarchive
8b39f7e
0eefbad
* Wed Apr  3 2013 Tomas Bzatek <tbzatek@redhat.com> - 3.1.2-2
0eefbad
- Remove libunistring-devel build require
0eefbad
7e034d8
* Thu Mar 28 2013 Tomas Bzatek <tbzatek@redhat.com> - 3.1.2-1
7e034d8
- Update to 3.1.2
7e034d8
- Fix CVE-2013-0211: read buffer overflow on 64-bit systems (#927105)
7e034d8
a748932
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.1-2
a748932
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
a748932
3a6b649
* Mon Jan 14 2013 Tomas Bzatek <tbzatek@redhat.com> - 3.1.1-1
3a6b649
- Update to 3.1.1
3a6b649
- NEWS seems to be valid UTF-8 nowadays
3a6b649
b71c2f0
* Wed Oct 03 2012 Pavel Raiskup <praiskup@redhat.com> - 3.0.4-3
b71c2f0
- better install manual pages for libarchive/bsdtar/bsdcpio (# ... )
b71c2f0
- several fedora-review fixes ...:
b71c2f0
- Source0 has moved to github.com
b71c2f0
- remove trailing white spaces
b71c2f0
- repair summary to better describe bsdtar/cpiotar utilities
b71c2f0
163481b
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.4-2
163481b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
163481b
8afa47d
* Mon May  7 2012 Tomas Bzatek <tbzatek@redhat.com> - 3.0.4-1
8afa47d
- Update to 3.0.4
8afa47d
89564de
* Wed Feb  1 2012 Tomas Bzatek <tbzatek@redhat.com> - 3.0.3-2
89564de
- Enable bsdtar and bsdcpio in separate subpackages (#786400)
89564de
0284c0f
* Fri Jan 13 2012 Tomas Bzatek <tbzatek@redhat.com> - 3.0.3-1
0284c0f
- Update to 3.0.3
0284c0f
00649a5
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.0-0.3.a
00649a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
00649a5
cab6450
* Tue Nov 15 2011 Rex Dieter <rdieter@fedoraproject.org> 3.0.0-0.2.a
cab6450
- track files/sonames closer, so abi bumps aren't a surprise
cab6450
- tighten subpkg deps via %%_isa
cab6450
59f48db
* Mon Nov 14 2011 Tomas Bzatek <tbzatek@redhat.com> - 3.0.0-0.1.a
59f48db
- Update to 3.0.0a (alpha release)
59f48db
835aa94
* Mon Sep  5 2011 Tomas Bzatek <tbzatek@redhat.com> - 2.8.5-1
835aa94
- Update to 2.8.5
835aa94
07e29c7
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.4-3
07e29c7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
07e29c7
8553261
* Thu Jan 13 2011 Tomas Bzatek <tbzatek@redhat.com> - 2.8.4-2
8553261
- Rebuild for new xz-libs
8553261
Tomas Bzatek 46f6ae9
* Wed Jun 30 2010 Tomas Bzatek <tbzatek@redhat.com> - 2.8.4-1
Tomas Bzatek 46f6ae9
- Update to 2.8.4
Tomas Bzatek 46f6ae9
Tomas Bzatek 46f6ae9
* Fri Jun 25 2010 Tomas Bzatek <tbzatek@redhat.com> - 2.8.3-2
Tomas Bzatek 46f6ae9
- Fix ISO9660 reader data type mismatches (#597243)
Tomas Bzatek 46f6ae9
Tomas Bzatek d2d6c84
* Tue Mar 16 2010 Tomas Bzatek <tbzatek@redhat.com> - 2.8.3-1
Tomas Bzatek d2d6c84
- Update to 2.8.3
Tomas Bzatek d2d6c84
Tomas Bzatek dfb63a5
* Mon Mar  8 2010 Tomas Bzatek <tbzatek@redhat.com> - 2.8.1-1
Tomas Bzatek dfb63a5
- Update to 2.8.1
Tomas Bzatek dfb63a5
Tomas Bzatek 9486c6f
* Fri Feb  5 2010 Tomas Bzatek <tbzatek@redhat.com> - 2.8.0-1
Tomas Bzatek 9486c6f
- Update to 2.8.0
Tomas Bzatek 9486c6f
Tomas Bzatek e11ed8d
* Wed Jan  6 2010 Tomas Bzatek <tbzatek@redhat.com> - 2.7.902a-1
Tomas Bzatek e11ed8d
- Update to 2.7.902a
Tomas Bzatek e11ed8d
f2ff60c
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 2.7.1-2
f2ff60c
- rebuilt with new openssl
f2ff60c
Tomas Bzatek 00f293e
* Fri Aug  7 2009 Tomas Bzatek <tbzatek@redhat.com> 2.7.1-1
Tomas Bzatek 00f293e
- Update to 2.7.1
Tomas Bzatek 00f293e
- Drop deprecated lzma dependency, libxz handles both formats
Tomas Bzatek 00f293e
Tomas Bzatek b7414a4
* Mon Jul 27 2009 Tomas Bzatek <tbzatek@redhat.com> 2.7.0-3
Tomas Bzatek b7414a4
- Enable XZ compression format
Tomas Bzatek b7414a4
fc4ed7e
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.0-2
fc4ed7e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
fc4ed7e
Tomas Bzatek fb8561b
* Tue May 12 2009 Tomas Bzatek <tbzatek@redhat.com> 2.7.0-1
Tomas Bzatek fb8561b
- Update to 2.7.0
Tomas Bzatek fb8561b
Tomas Bzatek a838355
* Fri Mar  6 2009 Tomas Bzatek <tbzatek@redhat.com> 2.6.2-1
Tomas Bzatek a838355
- Update to 2.6.2
Tomas Bzatek a838355
7fc8017
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-2
7fc8017
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
7fc8017
Tomas Bzatek d12ad8f
* Mon Feb 16 2009 Tomas Bzatek <tbzatek@redhat.com> 2.6.1-1
Tomas Bzatek d12ad8f
- Update to 2.6.1
Tomas Bzatek d12ad8f
Tomas Bzatek 291ffd3
* Thu Jan  8 2009 Tomas Bzatek <tbzatek@redhat.com> 2.6.0-1
Tomas Bzatek 291ffd3
- Update to 2.6.0
Tomas Bzatek 291ffd3
Tomas Bzatek 12f0975
* Mon Dec 15 2008 Tomas Bzatek <tbzatek@redhat.com> 2.5.904a-1
Tomas Bzatek 12f0975
- Update to 2.5.904a
Tomas Bzatek 12f0975
Tomas Bzatek 134f127
* Tue Dec  9 2008 Tomas Bzatek <tbzatek@redhat.com> 2.5.903a-2
Tomas Bzatek 134f127
- Add LZMA support
Tomas Bzatek 134f127
Tomas Bzatek 5b3e986
* Mon Dec  8 2008 Tomas Bzatek <tbzatek@redhat.com> 2.5.903a-1
Tomas Bzatek 5b3e986
- Update to 2.5.903a
Tomas Bzatek 5b3e986
Tomas Bzatek 58b253e
* Tue Jul 22 2008 Tomas Bzatek <tbzatek@redhat.com> 2.5.5-1
Tomas Bzatek 58b253e
- Update to 2.5.5
Tomas Bzatek 58b253e
Tomas Bzatek 734f5c0
* Wed Apr  2 2008 Tomas Bzatek <tbzatek@redhat.com> 2.4.17-1
Tomas Bzatek 734f5c0
- Update to 2.4.17
Tomas Bzatek 734f5c0
f98ca6a
* Wed Mar 19 2008 Tomas Bzatek <tbzatek@redhat.com> 2.4.14-1
Tomas Bzatek 43b4cad
- Initial packaging