From b4a8d0f3ab952638e4b4f5b47589299c14352d56e9176139309f6622665eb20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 22 Aug 2019 07:41:07 +0000 Subject: [PATCH] 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 --- fix-soversion.patch | 13 +++++++++++++ fix-zstd-test.patch | 32 ++++++++++++++++++++++++++++++++ lib-suffix.patch | 26 ++++++++++++++++++++++++++ libarchive.changes | 8 ++++++++ libarchive.spec | 29 +++++++++++++---------------- 5 files changed, 92 insertions(+), 16 deletions(-) create mode 100644 fix-soversion.patch create mode 100644 fix-zstd-test.patch create mode 100644 lib-suffix.patch diff --git a/fix-soversion.patch b/fix-soversion.patch new file mode 100644 index 0000000..9bdfe6d --- /dev/null +++ b/fix-soversion.patch @@ -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 ?? diff --git a/fix-zstd-test.patch b/fix-zstd-test.patch new file mode 100644 index 0000000..89f8d2d --- /dev/null +++ b/fix-zstd-test.patch @@ -0,0 +1,32 @@ +From ff1691b0ce507733c9655c9fa5c33bc0ae4d6b5d Mon Sep 17 00:00:00 2001 +From: Martin Matuska +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); + diff --git a/lib-suffix.patch b/lib-suffix.patch new file mode 100644 index 0000000..26669d6 --- /dev/null +++ b/lib-suffix.patch @@ -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() diff --git a/libarchive.changes b/libarchive.changes index f32c437..1ee5fb8 100644 --- a/libarchive.changes +++ b/libarchive.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sun Aug 18 12:33:05 UTC 2019 - Ismail Dönmez + +- 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 diff --git a/libarchive.spec b/libarchive.spec index 4dfa965..770b86a 100644 --- a/libarchive.spec +++ b/libarchive.spec @@ -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