aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libarchive.spec
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libarchive.spec')
-rw-r--r--contrib/libarchive.spec249
1 files changed, 180 insertions, 69 deletions
diff --git a/contrib/libarchive.spec b/contrib/libarchive.spec
index f4ed359721a0..211b391e9173 100644
--- a/contrib/libarchive.spec
+++ b/contrib/libarchive.spec
@@ -1,105 +1,216 @@
-Summary: Library to create and read several different archive formats
-Name: libarchive
-Version: 3.1.2
-Release: 1
+Name: {{{ git_name }}}
+Version: {{{ git_version lead=3 follow=4 }}}
+Release: 1%{?dist}
+Summary: A library for handling streaming archive formats
+
License: BSD
-Group: Libraries
-Source0: http://libarchive.org/downloads/%{name}-%{version}.tar.gz
-URL: http:/libarchive.org/
-Requires: glibc
-Requires: zlib
-Requires: bzip2
+URL: http://www.libarchive.org/
+Source: {{{ git_pack }}}
+
+VCS: {{{ git_vcs }}}
+
+BuildRequires: automake
+BuildRequires: bison
+BuildRequires: bzip2-devel
+BuildRequires: e2fsprogs-devel
BuildRequires: gcc
-BuildRequires: gcc-c++
-BuildRequires: gawk
+BuildRequires: libacl-devel
+BuildRequires: libattr-devel
+BuildRequires: libtool
+BuildRequires: libxml2-devel
+BuildRequires: libzstd-devel
+BuildRequires: lz4-devel
+BuildRequires: lzo-devel
+BuildRequires: openssl-devel
+BuildRequires: sharutils
+BuildRequires: xz-devel
BuildRequires: zlib-devel
-BuildRequires: bzip2
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
-Libarchive is a programming library that can create and read several
-different streaming archive formats, including most popular TAR
-variants and several CPIO formats. It can also write SHAR archives.
+Libarchive is a programming library that can create and read several different
+streaming archive formats, including most popular tar variants, several cpio
+formats, and both BSD and GNU ar variants. It can also write shar archives and
+read ISO9660 CDROM images and ZIP archives.
+
%package devel
-Summary: Header files for libarchive library
-Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
+Summary: Development files for %{name}
+Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
-Header files for libarchive library.
-
-%package static
-Summary: Static libarchive library
-Group: Development/Libraries
-Requires: %{name}-devel = %{version}-%{release}
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
-%description static
-Static libarchive library.
%package -n bsdtar
-Summary: bsdtar - tar(1) implementation based on libarchive
-Group: Applications/Archiving
-Requires: %{name} = %{version}-%{release}
+Summary: Manipulate tape archives
+Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n bsdtar
-bsdtar - tar(1) implementation based on libarchive.
+The bsdtar package contains standalone bsdtar utility split off regular
+libarchive packages.
+
%package -n bsdcpio
-Summary: bsdcpio - cpio(1) implementation based on libarchive
-Group: Applications/Archiving
-Requires: %{name} = %{version}-%{release}
+Summary: Copy files to and from archives
+Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n bsdcpio
-bsdcpio - cpio(1) implementation based on libarchive
+The bsdcpio package contains standalone bsdcpio utility split off regular
+libarchive packages.
+
+
+%package -n bsdcat
+Summary: Expand files to standard output
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description -n bsdcat
+The bsdcat program typically takes a filename as an argument or reads standard
+input when used in a pipe. In both cases decompressed data it written to
+standard output.
+
%prep
-%setup -q
+{{{ git_setup_macro }}}
+%autosetup -p1
+
%build
-mkdir -p %{buildroot}
-./configure \
---prefix=%{_prefix} \
---libexecdir=%{_libexecdir} \
---libdir=%{_libdir} \
---mandir=%{_mandir} \
---infodir=%{_infodir} \
---enable-shared=yes \
---enable-static=yes \
-| tee %{buildroot}/config.log
-make | tee %{buildroot}/make.log
+build/autogen.sh
+%configure --disable-static --without-nettle LT_SYS_LIBRARY_PATH=%_libdir
+%make_build
+
%install
-[ "%buildroot" != "/" ] && [ -d %buildroot ] && rm -rf %buildroot;
-make DESTDIR=%buildroot install
+make install DESTDIR=$RPM_BUILD_ROOT
+find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
+
+# rhbz#1294252
+replace ()
+{
+ filename=$1
+ file=`basename "$filename"`
+ binary=${file%%.*}
+ pattern=${binary##bsd}
+
+ awk "
+ # replace the topic
+ /^.Dt ${pattern^^} 1/ {
+ print \".Dt ${binary^^} 1\";
+ next;
+ }
+ # replace the first occurence of \"$pattern\" by \"$binary\"
+ !stop && /^.Nm $pattern/ {
+ print \".Nm $binary\" ;
+ stop = 1 ;
+ next;
+ }
+ # print remaining lines
+ 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
+ %make_build check -j1 || {
+ # error happened - try to extract in koji as much info as possible
+ 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
+}
+
+# On a ppc/ppc64 is some race condition causing 'make check' fail on ppc
+# when both 32 and 64 builds are done in parallel on the same machine in
+# koji. Try to run once again if failed.
+%ifarch ppc
+run_testsuite || run_testsuite
+%else
+run_testsuite
+%endif
+%endif
-%clean
-rm -fr %buildroot
%files
-%{_libdir}/libarchive.so*
-
-%files static
-%{_libdir}/libarchive.a
+%{!?_licensedir:%global license %%doc}
+%license COPYING
+%doc NEWS README.md
+%{_libdir}/libarchive.so.13*
+%{_mandir}/*/cpio.*
+%{_mandir}/*/mtree.*
+%{_mandir}/*/tar.*
%files devel
-%{_libdir}/pkgconfig/libarchive.pc
-%{_libdir}/libarchive.la
%{_includedir}/*.h
-%doc %{_mandir}/man3/*
-%doc %{_mandir}/man5/*
+%{_mandir}/*/archive*
+%{_mandir}/*/libarchive*
+%{_libdir}/libarchive.so
+%{_libdir}/pkgconfig/libarchive.pc
%files -n bsdtar
-%attr(755,root,root) %{_bindir}/bsdtar
-%doc %{_mandir}/man1/bsdtar.1*
+%{!?_licensedir:%global license %%doc}
+%license COPYING
+%doc NEWS README.md
+%{_bindir}/bsdtar
+%{_mandir}/*/bsdtar*
%files -n bsdcpio
-%attr(755,root,root) %{_bindir}/bsdcpio
-%doc %{_mandir}/man1/bsdcpio.1*
+%{!?_licensedir:%global license %%doc}
+%license COPYING
+%doc NEWS README.md
+%{_bindir}/bsdcpio
+%{_mandir}/*/bsdcpio*
+
+%files -n bsdcat
+%{!?_licensedir:%global license %%doc}
+%license COPYING
+%doc NEWS README.md
+%{_bindir}/bsdcat
+%{_mandir}/*/bsdcat*
+
+
%changelog
-* Wed May 01 2013 Nikolai Lifanov <lifanov@mail.lifanov.com> - 3.1.2-1
-- Initial package
-- contrib/libarchive.spec by PLD team overhaul
-- Added "bsdcpio" package
-- Fixed build on x86_64 platform
+* Thu Mar 28 2019 Pavel Raiskup <praiskup@redhat.com> - 3.3.3-7
+- simplify libtool hacks
+
+{{ git_changelog }}