diff --git a/.leatherman.metadata b/.leatherman.metadata new file mode 100644 index 0000000..9e91aef --- /dev/null +++ b/.leatherman.metadata @@ -0,0 +1 @@ +bb7b47d1a5c1b4620599e6e8f6876e4db45328f0 SOURCES/leatherman-1.12.0.tar.gz diff --git a/SOURCES/leatherman-1.12.4-shared_nowide.patch b/SOURCES/leatherman-1.12.4-shared_nowide.patch new file mode 100644 index 0000000..74a12a4 --- /dev/null +++ b/SOURCES/leatherman-1.12.4-shared_nowide.patch @@ -0,0 +1,101 @@ +--- a/nowide/CMakeLists.txt~ 2020-12-09 04:17:13.000000000 -0600 ++++ b/nowide/CMakeLists.txt 2021-03-09 08:57:57.469391575 -0600 +@@ -1,7 +1,5 @@ + find_package(Boost 1.54 REQUIRED) + +-add_leatherman_includes(${Boost_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/../vendor/nowide/include") +-add_leatherman_headers(../vendor/nowide/include/boost) + if(WIN32) + add_leatherman_library(../vendor/nowide/src/iostream.cpp) + endif() +--- a/execution/CMakeLists.txt~ 2020-12-09 04:17:13.000000000 -0600 ++++ b/execution/CMakeLists.txt 2021-03-09 08:59:46.136860198 -0600 +@@ -1,4 +1,4 @@ +-find_package(Boost 1.54 REQUIRED COMPONENTS regex filesystem system) ++find_package(Boost 1.73 REQUIRED COMPONENTS regex filesystem system nowide) + + add_leatherman_deps("${Boost_LIBRARIES}") + if ("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS") +@@ -10,7 +10,6 @@ + add_leatherman_includes("${Boost_INCLUDE_DIRS}") + + leatherman_dependency(util) +-leatherman_dependency(nowide) + leatherman_dependency(locale) + leatherman_dependency(logging) + leatherman_dependency(file_util) +--- a/file_util/CMakeLists.txt~ 2020-12-09 04:17:13.000000000 -0600 ++++ b/file_util/CMakeLists.txt 2021-03-09 09:00:26.641683668 -0600 +@@ -1,9 +1,8 @@ +-find_package(Boost 1.54 REQUIRED COMPONENTS regex filesystem system) ++find_package(Boost 1.54 REQUIRED COMPONENTS regex filesystem system nowide) + + add_leatherman_deps("${Boost_LIBRARIES}") + add_leatherman_includes("${Boost_INCLUDE_DIRS}") + +-leatherman_dependency(nowide) + leatherman_dependency(locale) + leatherman_dependency(logging) + leatherman_dependency(util) +--- a/logging/CMakeLists.txt~ 2020-12-09 04:17:13.000000000 -0600 ++++ b/logging/CMakeLists.txt 2021-03-09 09:01:03.565522737 -0600 +@@ -4,7 +4,6 @@ + add_leatherman_deps(${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + add_leatherman_includes("${Boost_INCLUDE_DIRS}") + +-leatherman_dependency(nowide) + leatherman_dependency(locale) + + if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "SunOS") +--- a/tests/CMakeLists.txt~ 2020-12-09 04:17:13.000000000 -0600 ++++ b/tests/CMakeLists.txt 2021-03-09 09:01:47.352331908 -0600 +@@ -1,8 +1,8 @@ +-set(BOOST_REQUIRED_COMPONENTS system date_time chrono log log_setup thread filesystem regex) ++set(BOOST_REQUIRED_COMPONENTS system date_time chrono log log_setup thread filesystem regex nowide) + if (LEATHERMAN_USE_LOCALES) + set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} locale) + endif() +-find_package(Boost "1.54" REQUIRED COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) ++find_package(Boost "1.73" REQUIRED COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) + + include_directories(BEFORE ${LEATHERMAN_CATCH_INCLUDE} ${LEATHERMAN_INCLUDE_DIRS}) + add_executable(leatherman_test main.cc ${LEATHERMAN_TEST_SRCS}) +--- a/file_util/src/file.cc~ 2020-12-09 04:17:13.000000000 -0600 ++++ b/file_util/src/file.cc 2021-03-09 09:02:58.297022731 -0600 +@@ -1,6 +1,6 @@ + #include + #include +-#include ++#include + #include + #include + #include +--- a/util/src/environment.cc~ 2020-12-09 04:17:13.000000000 -0600 ++++ b/util/src/environment.cc 2021-03-09 09:03:39.013845293 -0600 +@@ -1,5 +1,5 @@ + #include +-#include ++#include + #include + + using namespace std; +--- a/util/tests/environment.cc~ 2020-12-09 04:17:13.000000000 -0600 ++++ b/util/tests/environment.cc 2021-03-09 09:04:22.487655817 -0600 +@@ -1,6 +1,6 @@ + #include + #include +-#include ++#include + + using namespace std; + using namespace leatherman::util; +--- a/util/CMakeLists.txt~ 2020-12-09 04:17:13.000000000 -0600 ++++ b/util/CMakeLists.txt 2021-03-18 09:40:55.004699613 -0500 +@@ -1,6 +1,6 @@ + find_package(Boost 1.54 REQUIRED date_time chrono system) + +-add_leatherman_deps(${Boost_LIBRARIES}) ++add_leatherman_deps(${Boost_LIBRARIES} -lboost_nowide) + add_leatherman_includes("${Boost_INCLUDE_DIRS}") + + leatherman_dependency(nowide) diff --git a/SOURCES/leatherman-gcc10.patch b/SOURCES/leatherman-gcc10.patch new file mode 100644 index 0000000..4e5d51e --- /dev/null +++ b/SOURCES/leatherman-gcc10.patch @@ -0,0 +1,9 @@ +--- leatherman-1.10.0/util/src/environment.cc~ 2020-06-02 23:10:13.101632739 +0100 ++++ leatherman-1.10.0/util/src/environment.cc 2020-06-02 23:10:25.560638191 +0100 +@@ -1,5 +1,6 @@ + #include + #include ++#include + + using namespace std; + diff --git a/SOURCES/leatherman-gcc11.patch b/SOURCES/leatherman-gcc11.patch new file mode 100644 index 0000000..4ef6eee --- /dev/null +++ b/SOURCES/leatherman-gcc11.patch @@ -0,0 +1,38 @@ +diff --git a/curl/src/client.cc b/curl/src/client.cc +index 558db6d..d27bb36 100644 +--- a/curl/src/client.cc ++++ b/curl/src/client.cc +@@ -1,3 +1,4 @@ ++#include + #include + #include + #include +diff --git a/util/src/posix/scoped_descriptor.cc b/util/src/posix/scoped_descriptor.cc +index 6fd1495..8294d0b 100644 +--- a/util/src/posix/scoped_descriptor.cc ++++ b/util/src/posix/scoped_descriptor.cc +@@ -1,3 +1,5 @@ ++#include ++ + #include + + using namespace std; +diff --git a/util/src/scope_exit.cc b/util/src/scope_exit.cc +index 764c2fb..441855a 100644 +--- a/util/src/scope_exit.cc ++++ b/util/src/scope_exit.cc +@@ -1,3 +1,4 @@ ++#include + #include + + using namespace std; +diff --git a/util/src/scoped_env.cc b/util/src/scoped_env.cc +index 6c6a041..df26645 100644 +--- a/util/src/scoped_env.cc ++++ b/util/src/scoped_env.cc +@@ -1,3 +1,5 @@ ++#include ++ + #include + #include + diff --git a/SOURCES/shared_nowide.patch b/SOURCES/shared_nowide.patch new file mode 100644 index 0000000..e0c4c83 --- /dev/null +++ b/SOURCES/shared_nowide.patch @@ -0,0 +1,107 @@ +diff --git a/nowide/CMakeLists.txt b/nowide/CMakeLists.txt +index ff9dba6..5d1b9ce 100644 +--- a/nowide/CMakeLists.txt ++++ b/nowide/CMakeLists.txt +@@ -1,7 +1,5 @@ + find_package(Boost 1.54 REQUIRED) + +-add_leatherman_includes(${Boost_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/../vendor/nowide/include") +-add_leatherman_headers(../vendor/nowide/include/boost) + if(WIN32) + add_leatherman_library(../vendor/nowide/src/iostream.cpp) + endif() +--- leatherman-1.10.0/execution/CMakeLists.txt~ 2020-06-03 10:30:05.027479897 +0100 ++++ leatherman-1.10.0/execution/CMakeLists.txt 2020-06-03 10:30:18.871483297 +0100 +@@ -1,4 +1,4 @@ +-find_package(Boost 1.54 REQUIRED COMPONENTS regex filesystem system) ++find_package(Boost 1.73 REQUIRED COMPONENTS regex filesystem system nowide) + + add_leatherman_deps("${Boost_LIBRARIES}") + if ("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS") +@@ -10,7 +10,6 @@ + add_leatherman_includes("${Boost_INCLUDE_DIRS}") + + leatherman_dependency(util) +-leatherman_dependency(nowide) + leatherman_dependency(locale) + leatherman_dependency(logging) + leatherman_dependency(file_util) +--- leatherman-1.10.0/file_util/CMakeLists.txt~ 2020-06-03 10:30:05.031479898 +0100 ++++ leatherman-1.10.0/file_util/CMakeLists.txt 2020-06-03 10:31:04.550494516 +0100 +@@ -1,9 +1,8 @@ +-find_package(Boost 1.54 REQUIRED COMPONENTS regex filesystem system) ++find_package(Boost 1.73 REQUIRED COMPONENTS regex filesystem system nowide) + + add_leatherman_deps("${Boost_LIBRARIES}") + add_leatherman_includes("${Boost_INCLUDE_DIRS}") + +-leatherman_dependency(nowide) + leatherman_dependency(locale) + leatherman_dependency(logging) + leatherman_dependency(util) +--- leatherman-1.10.0/logging/CMakeLists.txt~ 2020-06-03 10:30:05.035479898 +0100 ++++ leatherman-1.10.0/logging/CMakeLists.txt 2020-06-03 10:30:19.092483352 +0100 +@@ -4,7 +4,6 @@ + add_leatherman_deps(${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + add_leatherman_includes("${Boost_INCLUDE_DIRS}") + +-leatherman_dependency(nowide) + leatherman_dependency(locale) + + if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "SunOS") +--- leatherman-1.10.0/tests/CMakeLists.txt~ 2020-06-02 23:24:17.146002133 +0100 ++++ leatherman-1.10.0/tests/CMakeLists.txt 2020-06-02 23:26:17.780054923 +0100 +@@ -1,8 +1,8 @@ +-set(BOOST_REQUIRED_COMPONENTS system date_time chrono log log_setup thread filesystem regex) ++set(BOOST_REQUIRED_COMPONENTS system date_time chrono log log_setup thread filesystem regex nowide) + if (LEATHERMAN_USE_LOCALES) + set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} locale) + endif() +-find_package(Boost "1.54" REQUIRED COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) ++find_package(Boost "1.73" REQUIRED COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) + + include_directories(BEFORE ${LEATHERMAN_CATCH_INCLUDE} ${LEATHERMAN_INCLUDE_DIRS}) + add_executable(leatherman_test main.cc ${LEATHERMAN_TEST_SRCS}) +--- leatherman-1.10.0/util/CMakeLists.txt~ 2020-06-03 10:05:44.277172451 +0100 ++++ leatherman-1.10.0/util/CMakeLists.txt 2020-06-03 10:06:52.969185017 +0100 +@@ -1,10 +1,8 @@ +-find_package(Boost 1.54 REQUIRED date_time chrono system) ++find_package(Boost 1.73 REQUIRED date_time chrono system nowide) + + add_leatherman_deps(${Boost_LIBRARIES}) + add_leatherman_includes("${Boost_INCLUDE_DIRS}") + +-leatherman_dependency(nowide) +- + if(WIN32) + set(PLATFORM_SRCS "src/windows/time.cc" "src/windows/environment.cc" "src/windows/scoped_handle.cc") + set(PLATFORM_TESTS "tests/windows/environment.cc") +--- leatherman-1.10.0/file_util/src/file.cc~ 2019-12-14 20:46:29.000000000 +0000 ++++ leatherman-1.10.0/file_util/src/file.cc 2020-06-02 22:42:45.100963441 +0100 +@@ -1,6 +1,6 @@ + #include + #include +-#include ++#include + #include + #include + #include +--- leatherman-1.10.0/util/src/environment.cc~ 2019-12-14 20:46:29.000000000 +0000 ++++ leatherman-1.10.0/util/src/environment.cc 2020-06-02 22:42:45.101963441 +0100 +@@ -1,5 +1,5 @@ + #include +-#include ++#include + + using namespace std; + +--- leatherman-1.10.0/util/tests/environment.cc~ 2019-12-14 20:46:29.000000000 +0000 ++++ leatherman-1.10.0/util/tests/environment.cc 2020-06-02 22:42:45.103963442 +0100 +@@ -1,6 +1,6 @@ + #include + #include +-#include ++#include + + using namespace std; + using namespace leatherman::util; diff --git a/SOURCES/system-catch.patch b/SOURCES/system-catch.patch new file mode 100644 index 0000000..8d42459 --- /dev/null +++ b/SOURCES/system-catch.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt~ 2020-12-09 04:17:13.000000000 -0600 ++++ b/CMakeLists.txt 2021-03-09 09:33:46.038471009 -0600 +@@ -65,7 +65,6 @@ + file(GLOB_RECURSE ALL_LEATHERMAN_SOURCES */src/*.cc */inc/*.hpp) + add_subdirectory(locales) + +-add_leatherman_dir(catch EXCLUDE_FROM_VARS) + add_leatherman_dir(nowide) + add_leatherman_dir(util) + add_leatherman_dir(locale) diff --git a/SPECS/leatherman.spec b/SPECS/leatherman.spec new file mode 100644 index 0000000..03fd1d3 --- /dev/null +++ b/SPECS/leatherman.spec @@ -0,0 +1,145 @@ +Name: leatherman +Version: 1.12.0 +Release: 6%{?dist} +Summary: Collection of C++ and CMake utility libraries + +# leatherman is ASL 2.0 +# bundled rapidjson is MIT +License: ASL 2.0 and MIT +URL: https://github.com/puppetlabs/leatherman +Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz + +# This unbundles boost-nowide and the boost libraries do not need +# to have the path to nowide added as it's included already +Patch0: shared_nowide.patch +# Add missing include for , no longer indirectly included in GCC 10 +Patch1: leatherman-gcc10.patch +# Similar for cstddef and gcc-11 +Patch2: %{name}-gcc11.patch + +BuildRequires: cmake >= 3.2.2 +BuildRequires: make +BuildRequires: gcc-c++ +BuildRequires: boost-devel >= 1.73 +BuildRequires: libcurl-devel +BuildRequires: gettext +Provides: bundled(rapidjson) = 1.0.2 + +%description +%{summary}. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +# Building against leatherman requires the boost nowide headers present +Requires: boost-devel +# Strictly speaking, it is needed only if curl feature is activated +Requires: libcurl-devel%{?_isa} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%autosetup -p1 +# leatherman isn't compatible with rapidjson 1.1.0 yet so that has to be left bundled for now +# https://tickets.puppetlabs.com/browse/LTH-130 +# catch is only used in testing so can be ignored + +# Treating warnings as errors is pretty bad idea. +sed -i -e "s/\s*-Werror\s*//g" cmake/cflags.cmake + +%build +%cmake . -B%{_target_platform} \ + -DLEATHERMAN_SHARED=ON \ + -DLEATHERMAN_DEBUG=ON \ + %{nil} +%make_build -C %{_target_platform} + +%install +%make_install -C %{_target_platform} +%find_lang %{name}_logging +%find_lang %{name}_locale + +%ldconfig_scriptlets + +%files -f %{name}_logging.lang -f %{name}_locale.lang +%license LICENSE +%{_libdir}/%{name}*.so.* + +%files devel +%{_includedir}/%{name} +%{_libdir}/%{name}*.so +%dir %{_libdir}/cmake +%{_libdir}/cmake/%{name}/ + +%changelog +* Tue Jan 26 2021 Fedora Release Engineering - 1.12.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Fri Jan 22 2021 Jonathan Wakely - 1.12.0-5 +- Rebuilt for Boost 1.75 + +* Wed Nov 04 2020 Jeff Law - 1.12.0-4 +- Fix missing #includes for gcc-11 + +* Tue Jul 28 2020 Fedora Release Engineering - 1.12.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jun 03 2020 Jonathan Wakely - 1.12.0-2 +- Link libraries to libboost_nowide.so + +* Wed Jun 03 2020 Igor Raits - 1.12.0-1 +- Update to 1.12.0 + +* Tue Jun 02 2020 Jonathan Wakely - 1.10.0-2 +- Rebuilt and patched for Boost 1.73 + +* Tue Jan 28 2020 Adam Tkac - 1.10.1-1 +- update to 1.10.0 + +* Thu Jul 25 2019 Fedora Release Engineering - 1.6.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Jul 24 2019 Igor Gnatenko - 1.6.1-1 +- Update to 1.6.1 + +* Fri Feb 01 2019 Fedora Release Engineering - 1.3.0-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jan 24 2019 Jonathan Wakely - 1.3.0-8 +- Rebuilt for Boost 1.69 + +* Fri Jul 13 2018 Fedora Release Engineering - 1.3.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 1.3.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Tue Jan 23 2018 Jonathan Wakely - 1.3.0-5 +- Rebuilt for Boost 1.66 + +* Tue Nov 07 2017 James Hogarth - 1.3.0-4 +- Restore catch to devel build (bz#1510392) +- Use make_build macro as per review + +* Sun Oct 29 2017 Haïkel Guémar - 1.3.0-3 +- Merge with James spec + keep compatibility with CentOS SIGs + +* Thu Oct 19 2017 James Hogarth - 1.3.0-2 +- rebuilt + +* Wed Oct 04 2017 James Hogarth - 1.3.0-1 +- Upstream update +- unbundle nowide + +* Thu Aug 31 2017 James Hogarth - 1.2.0-1 +- Upstream update + +* Sat Feb 4 2017 Haïkel Guémar - 0.10.2-1 +- Upstream 0.10.2 +- Add Fedora support + +* Thu Oct 27 2016 Haïkel Guémar - 0.9.2-1 +- Initial package on EL7 +