Initial import (#1615381)
parent
f45d5db042
commit
1cd561bf9d
@ -0,0 +1 @@
|
||||
/minizip-2.5.0.tar.gz
|
@ -0,0 +1,59 @@
|
||||
From 01bc6016fb86e6aa5b714752b7e18d6a3c96eca4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Patrik=20Novotn=C3=BD?= <panovotn@redhat.com>
|
||||
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
|
||||
|
@ -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ý <panovotn@redhat.com> 2.5.0-1
|
||||
- Version update. Build againts system bzip2.
|
||||
|
||||
* Thu Aug 9 2018 Patrik Novotný <panovotn@redhat.com> 2.3.9-1
|
||||
- Initial build
|
Loading…
Reference in new issue