diff --git a/0001-cmake-Install-econftool.patch b/0001-cmake-Install-econftool.patch new file mode 100644 index 0000000000000000000000000000000000000000..2b855222f1f6746d52e011e88106a613218df59a --- /dev/null +++ b/0001-cmake-Install-econftool.patch @@ -0,0 +1,25 @@ +From 82bd1d76a50c0f7557578b18d601c69c10e50950 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Thu, 8 Jul 2021 05:42:04 -0400 +Subject: [PATCH 1/2] cmake: Install econftool + +This was missed in bce4976bd6bd933ca415f3bf765d80a887b832a4. +--- + util/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt +index ce3fca8..08cc5f0 100644 +--- a/util/CMakeLists.txt ++++ b/util/CMakeLists.txt +@@ -1,3 +1,7 @@ + # Create the binary/executable + add_executable(econftool econftool.c) + target_link_libraries(econftool PRIVATE econf) ++ ++install(TARGETS econftool ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++) +-- +2.31.1 + diff --git a/0002-cmake-Install-man-pages.patch b/0002-cmake-Install-man-pages.patch new file mode 100644 index 0000000000000000000000000000000000000000..24c55a50134659d680fa5577de04a68d99102c00 --- /dev/null +++ b/0002-cmake-Install-man-pages.patch @@ -0,0 +1,23 @@ +From 5fbe0aed4622d4c94c4e541c6b013be7ae4616a3 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Thu, 8 Jul 2021 05:49:41 -0400 +Subject: [PATCH 2/2] cmake: Install man pages + +--- + doc/CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt +index 0e47ccc..726183a 100644 +--- a/doc/CMakeLists.txt ++++ b/doc/CMakeLists.txt +@@ -20,3 +20,6 @@ if(BUILD_DOCUMENTATION) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc) + endif() ++ ++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/libeconf.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) ++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/econftool.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8) +-- +2.31.1 + diff --git a/libeconf-0.4.0.tar.gz b/libeconf-0.4.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4db0a74706bbe61f8be6338f654c771d2935e272 Binary files /dev/null and b/libeconf-0.4.0.tar.gz differ diff --git a/libeconf.spec b/libeconf.spec new file mode 100644 index 0000000000000000000000000000000000000000..74ca5b7a28dbe57c63477600a1603b6aa3d2894b --- /dev/null +++ b/libeconf.spec @@ -0,0 +1,84 @@ +%define anolis_release 1 +# Force out of source build +%undefine __cmake_in_source_build + +%global somajor 0 + +Name: libeconf +Version: 0.4.0 +Release: %{anolis_release}%{?dist} +Summary: Enhanced config file parser library + +License: MIT +URL: https://github.com/openSUSE/libeconf +Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz + +# Proposed upstream: https://github.com/openSUSE/libeconf/pull/151 +Patch0101: 0001-cmake-Install-econftool.patch +Patch0102: 0002-cmake-Install-man-pages.patch + +BuildRequires: cmake >= 3.12 +BuildRequires: gcc +BuildRequires: make + +%description +libeconf is a highly flexible and configurable library to parse and manage +key=value configuration files. It reads configuration file snippets from +different directories and builds the final configuration file from it. + + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%package utils +Summary: Utilities for manipulating config files +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description utils +The %{name}-utils package contains utilities for manipulating +configuration files from applications that use %{name}. + + +%prep +%autosetup -p1 + + +%build +%cmake +%cmake_build + + +%install +%cmake_install + + +%check +%cmake_build --target check + + +%files +%license LICENSE +%doc NEWS README.md TODO.md +%{_libdir}/%{name}.so.%{somajor}{,.*} + +%files devel +%doc example/ +%{_includedir}/* +%{_libdir}/%{name}.so +%{_libdir}/cmake/%{name}/ +%{_libdir}/pkgconfig/%{name}.pc +%{_mandir}/man3/%{name}.3* + +%files utils +%{_bindir}/econftool +%{_mandir}/man8/econftool.8* + +%changelog +* Tue Mar 22 2022 Chunmei Xu - 0.4.0-1 +- init from upstream 0.4.0