commit 6b366fd02d3dc661786628a6fd7d2f1468403cc9b02d28a734ba19597aadf29f Author: Dirk Mueller Date: Tue Nov 19 11:48:01 2024 +0000 Accepting request 1224903 from home:fmccarthy:branches:devel:libraries:c_c++ Address feedback from previous submission. Fix spec file reference in _service file. OBS-URL: https://build.opensuse.org/request/show/1224903 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/pulsar-client-cpp?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..6b55e52 --- /dev/null +++ b/_service @@ -0,0 +1,18 @@ + + + git + https://github.com/apache/pulsar-client-cpp.git + v3.6.0 + v* + @PARENT_TAG@ + v(.*) + + + *.tar + xz + + + pulsar-client-cpp + pulsar-client-cpp.spec + + diff --git a/fat_lto_objects_compiler_flag.patch b/fat_lto_objects_compiler_flag.patch new file mode 100644 index 0000000..d3d3245 --- /dev/null +++ b/fat_lto_objects_compiler_flag.patch @@ -0,0 +1,18 @@ +diff -pru pulsar-client-cpp-3.6.0.orig/CMakeLists.txt pulsar-client-cpp-3.6.0.new/CMakeLists.txt +--- pulsar-client-cpp-3.6.0.orig/CMakeLists.txt 2024-08-29 10:11:24.000000000 -0400 ++++ pulsar-client-cpp-3.6.0.new/CMakeLists.txt 2024-11-15 15:04:37.125136589 -0500 +@@ -97,8 +97,11 @@ else() # GCC or Clang are mostly compati + # Options unique to Clang or GCC: + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Qunused-arguments) +- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.1)) +- add_compile_options(-Wno-stringop-truncation) ++ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ++ add_compile_options(-ffat-lto-objects) ++ if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.1)) ++ add_compile_options(-Wno-stringop-truncation) ++ endif() + endif() + endif() + +Only in pulsar-client-cpp-3.6.0.new: .CMakeLists.txt.swp diff --git a/library_install_paths_fix.patch b/library_install_paths_fix.patch new file mode 100644 index 0000000..f710eb6 --- /dev/null +++ b/library_install_paths_fix.patch @@ -0,0 +1,22 @@ +diff -ruP pulsar-client-cpp-3.6.0.orig/lib/CMakeLists.txt pulsar-client-cpp-3.6.0.new/lib/CMakeLists.txt +--- pulsar-client-cpp-3.6.0.orig/lib/CMakeLists.txt 2024-08-29 10:11:24.000000000 -0400 ++++ pulsar-client-cpp-3.6.0.new/lib/CMakeLists.txt 2024-11-05 07:20:43.601347126 -0500 +@@ -174,15 +174,15 @@ + elseif(BUILD_STATIC_LIB) + # Install regular libpulsar.a + target_link_libraries(pulsarStatic ${COMMON_LIBS}) +- install(TARGETS pulsarStatic DESTINATION lib) ++ install(TARGETS pulsarStatic DESTINATION lib64) + endif() + + if (BUILD_STATIC_LIB) +- install(TARGETS pulsarStatic DESTINATION lib) ++ install(TARGETS pulsarStatic DESTINATION lib64) + endif() + + if (BUILD_DYNAMIC_LIB) +- install(TARGETS pulsarShared RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ++ install(TARGETS pulsarShared RUNTIME DESTINATION bin LIBRARY DESTINATION lib64 ARCHIVE DESTINATION lib64) + endif() + + install(DIRECTORY "../include/pulsar" DESTINATION include) diff --git a/pulsar-client-cpp-3.6.0.tar.xz b/pulsar-client-cpp-3.6.0.tar.xz new file mode 100644 index 0000000..00cccfa --- /dev/null +++ b/pulsar-client-cpp-3.6.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76a6209fadd5944390e9ddedb6e79b08852164e4a60b7bebe14483e182f5cf69 +size 4341448 diff --git a/pulsar-client-cpp-rpmlintrc b/pulsar-client-cpp-rpmlintrc new file mode 100644 index 0000000..210733c --- /dev/null +++ b/pulsar-client-cpp-rpmlintrc @@ -0,0 +1,4 @@ +# Built library name, libpulsar, doesn't align with package name, +# pulsar-client-cpp so disable the W: no-dependency-on warning for +# SLE builds. +addFilter("pulsar-client-cpp-devel\..*: W: no-dependency-on pulsar-client-cpp.*") diff --git a/pulsar-client-cpp.changes b/pulsar-client-cpp.changes new file mode 100644 index 0000000..2248573 --- /dev/null +++ b/pulsar-client-cpp.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Mon Nov 4 13:43:04 UTC 2024 - Fergal Mc Carthy - 3.6.0 + +- Initial version based upon v3.6.0 release diff --git a/pulsar-client-cpp.spec b/pulsar-client-cpp.spec new file mode 100644 index 0000000..342cee3 --- /dev/null +++ b/pulsar-client-cpp.spec @@ -0,0 +1,173 @@ +# +# spec file for package pulsar-client-cpp +# +# 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/ +# + +# disable 32 bit builds +ExcludeArch: %{ix86} %{arm32} + +# optionally build the static libraries +%bcond_with static_libs + +# optionally allow building of tests +%bcond_with build_tests + +# disable running tests by default - local docker instance required +%bcond_with run_tests + +%if 0%{?sle_version} && 0%{?sle_version} < 160000 +%define force_gcc_version 13 +%endif + +# pulsar library version suffix +%define so_sfx 3_6_0 + +# pulsar library name +%define lib_name pulsar + +Name: pulsar-client-cpp +Version: 3.6.0 +Release: 0 +Summary: Pulsar C++ client library +Group: Development/Languages/C and C++ +License: Apache-2.0 +URL: https://github.com/apache/pulsar-client-cpp +Source0: https://github.com/apache/pulsar-client-cpp/archive/refs/tags/v%{version}.tar.gz#/pulsar-client-cpp-%{version}.tar.xz +# PATCH-FIX-OPENSUSE library_install_paths_fix.patch +Patch0: library_install_paths_fix.patch +# PATCH-FIX-OPENSUSE fat_lto_objects_compiler_flag.patch +Patch1: fat_lto_objects_compiler_flag.patch +BuildRequires: cmake +BuildRequires: gcc%{?force_gcc_version} +BuildRequires: gcc%{?force_gcc_version}-c++ +BuildRequires: boost-devel +BuildRequires: libcurl-devel +BuildRequires: libopenssl-1_1-devel +BuildRequires: libzstd-devel +BuildRequires: protobuf-devel < 26 +BuildRequires: snappy-devel +BuildRequires: zlib-devel +%if %{with buiid_tests} || %{with run_tests} +# SECTION test requirements +BuildRequires: cmake(GTest) +BuildRequires: git +# /SECTION +%endif + +%description +The Apache Pulsar C++ client supports a variety of Apache Pulsar features +to enable building applications connecting to your Apache Pulsar cluster. + +%package devel +Summary: Development files for Apache Pulsar +Requires: lib%{lib_name}%{so_sfx} = %{version} +%if %{with static_libs} +Suggests: %{name}-devel-static = %{version} +%endif + +%description devel +The Apache Pulsar C++ client supports a variety of Apache Pulsar features +to enable building applications connecting to your Apache Pulsar cluster. + +This package provides the development libraries and headers for Apache +Pulsar. + +%if %{with static_libs} +%package devel-static +Summary: Development files for Apache Pulsar +Requires: lib%{lib_name}%{so_sfx} = %{version} + +%description devel-static +The Apache Pulsar C++ client supports a variety of Apache Pulsar features +to enable building applications connecting to your Apache Pulsar cluster. + +This package provides the static library for Apache Pulsar. +%endif + +%package -n lib%{lib_name}%{so_sfx} +Summary: Development files for Apache Pulsar - shared library + +%description -n lib%{lib_name}%{so_sfx} +The Apache Pulsar C++ client supports a variety of Apache Pulsar features +to enable building applications connecting to your Apache Pulsar cluster. + +This package provides the shared library for Apache Arrow. + +%prep +%autosetup -p1 -n pulsar-client-cpp-%{version} + +%build +export PULSAR_LIBRARY_VERSION=%{version} +%cmake \ +%if 0%{?force_gcc_version} + -DCMAKE_C_COMPILER=gcc-%{force_gcc_version} \ + -DCMAKE_CXX_COMPILER=g++-%{force_gcc_version} \ +%endif + -DCMAKE_CXX_STANDARD=14 \ +%if %{without static_libs} + -DBUILD_STATIC_LIB:BOOL=OFF \ +%endif +%if %{without buiid_tests} + -DBUILD_TESTS:BOOL=OFF \ +%endif +%{nil} + +%cmake_build + +%install +%cmake_install + +%check +# run pulsar unit tests if enabled +# NOTE: pulsar unit tests require docker to run +%if %{with run_tests} +export RETRY_FAILED=3 +./run-unit-tests.sh +%endif + +# run pulsar service based tests if enabled +# NOTE: pulsar service based tests require docker to run +%if 0%{with run_tests} +./pulsar-test-service-start.sh +pushd tests +./pulsar-tests +popd +./pulsar-test-service-stop.sh +%endif + +%ldconfig_scriptlets -n lib%{lib_name}%{so_sfx} + +%files devel +%doc README.md +%license LICENSE NOTICE +%dir %{_includedir}/pulsar +%{_includedir}/pulsar/*.h +%dir %{_includedir}/pulsar/c/ +%{_includedir}/pulsar/c/*.h +%{_libdir}/lib%{lib_name}.so + +%if %{with static_libs} +%files devel-static +%doc README.md +%license LICENSE NOTICE +%{_libdir}/lib%{lib_name}.a +%endif + +%files -n lib%{lib_name}%{so_sfx} +%doc README.md +%license LICENSE NOTICE +%{_libdir}/lib%{lib_name}.so.%{version} + +%changelog