## START: Set by rpmautospec ## (rpmautospec version 0.6.0) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global toolchain clang # upstream build system requires the use of libbpf and bpftool sources %global bpftool_url https://github.com/libbpf/bpftool %global bpftool_commit e17d6cf646e1b3107424386a62afc15a36b18f10 %global bpftool_shortcommit %(c=%{bpftool_commit}; echo ${c:0:7}) %global bpftool_date 20230926 %global bpftool_version 7.2.0^%{bpftool_date}git%{bpftool_shortcommit} %global libbpf_url https://github.com/libbpf/libbpf %global libbpf_commit 528cb9d3e933c2b10b152249779c2ff72efa4224 %global libbpf_shortcommit %(c=%{libbpf_commit}; echo ${c:0:7}) %global libbpf_date 20240125 %global libbpf_version 1.4.0~^%{libbpf_date}git%{libbpf_shortcommit} Name: scx_c_schedulers Version: 0.1.7 Release: %autorelease Summary: sched_ext schedulers written in c License: GPL-2.0-only URL: https://github.com/sched-ext/scx Source0: %{url}/archive/v%{version}/scx-%{version}.tar.gz Source1: %{bpftool_url}/archive/%{bpftool_commit}/bpftool-%{bpftool_version}.tar.gz Source2: %{libbpf_url}/archive/%{libbpf_commit}/libbpf-%{libbpf_version}.tar.gz Source3: %{name}.rpmlintrc BuildRequires: clang >= 17 BuildRequires: meson >= 1.2.0 BuildRequires: llvm BuildRequires: make # This shouldn't be required as we're not building the rust schedulers BuildRequires: cargo # libbpf deps BuildRequires: elfutils-libelf-devel # upstream does not support dynamic linking Provides: bundled(bpftool) = %{bpftool_version} Provides: bundled(libbpf) = %{libbpf_version} %description Example sched_ext schedulers written in C (as opposed to Rust) that include: "scx_central", "scx_flatcg", "scx_nest", "scx_pair", "scx_qmap", "scx_simple", 'scx_userland'. %prep %setup -n scx-%{version} -q # provide the bpftool version we specify tar xf %{SOURCE1} mv bpftool-%{bpftool_commit} bpftool # same license files as libbpf, no-op # provide the libbpf version we specify tar xf %{SOURCE2} rmdir bpftool/libbpf mv libbpf-%{libbpf_commit}/LICENSE libbpf-LICENSE mv libbpf-%{libbpf_commit}/LICENSE.BSD-2-Clause libbpf-LICENSE.BSD-2-Clause mv libbpf-%{libbpf_commit}/LICENSE.LGPL-2.1 libbpf-LICENSE.LGPL-2.1 mv libbpf-%{libbpf_commit} bpftool/libbpf cd bpftool/src %make_build cd ../libbpf/src mkdir root BUILD_STATIC_ONLY=y DESTDIR=root make install %build %meson -Dbpftool=./bpftool/src/bpftool -Dlibbpf_a=../bpftool/libbpf/src/libbpf.a -Dlibbpf_h=../bpftool/libbpf/src/root/usr/include -Denable_rust=false -Dsystemd=disabled %meson_build %install %meson_install %files %license LICENSE libbpf-LICENSE* %doc README.md %{_bindir}/scx_* %exclude %{_sysconfdir}/systemd/journald@sched-ext.conf %exclude %{_sysconfdir}/default/scx # systemd usage is not required so let users manually setup this service # https://github.com/sched-ext/scx/blob/main/services/README.md %exclude /usr/lib/systemd/system/scx.service %changelog ## START: Generated by rpmautospec * Wed Feb 14 2024 John Doe - 0.1.7-1 - Uncommitted changes ## END: Generated by rpmautospec