cb5821
# Fedora spec file for librabbitmq
cb5821
#
cb5821
# Copyright (c) 2012-2021 Remi Collet
cb5821
# License: CC-BY-SA
cb5821
# http://creativecommons.org/licenses/by-sa/4.0/
cb5821
#
cb5821
# Please, preserve the changelog entries
cb5821
#
cb5821
cb5821
%bcond_without      tests
cb5821
cb5821
%global gh_commit   a64c08c68aff34d49a2ac152f04988cd921084f9
cb5821
%global gh_short    %(c=%{gh_commit}; echo ${c:0:7})
cb5821
%global gh_owner    alanxz
cb5821
%global gh_project  rabbitmq-c
cb5821
%global libname     librabbitmq
cb5821
%global soname      4
cb5821
cb5821
Name:      %{libname}
cb5821
Summary:   Client library for AMQP
cb5821
Version:   0.11.0
cb5821
Release:   5%{?dist}
cb5821
License:   MIT
cb5821
URL:       https://github.com/alanxz/rabbitmq-c
cb5821
cb5821
Source0:   https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
cb5821
cb5821
# don't install static library
cb5821
Patch0:    %{gh_project}-static.patch
cb5821
# fix version for cmake module
cb5821
Patch1:    %{gh_project}-version.patch
cb5821
cb5821
BuildRequires: gcc
cb5821
BuildRequires: cmake > 2.8
cb5821
BuildRequires: openssl-devel
cb5821
# For tools
cb5821
BuildRequires: popt-devel > 1.14
cb5821
# For man page
cb5821
BuildRequires: xmlto
cb5821
BuildRequires: make
cb5821
cb5821
cb5821
%description
cb5821
This is a C-language AMQP client library for use with AMQP servers
cb5821
speaking protocol versions 0-9-1.
cb5821
cb5821
cb5821
%package devel
cb5821
Summary:    Header files and development libraries for %{name}
cb5821
Requires:   %{name}%{?_isa} = %{version}-%{release}
cb5821
cb5821
%description devel
cb5821
This package contains the header files and development libraries
cb5821
for %{name}.
cb5821
cb5821
cb5821
%package tools
cb5821
Summary:    Example tools built using the librabbitmq package
cb5821
Requires:   %{name}%{?_isa} = %{version}
cb5821
cb5821
%description tools
cb5821
This package contains example tools built using %{name}.
cb5821
cb5821
It provides:
cb5821
amqp-consume        Consume messages from a queue on an AMQP server
cb5821
amqp-declare-queue  Declare a queue on an AMQP server
cb5821
amqp-delete-queue   Delete a queue from an AMQP server
cb5821
amqp-get            Get a message from a queue on an AMQP server
cb5821
amqp-publish        Publish a message on an AMQP server
cb5821
cb5821
cb5821
%prep
cb5821
%setup -q -n %{gh_project}-%{gh_commit}
cb5821
%patch0 -p1
cb5821
%patch1 -p1
cb5821
cb5821
# Copy sources to be included in -devel docs.
cb5821
cp -pr examples Examples
cb5821
cb5821
# This test requires a running server
cb5821
sed -e '/test_basic/d' -i tests/CMakeLists.txt
cb5821
cb5821
cb5821
%build
cb5821
# static lib required for tests
cb5821
%cmake \
cb5821
  -DBUILD_TOOLS_DOCS:BOOL=ON \
cb5821
%if %{with tests}
cb5821
  -DINSTALL_STATIC_LIBS:BOOL=OFF \
cb5821
%else
cb5821
  -DBUILD_TESTS:BOOL=OFF \
cb5821
  -DBUILD_STATIC_LIBS:BOOL=OFF \
cb5821
%endif
cb5821
  -S .
