diff options
author | CoprDistGit <copr-devel@lists.fedorahosted.org> | 2023-12-19 08:34:43 +0000 |
---|---|---|
committer | CoprDistGit <copr-devel@lists.fedorahosted.org> | 2023-12-19 08:34:43 +0000 |
commit | 3e977a8f4c19ca21493d1a8ee7d10716587c24d7 (patch) | |
tree | a30d44f5eda97146e561ca12c9958efe6996c77e | |
parent | 5bd292ebbc1c86e9d9f1781f51ddeee65dc8d782 (diff) |
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | 84.patch | 57 | ||||
-rw-r--r-- | sources | 1 | ||||
-rw-r--r-- | stduuid.spec | 60 |
4 files changed, 119 insertions, 0 deletions
@@ -0,0 +1 @@ +/stduuid-1.2.3.tar.gz diff --git a/84.patch b/84.patch new file mode 100644 index 0000000..1133016 --- /dev/null +++ b/84.patch @@ -0,0 +1,57 @@ +From 071709533b530d3b956693c3c74e98071da2dd2d Mon Sep 17 00:00:00 2001 +From: topazus <topazus@outlook.com> +Date: Tue, 19 Dec 2023 11:19:31 +0800 +Subject: [PATCH] Use GNUInstallDirs instead of hardcoded paths + +--- + CMakeLists.txt | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 73b5658..feb7dc9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,6 +8,8 @@ endif() + project(stduuid CXX) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") + ++include(GNUInstallDirs) ++ + option(UUID_BUILD_TESTS "Build the unit tests" ${UUID_MAIN_PROJECT}) + option(UUID_SYSTEM_GENERATOR "Enable operating system uuid generator" OFF) + option(UUID_TIME_GENERATOR "Enable experimental time-based uuid generator" OFF) +@@ -47,21 +49,21 @@ if (NOT UUID_USING_CXX20_SPAN) + target_include_directories(${PROJECT_NAME} INTERFACE + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> + $<INSTALL_INTERFACE:include>) +- install(DIRECTORY gsl DESTINATION include) ++ install(DIRECTORY gsl DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif () + + if(UUID_ENABLE_INSTALL) + # Install step and imported target +- install(FILES include/uuid.h DESTINATION include) ++ install(FILES include/uuid.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-targets) + install(EXPORT ${PROJECT_NAME}-targets +- DESTINATION lib/cmake/${PROJECT_NAME}) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) + + # Config files for find_package() + include(CMakePackageConfigHelpers) + configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" +- INSTALL_DESTINATION lib/cmake/${PROJECT_NAME}) ++ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) + write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-version.cmake" + VERSION "1.0" +@@ -70,7 +72,7 @@ if(UUID_ENABLE_INSTALL) + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-version.cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindLibuuid.cmake" +- DESTINATION lib/cmake/${PROJECT_NAME}) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) + export(EXPORT ${PROJECT_NAME}-targets + FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}-targets.cmake") + endif() @@ -0,0 +1 @@ +c40a57e649238b16b8270877300f5dc4 stduuid-1.2.3.tar.gz diff --git a/stduuid.spec b/stduuid.spec new file mode 100644 index 0000000..283a00e --- /dev/null +++ b/stduuid.spec @@ -0,0 +1,60 @@ +# header-only library +%global debug_package %{nil} + +%global forgeurl https://github.com/mariusbancila/stduuid +Version: 1.2.3 +%forgemeta + +Name: stduuid +Release: %autorelease +Summary: A C++17 cross-platform implementation for UUIDs +License: MIT +URL: %{forgeurl} +Source0: %{forgesource} +Patch0: https://github.com/mariusbancila/stduuid/pull/84.patch + +BuildRequires: gcc-c++ +BuildRequires: cmake +BuildRequires: ninja-build + +%description +stduuid is a C++17 cross-platform single-header library implementation for +universally unique identifiers, simply know as either UUID or GUID (mostly on +Windows). A UUID is a 128-bit number used to uniquely identify information in +computer systems, such as database table keys, COM interfaces, classes and type +libraries, and many others. + +%package devel +Summary: Development files for %{name} +Provides: %{name}-static%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains development files for %{name}. + +%prep +%forgeautosetup -p1 + +%build +%cmake \ + -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DUUID_USING_CXX20_SPAN=ON \ + +%cmake_build + +%install +%cmake_install + +rm %{buildroot}%{_libdir}/cmake/stduuid/FindLibuuid.cmake + +%check +%ctest + +%files devel +%license LICENSE +%doc README.md +%{_includedir}/uuid.h +%{_libdir}/cmake/stduuid/ + +%changelog +%autochangelog |