summaryrefslogtreecommitdiff
path: root/cli11.spec
blob: 6811ca0ea1dfa18711e8d73da14e5d47de8412c7 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
%global debug_package %{nil}

Name:           cli11
Version:        2.7.2
Release:        1%{?dist}
Summary:        Command line parser for C++11

License:        BSD-3-Clause
URL:            https://github.com/CLIUtils/CLI11
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  make
BuildRequires:  boost-devel
BuildRequires:  Catch2-devel

Requires:       %{name}-devel = %{version}-%{release}

%description
CLI11 is a command line parser for C++11 and beyond that provides a rich
feature set with a simple and intuitive interface. It is header-only, has no
external dependencies beyond the standard library, and ships CMake and
pkg-config integration files.

%package devel
Summary:        Development files for %{name}
Provides:       %{name}-static = %{version}-%{release}

%description devel
CLI11 is a command line parser for C++11 and beyond that provides a rich
feature set with a simple and intuitive interface.

This package contains the header-only library, the CMake package
configuration (find_package(CLI11)) and the pkg-config file.

%prep
# topdir: %{name}-%{version}(源码 tarball 顶层目录,由 build 流程 --transform 统一)
%autosetup -p1 -n %{name}-%{version}

%build
%cmake \
    -DCLI11_BUILD_TESTS:BOOL=OFF \
    -DCLI11_BUILD_DOCS:BOOL=OFF \
    -DCLI11_BUILD_EXAMPLES:BOOL=OFF \
    -DCLI11_SINGLE_FILE:BOOL=OFF \
    -DCLI11_PRECOMPILED:BOOL=OFF \
    -DCLI11_MODULES:BOOL=OFF \
    -DCMAKE_CXX_STANDARD=11

# openEuler 24.03 的 cmake 配置宏是历史遗留的 IN-SOURCE 宏(不传 -S/-B,构建文件
# 落在解包后的源码目录),而同一宏集的 cmake_build / cmake_install 引用的是
# out-of-source 的 _vpath_builddir(本目标 chroot 为 aarch64-openEuler-linux-gnu),
# configure 从未创建该目录,直接用会报 "is not a directory"。显式驱动已配置好的
# in-source 树(与同项目 libopen3d-dev 的已验证处置一致)。
%{__cmake} --build . %{?_smp_mflags} --verbose

%install
DESTDIR=%{buildroot} %{__cmake} --install .

%files
%license LICENSE
%doc README.md CHANGELOG.md

%files devel
%{_includedir}/CLI/
%{_datadir}/cmake/CLI11/
%{_datadir}/pkgconfig/CLI11.pc

%changelog
* Tue Sep 22 2026 openEuler Builder <builder@openeuler.org> - 2.7.2-1
- Initial package, based on the openEuler cli11 2.2.0 reference spec
- Header-only library; tests/docs/examples disabled in %%build