cb5821
cb5821
%if 0%{?cmake_build:1}
cb5821
%cmake_build
cb5821
%else
cb5821
make %{_smp_mflags}
cb5821
%endif
cb5821
cb5821
cb5821
%install
cb5821
%if 0%{?cmake_install:1}
cb5821
%cmake_install
cb5821
%else
cb5821
make install  DESTDIR="%{buildroot}"
cb5821
%endif
cb5821
cb5821
cb5821
%check
cb5821
: check .pc is usable
cb5821
grep @ %{buildroot}%{_libdir}/pkgconfig/librabbitmq.pc && exit 1
cb5821
: check cmake files are usable
cb5821
grep static %{buildroot}%{_libdir}/cmake/rabbitmq-c/*.cmake && exit 1
cb5821
cb5821
%if %{with tests}
cb5821
: upstream tests
cb5821
%if 0%{?ctest:1}
cb5821
%ctest
cb5821
%else
cb5821
make test
cb5821
%endif
cb5821
%else
cb5821
: Tests disabled
cb5821
%endif
cb5821
cb5821
cb5821
%files
cb5821
%license LICENSE-MIT
cb5821
%{_libdir}/%{libname}.so.%{soname}*
cb5821
cb5821
cb5821
%files devel
cb5821
%doc AUTHORS THANKS TODO *.md
cb5821
%doc Examples
cb5821
%{_libdir}/%{libname}.so
cb5821
%{_includedir}/amqp*
cb5821
%{_libdir}/pkgconfig/%{libname}.pc
cb5821
%{_libdir}/cmake/rabbitmq-c
cb5821
cb5821
%files tools
cb5821
%{_bindir}/amqp-*
cb5821
%doc %{_mandir}/man1/amqp-*.1*
cb5821
%doc %{_mandir}/man7/librabbitmq-tools.7*
cb5821
cb5821
cb5821
%changelog
cb5821
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.11.0-5
cb5821
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
cb5821
  Related: rhbz#1991688
cb5821
cb5821
* Wed Jun 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.11.0-4
cb5821
- Rebuilt for RHEL 9 BETA for openssl 3.0
cb5821
  Related: rhbz#1971065
cb5821
cb5821
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.11.0-3
cb5821
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
cb5821
cb5821
* Thu Apr  1 2021 Remi Collet <remi@remirepo.net> - 0.11.0-2
cb5821
- add patch to fix version in cmake file from
cb5821
  https://github.com/alanxz/rabbitmq-c/pull/667
cb5821
cb5821
* Thu Apr  1 2021 Remi Collet <remi@remirepo.net> - 0.11.0-1
cb5821
- update to 0.11.0
cb5821
- add patch to not install the static library, from
cb5821
  https://github.com/alanxz/rabbitmq-c/pull/665
cb5821
cb5821
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-4
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
cb5821
cb5821
* Thu Aug 13 2020 Remi Collet <remi@remirepo.net> - 0.10.0-3
cb5821
- fix cmake macros usage, FTBFS #1863670
cb5821
cb5821
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-2
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
cb5821
cb5821
* Mon Dec  2 2019 Remi Collet <remi@remirepo.net> - 0.10.0-1
cb5821
- update to 0.10.0
cb5821
cb5821
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-4
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
cb5821
cb5821
* Mon Feb  4 2019 Remi Collet <remi@remirepo.net> - 0.9.0-3
cb5821
- fix cmake invocation and FTBFS
cb5821
cb5821
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-3
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
cb5821
cb5821
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-2
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
cb5821
cb5821
* Tue May 15 2018 Remi Collet <remi@remirepo.net> - 0.9.0-1
cb5821
- update to 0.9.0
cb5821
cb5821
* Tue Feb 20 2018 Remi Collet <remi@remirepo.net> - 0.8.0-7
cb5821
- missing BR on C compiler
cb5821
cb5821
* Thu Feb 15 2018 Remi Collet <remi@remirepo.net> - 0.8.0-6
cb5821
- drop ldconfig scriptlets
cb5821
cb5821
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-5
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
cb5821
cb5821
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-4
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
cb5821
cb5821
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-3
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
cb5821
cb5821
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-2
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
cb5821
cb5821
* Tue Apr 12 2016 Remi Collet <remi@fedoraproject.org> - 0.8.0-1
cb5821
- update to 0.8.0
cb5821
cb5821
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-2
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
cb5821
cb5821
* Tue Oct 13 2015 Remi Collet <remi@fedoraproject.org> - 0.7.1-1
cb5821
- update to 0.7.1
cb5821
cb5821
* Fri Jul  3 2015 Remi Collet <remi@fedoraproject.org> - 0.7.0-1
cb5821
- update to 0.7.0
cb5821
- swicth to cmake
cb5821
- switch from upstream tarball to github sources
cb5821
cb5821
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-2
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
cb5821
cb5821
* Mon Apr 20 2015 Remi Collet <remi@fedoraproject.org> - 0.6.0-1
cb5821
- update to 0.6.0
cb5821
- soname changed to .4
cb5821
cb5821
* Mon Sep 15 2014 Remi Collet <remi@fedoraproject.org> - 0.5.2-1
cb5821
- update to 0.5.2
cb5821
cb5821
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-2
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
cb5821
cb5821
* Wed Aug 13 2014 Remi Collet <remi@fedoraproject.org> - 0.5.1-1
cb5821
- update to 0.5.1
cb5821
- fix license handling
cb5821
- move all documentation in devel subpackage
cb5821
cb5821
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-3
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
cb5821
cb5821
* Tue Apr 15 2014 Remi Collet <remi@fedoraproject.org> - 0.5.0-2
cb5821
- upstream patch for missing function
cb5821
cb5821
* Mon Feb 17 2014 Remi Collet <remi@fedoraproject.org> - 0.5.0-1
cb5821
- update to 0.5.0
cb5821
- open https://github.com/alanxz/rabbitmq-c/issues/169 (version is 0.5.1-pre)
cb5821
- open https://github.com/alanxz/rabbitmq-c/issues/170 (amqp_get_server_properties)
cb5821
cb5821
* Mon Jan 13 2014 Remi Collet <remi@fedoraproject.org> - 0.4.1-4
cb5821
- drop BR python-simplejson
cb5821
cb5821
* Tue Jan  7 2014 Remi Collet <remi@fedoraproject.org> - 0.4.1-3
cb5821
- fix broken librabbitmq.pc, #1039555
cb5821
- add check for usable librabbitmq.pc
cb5821
cb5821
* Thu Jan  2 2014 Remi Collet <remi@fedoraproject.org> - 0.4.1-2
cb5821
- fix Source0 URL
cb5821
cb5821
* Sat Sep 28 2013 Remi Collet <remi@fedoraproject.org> - 0.4.1-1
cb5821
- update to 0.4.1
cb5821
- add ssl support
cb5821
cb5821
* Thu Aug  1 2013 Remi Collet <remi@fedoraproject.org> - 0.3.0-3
cb5821
- cleanups
cb5821
cb5821
* Wed Mar 13 2013 Remi Collet <remi@fedoraproject.org> - 0.3.0-2
cb5821
- remove tools from main package
cb5821
cb5821
* Wed Mar 13 2013 Remi Collet <remi@fedoraproject.org> - 0.3.0-1
cb5821
- update to 0.3.0
cb5821
- create sub-package for tools
cb5821
cb5821
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-0.2.git2059570
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
cb5821
cb5821
* Wed Aug 01 2012 Remi Collet <remi@fedoraproject.org> - 0.2-0.1.git2059570
cb5821
- update to latest snapshot (version 0.2, moved to github)
cb5821
- License is now MIT
cb5821
cb5821
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-0.3.hgfb6fca832fd2
cb5821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
cb5821
cb5821
* Sun Mar 11 2012 Remi Collet <remi@fedoraproject.org> - 0.1-0.2.hgfb6fca832fd2
cb5821
- add %%check (per review comment)
cb5821
cb5821
* Sat Mar 10 2012 Remi Collet <remi@fedoraproject.org> - 0.1-0.1.hgfb6fca832fd2
cb5821
- Initial RPM
cb5821