From 1cd561bf9d54991b21dfdb7118c0cd9dcae9ae01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Novotn=C3=BD?= Date: Wed, 29 Aug 2018 15:36:56 +0200 Subject: [PATCH] Initial import (#1615381) --- .gitignore | 1 + minizip-2.5.0-1_system-bzip2-linking.patch | 59 +++++++++++++++++++ minizip.spec | 66 ++++++++++++++++++++++ sources | 1 + 4 files changed, 127 insertions(+) create mode 100644 .gitignore create mode 100644 minizip-2.5.0-1_system-bzip2-linking.patch create mode 100644 minizip.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2ef15b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/minizip-2.5.0.tar.gz diff --git a/minizip-2.5.0-1_system-bzip2-linking.patch b/minizip-2.5.0-1_system-bzip2-linking.patch new file mode 100644 index 0000000..dd96584 --- /dev/null +++ b/minizip-2.5.0-1_system-bzip2-linking.patch @@ -0,0 +1,59 @@ +From 01bc6016fb86e6aa5b714752b7e18d6a3c96eca4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Patrik=20Novotn=C3=BD?= +Date: Fri, 17 Aug 2018 10:38:13 +0200 +Subject: [PATCH] use system Bzip2 library if available + +--- + CMakeLists.txt | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 11f35dd..c6606b6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -45,6 +45,16 @@ if(USE_ZLIB) + add_definitions(-DHAVE_ZLIB) + endif() + ++# Check if bzip2 installation is present ++if(USE_BZIP2) ++ set(BZIP2_ROOT ${DEF_BZIP2_ROOT} CACHE PATH "Parent directory of bzip2 installation") ++ find_package(BZip2) ++ if(BZIP2_FOUND) ++ include_directories(${BZIP2_INCLUDE_DIRS}) ++ endif() ++ add_definitions(-DHAVE_BZIP2) ++endif() ++ + set(MINIZIP_PC ${CMAKE_CURRENT_BINARY_DIR}/minizip.pc) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/minizip.pc.cmakein ${MINIZIP_PC} @ONLY) + +@@ -202,7 +212,14 @@ if(USE_ZLIB) + endif() + endif() + +-if(USE_BZIP2) ++if(USE_BZIP2 AND BZIP2_FOUND) ++ add_definitions(-DHAVE_BZIP2) ++ ++ list(APPEND MINIZIP_SRC "mz_strm_bzip.c") ++ list(APPEND MINIZIP_PUBLIC_HEADERS "mz_strm_bzip.h") ++ ++ set(CMAKE_REQUIRED_LIBRARIES BZip2::BZip2) ++elseif(USE_BZIP2) + add_definitions(-DHAVE_BZIP2) + add_definitions(-DBZ_NO_STDIO) + +@@ -370,6 +387,9 @@ set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE C PREFIX "" + if(USE_ZLIB) + target_link_libraries(${PROJECT_NAME} ZLIB::ZLIB) + endif() ++if(USE_BZIP2 AND BZIP2_FOUND) ++ target_link_libraries(${PROJECT_NAME} BZip2::BZip2) ++endif() + if(USE_LZMA) + set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 99) + endif() +-- +2.17.1 + diff --git a/minizip.spec b/minizip.spec new file mode 100644 index 0000000..ec731ea --- /dev/null +++ b/minizip.spec @@ -0,0 +1,66 @@ +Name: minizip +Version: 2.5.0 +Release: 1%{?dist} +Summary: Minizip contrib in zlib with the latest bug fixes and advanced features + +License: zlib +URL: https://github.com/nmoinvaz/%{name} +Source0: https://github.com/nmoinvaz/%{name}/archive/%{version}/%{name}-%{version}.tar.gz + +# https://github.com/nmoinvaz/minizip/pull/297 +Patch0: minizip-2.5.0-1_system-bzip2-linking.patch +BuildRequires: cmake gcc-c++ libbsd-devel zlib-devel bzip2-devel + + +%description +Minizip zlib contribution that includes: +* AES encryption +* I/O buffering +* PKWARE disk splitting +It also has the latest bug fixes that having been found all over the internet. + + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: cmake zlib-devel + + +%description devel +Development files for %{name} library. + + +%prep +%autosetup +rm -rf lib/bzip2 + + +%build +%cmake . +make %{?_smp_mflags} + +%install +%make_install + + +%ldconfig_scriptlets + + +%files +%license LICENSE +%doc README.md +%{_libdir}/lib%{name}.so.* + + +%files devel +%{_libdir}/lib%{name}.so +%{_libdir}/pkgconfig/%{name}.pc +%{_libdir}/cmake/%{name} +%{_includedir}/mz*.h + +%changelog +* Thu Aug 16 2018 Patrik Novotný 2.5.0-1 +- Version update. Build againts system bzip2. + +* Thu Aug 9 2018 Patrik Novotný 2.3.9-1 +- Initial build diff --git a/sources b/sources new file mode 100644 index 0000000..4fc01a7 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (minizip-2.5.0.tar.gz) = 321d88754159c982650966b14be8e9d47eb64fc692ea699f5890fe5bf27576899aaa7f750cce77d59cd17b5bd365cdf75dc43f21c11b9330568a806f898171c6