blob: ac5bda2ddca9022370c5d1d44506ee053f40b9da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
Name: cpp-hocon
Version: 0.3.0
Release: 1
Summary: C++ support for the HOCON configuration file format
License: Apache-2.0
URL: https://github.com/puppetlabs/cpp-hocon
Source0: https://github.com/puppetlabs/cpp-hocon/archive/refs/tags/%{version}.tar.gz
Source1: cpphocon.pc.in
Patch1: cpp-hocon-boost-filesystem-link.patch
BuildRequires: cmake >= 3.2.2 make gcc-c++ boost-devel >= 1.54
BuildRequires: leatherman-devel gettext catch1-devel
%description
This is a port of the TypesafeConfig library to C++.
The library provides C++ support for the HOCON configuration file format.
%package devel
Requires: cpp-hocon%{?_isa} = %{version}-%{release}
Summary: Development files for the cpp-hocon library
%description devel
Libraries and headers to links against cpp-hocon.
%prep
%autosetup -p1
sed -r -i 's/(LEATHERMAN_COMPONENTS)(\b.+)?(\bcatch\b)/\1\2/' CMakeLists.txt
sed -r -i 's|\$\{LEATHERMAN_CATCH_INCLUDE\}|"%{_includedir}/catch"|' \
lib/tests/CMakeLists.txt
%build
%cmake \
-DBOOST_INCLUDEDIR=%{_includedir}/boost \
-DBOOST_LIBRARYDIR=%{_libdir}/boost \
-DLeatherman_DIR=%{_libdir}/cmake/leatherman \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
%{nil}
%cmake_build
%install
%cmake_install
mkdir -p %{buildroot}%{_libdir}/pkgconfig
cp -p %{SOURCE1} %{buildroot}%{_libdir}/pkgconfig/cpphocon.pc
sed -i 's#@@PREFIX@@#%{_prefix}#' %{buildroot}%{_libdir}/pkgconfig/cpphocon.pc
sed -i 's#@@VERSION@@#%{version}#' %{buildroot}%{_libdir}/pkgconfig/cpphocon.pc
sed -i 's#@@LIBDIR@@#%{_lib}#' %{buildroot}%{_libdir}/pkgconfig/cpphocon.pc
%files
%license LICENSE
%{_libdir}/libcpp-hocon.so.*
%files devel
%{_libdir}/libcpp-hocon.so
%{_includedir}/hocon/
%{_libdir}/pkgconfig/cpphocon.pc
%changelog
* Tue Nov 12 2024 Funda Wang <fundawang@yeah.net> - 0.3.0-1
- update to 0.3.0
* Fri Aug 14 2020 yaokai <yaokai13@huawei.com> - 0.2.1-1
- package init
|