summaryrefslogtreecommitdiff
path: root/spdlog.spec
blob: 655d050d84ece3881368035a1a44067a9e35e29f (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
# topdir: spdlog-1.17.0
Name:           spdlog
Version:        1.17.0
Release:        1%{?dist}
Summary:        Fast C++ logging library

License:        MIT
URL:            https://github.com/gabime/spdlog
Source0:        https://github.com/gabime/spdlog/archive/refs/tags/v%{version}/%{name}-%{version}.tar.gz

Group:          Development/Libraries
Packager:       openEuler Builder <builder@openeuler.org>

BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  gcc-c++

%description
spdlog is a very fast, header-only/compiled, C++ logging library.

%package devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Packager:       openEuler Builder <builder@openeuler.org>
Requires:       %{name} = %{version}-%{release}

%description devel
Header files, CMake configuration files and development libraries for %{name}.

%prep
%autosetup -p1 -n %{name}-%{version}

%build
# openEuler 24.03 ships an old-style parametrized %cmake macro (cmake pkg)
# whose expansion breaks when given -B (unbalanced '(' -> shell syntax error).
# Abandon %cmake/%cmake_build/%cmake_install macros entirely and do an
# explicit out-of-tree build with plain cmake + make.
mkdir build
cd build
cmake .. \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DCMAKE_BUILD_TYPE=Release \
    -DSPDLOG_BUILD_SHARED=ON \
    -DSPDLOG_BUILD_TESTS=OFF \
    -DSPDLOG_BUILD_TESTS_HO=OFF \
    -DSPDLOG_BUILD_EXAMPLE=OFF \
    -DSPDLOG_BUILD_EXAMPLE_HO=OFF \
    -DSPDLOG_BUILD_BENCH=OFF \
    -DSPDLOG_BUILD_WARNINGS=OFF \
    -DSPDLOG_FMT_EXTERNAL=OFF \
    -DSPDLOG_FMT_EXTERNAL_HO=OFF \
    -DSPDLOG_INSTALL=ON
make %{?_smp_mflags}

%install
cd build
make install DESTDIR=%{buildroot}

%files
%license LICENSE
%doc README.md
%{_libdir}/libspdlog.so.*

%files devel
%{_includedir}/spdlog/
%{_libdir}/libspdlog.so
%{_libdir}/cmake/spdlog/
%{_libdir}/pkgconfig/spdlog.pc

%changelog
* Tue Oct 13 2026 openEuler Builder <builder@openeuler.org> - 1.17.0-1
- Initial package