File libamqpcpp.spec of Package libamqpcpp

#
# spec file for package libamqpcpp
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define major 4
%define minor 3
%define patch 27

Name:           libamqpcpp
Version:        %{major}.%{minor}.%{patch}
Release:        1%{?dist}
Summary:        C++ library for asynchronous non-blocking communication with RabbitMQ
License:        Apache-2.0
Group:          Development/Libraries/C++
URL:            https://github.com/CopernicaMarketingSoftware/AMQP-CPP
Source0:        https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v%{version}.tar.gz#/AMQP-CPP-%{version}.tar.gz
Patch1:         0001-Use-GNUInstallDirs-cmake-module.patch
Patch2:         0001-Fix-TCP-module-build-for-old-gcc-versions.patch
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  make
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(openssl)

%description
AMQP-CPP is a C++ library for communicating with a RabbitMQ message broker.
The library can be used to parse incoming data from a RabbitMQ server, and to
generate frames that can be sent to a RabbitMQ server.

%prep
%autosetup -p1 -n AMQP-CPP-%{version}

%package -n %{name}%{major}_%{minor}
Summary:        C++ library for asynchronous non-blocking communication with RabbitMQ
Group:          System/Libraries

%description -n %{name}%{major}_%{minor}
AMQP-CPP is a C++ library for communicating with a RabbitMQ message broker.
The library can be used to parse incoming data from a RabbitMQ server, and to
generate frames that can be sent to a RabbitMQ server.

%package devel
Summary:        Header files and libraries for %{name}
Group:          Development/Libraries/C++
Requires:       %{name}%{major}_%{minor} = %{version}
Requires:       pkgconfig(openssl)

%description devel
Provides the header files and libraries for %{name}.

%package examples
Summary:        Example code for %{name}
Group:          Development/Tools/Other

%description examples
Provides examples for using %{name}.

%build
%cmake -DAMQP-CPP_BUILD_SHARED:BOOL=ON -DAMQP-CPP_LINUX_TCP:BOOL=ON
%cmake_build

%install
%cmake_install

%post -n %{name}%{major}_%{minor} -p /sbin/ldconfig

%postun -n %{name}%{major}_%{minor} -p /sbin/ldconfig

%files devel
%defattr(-,root,root,-)
%doc README*
%if 0%{?suse_version}
%doc LICENSE
%else
%license LICENSE
%endif
%dir %{_includedir}/amqpcpp
%{_includedir}/amqpcpp/*.h
%dir %{_includedir}/amqpcpp/linux_tcp
%{_includedir}/amqpcpp/linux_tcp/*.h
%{_includedir}/amqpcpp.h
%{_libdir}/libamqpcpp.so
%dir %{_libdir}/cmake/amqpcpp
%{_libdir}/cmake/amqpcpp/*.cmake
%{_libdir}/pkgconfig/amqpcpp.pc

%files examples
%defattr(-,root,root,-)
%doc examples/*
%if 0%{?suse_version}
%doc LICENSE
%else
%license LICENSE
%endif

%files -n %{name}%{major}_%{minor}
%defattr(-,root,root,-)
%doc README*
%if 0%{?suse_version}
%doc LICENSE
%else
%license LICENSE
%endif
%{_libdir}/libamqpcpp.so.%{major}.%{minor}

%changelog
openSUSE Build Service is sponsored by