File ananicy-cpp.spec of Package ananicy-cpp

#
# spec file for package ananicy-cpp
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

Name:           ananicy-cpp
Version:        1.0.0~rc+git.20230519.20c73f4
Release:        0
Summary:        Ananicy rewritten in C++ for much lower CPU and memory usage
License:        GPL-3.0-only
URL:            https://gitlab.com/ananicy-cpp/ananicy-cpp
Source:         %{name}-%{version}.tar
Patch0:         0001-cmake-install-libdir.patch
BuildRequires:  c++_compiler
BuildRequires:  cmake >= 3.17
BuildRequires:  pkgconfig
BuildRequires:  cmake(fmt) >= 8.0
BuildRequires:  cmake(nlohmann_json) >= 3.9
BuildRequires:  cmake(spdlog) >= 1.9
BuildRequires:  pkgconfig(libelf)
BuildRequires:  pkgconfig(libbpf)
BuildRequires:  pkgconfig(libsystemd)
BuildRequires:  bpftool
BuildRequires:  clang
BuildRequires:  llvm-gold
Recommends:     ananicy-rules
Conflicts:      ananicy
Provides:       ananicy

%description
Ananicy Cpp is a full rewrite of Ananicy in C++,
featuring lower CPU and RAM usage.
It works as a drop-in replacement for Ananicy.

%prep
%autosetup -p1

%build
%cmake \
  -DUSE_EXTERNAL_JSON:BOOL=ON \
  -DUSE_EXTERNAL_SPDLOG:BOOL=ON \
  -DUSE_EXTERNAL_FMTLIB:BOOL=ON \
  -DENABLE_SYSTEMD:BOOL=ON \
  -DBPF_BUILD_LIBBPF:BOOL=OFF \
  -DUSE_BPF_PROC_IMPL:BOOL=ON \

%cmake_build

%install
%cmake_install

%pre
%service_add_pre ananicy-cpp.service

%post
%service_add_post ananicy-cpp.service

%preun
%service_del_preun ananicy-cpp.service

%postun
%service_del_postun ananicy-cpp.service

%files
%license LICENSE
%doc README.md
%{_bindir}/ananicy-cpp
%{_prefix}/lib/systemd/system/ananicy-cpp.service

%changelog
openSUSE Build Service is sponsored by