@@ -2,14 +2,16 @@ Vendor: Microsoft Corporation
22Distribution: Azure Linux
33# Fedora spec file for librabbitmq
44#
5- # Copyright (c) 2012-2019 Remi Collet
6- # License: CC-BY-SA
5+ # Copyright (c) 2012-2024 Remi Collet
6+ # License: CC-BY-SA-4.0
77# http://creativecommons.org/licenses/by-sa/4.0/
88#
99# Please, preserve the changelog entries
1010#
1111
12- %global gh_commit ffe918a5fcef72038a88054dca3c56762b1953d4
12+ %bcond_without tests
13+
14+ %global gh_commit 124722b5045baa41a24ce2e2d7c52a47467e7ac0
1315%global gh_short %(c= %{gh_commit }; echo ${c:0:7})
1416%global gh_owner alanxz
1517%global gh_project rabbitmq-c
@@ -18,20 +20,22 @@ Distribution: Azure Linux
1820
1921Name: %{libname }
2022Summary: Client library for AMQP
21- Version: 0.10 .0
22- Release: 4 %{?dist }
23+ Version: 0.14 .0
24+ Release: 1 %{?dist }
2325License: MIT
2426URL: https://github.com/alanxz/rabbitmq-c
2527
2628Source0: https://github.com/%{gh_owner }/%{gh_project }/archive/%{gh_commit }/%{gh_project }-%{version }-%{gh_short }.tar.gz
2729
30+
2831BuildRequires: gcc
29- BuildRequires: cmake > 2.8
30- BuildRequires: openssl-devel
32+ BuildRequires: cmake >= 3.22
33+ BuildRequires: openssl-devel >= 1.1.1
3134# For tools
32- BuildRequires: popt-devel > 1.14
35+ BuildRequires: popt-devel >= 1.14
3336# For man page
3437BuildRequires: xmlto
38+ BuildRequires: make
3539
3640
3741%description
@@ -50,7 +54,7 @@ for %{name}.
5054
5155%package tools
5256Summary: Example tools built using the librabbitmq package
53- Requires: %{name }%{?_isa } = %{version }
57+ Requires: %{name }%{?_isa } = %{version }-%{ release }
5458
5559%description tools
5660This package contains example tools built using %{name }.
@@ -76,38 +80,65 @@ sed -e '/test_basic/d' -i tests/CMakeLists.txt
7680%build
7781# static lib required for tests
7882%cmake \
83+ -DBUILD_TOOLS:BOOL=ON \
7984 -DBUILD_TOOLS_DOCS:BOOL=ON \
80- -DBUILD_STATIC_LIBS:BOOL=ON \
81- .
82-
85+ %if %{with tests }
86+ -DINSTALL_STATIC_LIBS:BOOL=OFF \
87+ %else
88+ -DBUILD_TESTING:BOOL=OFF \
89+ -DBUILD_STATIC_LIBS:BOOL=OFF \
90+ %endif
91+ -S .
92+
93+ %if 0%{?cmake_build:1 }
94+ %cmake_build
95+ %else
8396make %{_smp_mflags }
97+ %endif
8498
8599
86100%install
101+ %if 0%{?cmake_install:1 }
102+ %cmake_install
103+ %else
87104make install DESTDIR=" %{buildroot}"
88-
89- rm %{buildroot }%{_libdir }/%{libname }.a
105+ %endif
90106
91107
92108%check
93109: check .pc is usable
94110grep @ %{buildroot }%{_libdir }/pkgconfig/librabbitmq.pc && exit 1
111+ grep %{version } %{buildroot }%{_libdir }/pkgconfig/librabbitmq.pc || exit 1
112+ : check cmake files are usable
113+ grep static %{buildroot }%{_libdir }/cmake/rabbitmq-c/* .cmake && exit 1
114+
95115
116+ %if %{with tests }
96117: upstream tests
118+ %if 0%{?ctest:1 }
119+ %ctest
120+ %else
97121make test
122+ %endif
123+ %else
124+ : Tests disabled
125+ %endif
98126
99127
100128%files
101- %license LICENSE-MIT
102- %{_libdir }/%{libname }.so.%{soname }*
129+ %license LICENSE
130+ %{_libdir }/%{libname }.so.%{soname }
131+ %{_libdir }/%{libname }.so.%{version }
103132
104133
105134%files devel
106- %doc AUTHORS THANKS TODO * .md
135+ %doc AUTHORS THANKS * .md
107136%doc Examples
108137%{_libdir }/%{libname }.so
109138%{_includedir }/amqp*
139+ %{_includedir }/rabbitmq-c
110140%{_libdir }/pkgconfig/%{libname }.pc
141+ %{_libdir }/cmake/rabbitmq-c
111142
112143%files tools
113144%{_bindir }/amqp-*
@@ -116,6 +147,9 @@ make test
116147
117148
118149%changelog
150+ * Tue Nov 12 2024 Sumit Jena <v-sumitjena@microsoft.com> - 0.14.0-1
151+ - Update to version 0.14.0
152+
119153* Mon Jan 24 2022 Thomas Crain <thcrain@microsoft.com> - 0.10.0-4
120154- License verified
121155
0 commit comments