Accepting request 724492 from home:namtrac:branches:Archiving

- Switch to cmake build 
- Add lib-suffix.patch to honor LIB_SUFFIX
- Add fix-zstd-test.patch to fix zstd test
- Add fix-soversion.patch to fix the soversion to 13 as autotools

OBS-URL: https://build.opensuse.org/request/show/724492
OBS-URL: https://build.opensuse.org/package/show/Archiving/libarchive?expand=0&rev=89
This commit is contained in:
Adrian Schröter 2019-08-22 07:41:07 +00:00 committed by Git OBS Bridge
parent edfffe5861
commit b4a8d0f3ab
5 changed files with 92 additions and 16 deletions

13
fix-soversion.patch Normal file
View File

@ -0,0 +1,13 @@
Index: libarchive-3.4.0/CMakeLists.txt
===================================================================
--- libarchive-3.4.0.orig/CMakeLists.txt
+++ libarchive-3.4.0/CMakeLists.txt
@@ -71,7 +71,7 @@ SET(LIBARCHIVE_VERSION_STRING "${VERSIO
# libarchive 2.9 == interface version 11 = 2 + 9
# libarchive 3.0 == interface version 12
# libarchive 3.1 == interface version 13
-math(EXPR INTERFACE_VERSION "13 + ${_minor}")
+set(INTERFACE_VERSION "13")
# Set SOVERSION == Interface version
# ?? Should there be more here ??

32
fix-zstd-test.patch Normal file
View File

@ -0,0 +1,32 @@
From ff1691b0ce507733c9655c9fa5c33bc0ae4d6b5d Mon Sep 17 00:00:00 2001
From: Martin Matuska <martin@matuska.org>
Date: Mon, 12 Aug 2019 00:14:00 +0200
Subject: [PATCH] test_write_filter_zstd: set compression level to 7
Fixes #1226
---
libarchive/test/test_write_filter_zstd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libarchive/test/test_write_filter_zstd.c b/libarchive/test/test_write_filter_zstd.c
index da3c80667..9fb01906d 100644
--- a/libarchive/test/test_write_filter_zstd.c
+++ b/libarchive/test/test_write_filter_zstd.c
@@ -125,7 +125,7 @@ DEFINE_TEST(test_write_filter_zstd)
assertEqualIntA(a, ARCHIVE_OK,
archive_write_set_filter_option(a, NULL, "compression-level", "9"));
assertEqualIntA(a, ARCHIVE_OK,
- archive_write_set_filter_option(a, NULL, "compression-level", "6"));
+ archive_write_set_filter_option(a, NULL, "compression-level", "7"));
assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 100; i++) {
sprintf(path, "file%03d", i);
@@ -140,7 +140,7 @@ DEFINE_TEST(test_write_filter_zstd)
assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- failure("compression-level=6 wrote %d bytes, default wrote %d bytes",
+ failure("compression-level=7 wrote %d bytes, default wrote %d bytes",
(int)used2, (int)used1);
assert(used2 < used1);

26
lib-suffix.patch Normal file
View File

@ -0,0 +1,26 @@
Index: libarchive-3.4.0/build/cmake/CreatePkgConfigFile.cmake
===================================================================
--- libarchive-3.4.0.orig/build/cmake/CreatePkgConfigFile.cmake
+++ libarchive-3.4.0/build/cmake/CreatePkgConfigFile.cmake
@@ -29,5 +29,5 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DI
# And install it, of course ;).
IF(ENABLE_INSTALL)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc
- DESTINATION "lib/pkgconfig")
+ DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
ENDIF()
Index: libarchive-3.4.0/libarchive/CMakeLists.txt
===================================================================
--- libarchive-3.4.0.orig/libarchive/CMakeLists.txt
+++ libarchive-3.4.0/libarchive/CMakeLists.txt
@@ -254,8 +254,8 @@ IF(ENABLE_INSTALL)
# How to install the libraries
INSTALL(TARGETS archive archive_static
RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib)
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
+ ARCHIVE DESTINATION lib${LIB_SUFFIX})
INSTALL_MAN(${libarchive_MANS})
INSTALL(FILES ${include_HEADERS} DESTINATION include)
ENDIF()

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Sun Aug 18 12:33:05 UTC 2019 - Ismail Dönmez <idonmez@suse.com>
- Switch to cmake build
- Add lib-suffix.patch to honor LIB_SUFFIX
- Add fix-zstd-test.patch to fix zstd test
- Add fix-soversion.patch to fix the soversion to 13 as autotools
-------------------------------------------------------------------
Thu Jun 20 11:35:15 UTC 2019 - Ismail Dönmez <idonmez@suse.com>

View File

@ -40,12 +40,17 @@ Source0: https://github.com/libarchive/libarchive/releases/download/v%{ve
Source1: https://github.com/libarchive/libarchive/releases/download/v%{version}/libarchive-%{version}.tar.gz.asc
Source2: libarchive.keyring
Source1000: baselibs.conf
Patch1: lib-suffix.patch
Patch2: fix-zstd-test.patch
Patch3: fix-soversion.patch
BuildRequires: cmake
BuildRequires: libacl-devel
BuildRequires: libbz2-devel
BuildRequires: liblz4-devel
BuildRequires: libtool
BuildRequires: libxml2-devel
BuildRequires: libzstd-devel
BuildRequires: ninja
BuildRequires: pkgconfig
BuildRequires: xz-devel
BuildRequires: zlib-devel
@ -159,29 +164,21 @@ Static library for libarchive
%prep
%setup -q
%autopatch -p1
%build
export CFLAGS="%{optflags} -D_REENTRANT -pipe"
export CXXFLAGS="$CFLAGS"
%configure \
--disable-silent-rules \
%if %{without static_libs}
--disable-static \
%endif
--enable-bsdcpio
# lzma mt detection is broken
sed -i -e "/HAVE_LZMA_STREAM_ENCODER_MT/d" config.h
make %{?_smp_mflags}
%define __builder ninja
%cmake
%cmake_build
%check
# test suite is a bit racy unfortunatly, so give it three attempts
make %{?_smp_mflags} check || make check || make check
ninja test -C build
%install
%make_install
%cmake_install
find %{buildroot} -type f -name "*.la" -delete -print
rm "%{buildroot}%{_libdir}/libarchive.a"
rm "%{buildroot}%{_mandir}/man5/"{tar,cpio,mtree}.5*
sed -i -e '/Libs.private/d' %{buildroot}%{_libdir}/pkgconfig/libarchive.pc