update to 0.12.0

add patch to not install the static library, from
  https://github.com/alanxz/rabbitmq-c/pull/749
add patch to fix version in pkgconfig file, from
  https://github.com/alanxz/rabbitmq-c/pull/751
This commit is contained in:
Remi Collet 2023-02-02 07:55:38 +01:00
parent 4a19c1cd27
commit 6d8fc3cdc8
6 changed files with 80 additions and 60 deletions

1
.gitignore vendored
View File

@ -15,3 +15,4 @@ clog
/rabbitmq-c-0.9.0-77e3805.tar.gz
/rabbitmq-c-0.10.0-ffe918a.tar.gz
/rabbitmq-c-0.11.0-a64c08c.tar.gz
/rabbitmq-c-0.12.0-675afc2.tar.gz

View File

@ -1,7 +1,7 @@
# Fedora spec file for librabbitmq
#
# Copyright (c) 2012-2021 Remi Collet
# License: CC-BY-SA
# Copyright (c) 2012-2023 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
@ -9,7 +9,7 @@
%bcond_without tests
%global gh_commit a64c08c68aff34d49a2ac152f04988cd921084f9
%global gh_commit 675afc2c7c2f556c7fb7c1db7d3b05ce82adfb70
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner alanxz
%global gh_project rabbitmq-c
@ -18,8 +18,8 @@
Name: %{libname}
Summary: Client library for AMQP
Version: 0.11.0
Release: 7%{?dist}
Version: 0.12.0
Release: 1%{?dist}
License: MIT
URL: https://github.com/alanxz/rabbitmq-c
@ -27,12 +27,12 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{g
# don't install static library
Patch0: %{gh_project}-static.patch
# fix version for cmake module
Patch1: %{gh_project}-version.patch
# fix version in pkgconfig file
Patch1: %{gh_project}-pkg.patch
BuildRequires: gcc
BuildRequires: cmake > 2.8
BuildRequires: openssl-devel
BuildRequires: cmake > 3.12
BuildRequires: openssl-devel >= 1.1.1
# For tools
BuildRequires: popt-devel > 1.14
# For man page
@ -84,11 +84,12 @@ sed -e '/test_basic/d' -i tests/CMakeLists.txt
%build
# static lib required for tests
%cmake \
-DBUILD_TOOLS:BOOL=ON \
-DBUILD_TOOLS_DOCS:BOOL=ON \
%if %{with tests}
-DINSTALL_STATIC_LIBS:BOOL=OFF \
%else
-DBUILD_TESTS:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DBUILD_STATIC_LIBS:BOOL=OFF \
%endif
-S .
@ -111,9 +112,11 @@ make install DESTDIR="%{buildroot}"
%check
: check .pc is usable
grep @ %{buildroot}%{_libdir}/pkgconfig/librabbitmq.pc && exit 1
grep %{version} %{buildroot}%{_libdir}/pkgconfig/librabbitmq.pc || exit 1
: check cmake files are usable
grep static %{buildroot}%{_libdir}/cmake/rabbitmq-c/*.cmake && exit 1
%if %{with tests}
: upstream tests
%if 0%{?ctest:1}
@ -127,8 +130,9 @@ make test
%files
%license LICENSE-MIT
%{_libdir}/%{libname}.so.%{soname}*
%license LICENSE
%{_libdir}/%{libname}.so.%{soname}
%{_libdir}/%{libname}.so.%{version}
%files devel
@ -136,6 +140,7 @@ make test
%doc Examples
%{_libdir}/%{libname}.so
%{_includedir}/amqp*
%{_includedir}/rabbitmq-c
%{_libdir}/pkgconfig/%{libname}.pc
%{_libdir}/cmake/rabbitmq-c
@ -146,6 +151,13 @@ make test
%changelog
* Wed Feb 1 2023 Remi Collet <remi@remirepo.net> - 0.12.0-1
- update to 0.12.0
- add patch to not install the static library, from
https://github.com/alanxz/rabbitmq-c/pull/749
- add patch to fix version in pkgconfig file, from
https://github.com/alanxz/rabbitmq-c/pull/751
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

22
rabbitmq-c-pkg.patch Normal file
View File

@ -0,0 +1,22 @@
From f97f91c5d1db9ae97f3e1ac743ef63c1ccde4edc Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Thu, 2 Feb 2023 07:38:06 +0100
Subject: [PATCH] fix empty version for pkjgconfig
---
librabbitmq.pc.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/librabbitmq.pc.in b/librabbitmq.pc.in
index 39401807..711d01d2 100644
--- a/librabbitmq.pc.in
+++ b/librabbitmq.pc.in
@@ -5,7 +5,7 @@ includedir=@includedir@
Name: rabbitmq-c
Description: An AMQP 0-9-1 client library
-Version: @VERSION@
+Version: @RMQ_VERSION@
URL: https://github.com/alanxz/rabbitmq-c
Requires.private: @requires_private@
Libs: -L${libdir} -lrabbitmq

View File

@ -1,41 +1,51 @@
From a8c05cb16afbf852fc584f2c2d31d2f7f0e3a48d Mon Sep 17 00:00:00 2001
From e1a9b7148e7ae7c55b59249e506d644af38492ed Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Thu, 1 Apr 2021 11:21:36 +0200
Date: Wed, 1 Feb 2023 16:39:57 +0100
Subject: [PATCH] add option to install or not the static library
---
CMakeLists.txt | 1 +
CMakeLists.txt | 3 ++-
librabbitmq/CMakeLists.txt | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a9a29fdd..a7cf8f2c 100644
index cc61e88f..7b7590f1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -245,6 +245,7 @@ endif()
@@ -129,6 +129,7 @@ include(CMakeDependentOption)
option(BUILD_SHARED_LIBS "Build rabbitmq-c as a shared library" ON)
option(BUILD_STATIC_LIBS "Build rabbitmq-c as a static library" ON)
+option(INSTALL_STATIC_LIBS "Install rabbitmq-c static library" ON)
option(BUILD_EXAMPLES "Build Examples" ON)
option(BUILD_TOOLS "Build Tools (requires POPT Library)" ${POPT_FOUND})
option(BUILD_EXAMPLES "Build Examples" OFF)
option(BUILD_TOOLS "Build Tools (requires POPT Library)" OFF)
@@ -244,7 +245,7 @@ configure_package_config_file(
if(BUILD_SHARED_LIBS)
list(APPEND INSTALL_TARGETS rabbitmq)
endif()
-if(BUILD_STATIC_LIBS)
+if(BUILD_STATIC_LIBS AND INSTALL_STATIC_LIBS)
list(APPEND INSTALL_TARGETS rabbitmq-static)
endif()
diff --git a/librabbitmq/CMakeLists.txt b/librabbitmq/CMakeLists.txt
index d8dcd262..72b4a875 100644
index 1cc58d58..347c992f 100644
--- a/librabbitmq/CMakeLists.txt
+++ b/librabbitmq/CMakeLists.txt
@@ -154,9 +154,11 @@ if (BUILD_STATIC_LIBS)
set_target_properties(rabbitmq-static PROPERTIES VERSION ${RMQ_VERSION} SOVERSION ${RMQ_SOVERSION} OUTPUT_NAME rabbitmq)
endif (WIN32)
@@ -142,10 +142,12 @@ if(BUILD_STATIC_LIBS)
set_target_properties(rabbitmq-static PROPERTIES COMPILE_OPTIONS "/Z7")
endif()
- install(TARGETS rabbitmq-static EXPORT "${targets_export_name}"
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- )
+ if (INSTALL_STATIC_LIBS)
+ install(TARGETS rabbitmq-static EXPORT "${targets_export_name}"
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ )
+ endif (INSTALL_STATIC_LIBS)
- install(TARGETS rabbitmq-static EXPORT "${targets_export_name}"
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ if(INSTALL_STATIC_LIBS)
+ install(TARGETS rabbitmq-static EXPORT "${targets_export_name}"
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT rabbitmq-c-development
- )
+ )
+ endif()
if (NOT DEFINED RMQ_LIBRARY_TARGET)
set(RMQ_LIBRARY_TARGET rabbitmq-static)
add_library(rabbitmq::rabbitmq-static ALIAS rabbitmq-static)
endif()

View File

@ -1,25 +0,0 @@
From 2a9ae303f7fa7bc115ecb827c1c3c7c9f84558dd Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Thu, 1 Apr 2021 14:48:25 +0200
Subject: [PATCH] Fix #666 bad PACKAGE_VERSION
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a9a29fd..74364cf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -322,7 +322,7 @@ set(version_config "${CMAKE_CURRENT_BINARY_DIR}/rabbitmq-c-config-version.cmake"
write_basic_package_version_file(
"${version_config}"
- VERSION ${RMQ_VERSION}
+ VERSION ${VERSION}
COMPATIBILITY AnyNewerVersion)
configure_package_config_file(
--
2.30.2

View File

@ -1 +1 @@
SHA512 (rabbitmq-c-0.11.0-a64c08c.tar.gz) = 0e0c77c3ce2de49841b4d2a8745bfdb118fc3bdf924c1f60d8ca168d7a933276f5d86e1d1440c2936859e6a6bddeb77eaa3c59f5f20e998160dde7d57cea4282
SHA512 (rabbitmq-c-0.12.0-675afc2.tar.gz) = 522a7d52a156fe7510d37087582177cc50648559ab0d7626abf8d3ca1f94913a28438dc8334d50c2652d6d571baf23562b9ff73ddbaa221913ad2fd4b6b7ca25