From da23b1a38702b092e94b3f261a27dc8aadc945ef Mon Sep 17 00:00:00 2001 From: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> Date: Wed, 6 May 2026 21:58:06 -0500 Subject: [PATCH] add: cardwire (#12013) --- anda/system/cardwire/anda.hcl | 5 +++ anda/system/cardwire/cardwire.spec | 52 ++++++++++++++++++++++++++++++ anda/system/cardwire/update.rhai | 1 + 3 files changed, 58 insertions(+) create mode 100644 anda/system/cardwire/anda.hcl create mode 100644 anda/system/cardwire/cardwire.spec create mode 100644 anda/system/cardwire/update.rhai diff --git a/anda/system/cardwire/anda.hcl b/anda/system/cardwire/anda.hcl new file mode 100644 index 0000000000..7a09dc540e --- /dev/null +++ b/anda/system/cardwire/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "cardwire.spec" + } +} diff --git a/anda/system/cardwire/cardwire.spec b/anda/system/cardwire/cardwire.spec new file mode 100644 index 0000000000..601619758d --- /dev/null +++ b/anda/system/cardwire/cardwire.spec @@ -0,0 +1,52 @@ +Name: cardwire +Version: 0.6.0 +Release: 1%{?dist} +Summary: A GPU Manager for linux that uses eBPF LSM hooks to block GPUs +URL: https://opengamingcollective.github.io/cardwire/ +Source0: https://github.com/OpenGamingCollective/cardwire/archive/refs/tags/v%{version}.tar.gz +License: GPL-3.0-or-later AND (Apache-2.0 OR MIT) AND BSD-3-Clause AND (MIT OR Apache-2.0) AND Unicode-3.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND ISC AND MIT (MIT OR Apache-2.0) AND (MIT OR Apache-2.0 OR LGPL-2.1-or-later) AND (Unlicense OR MIT) AND Zlib +BuildRequires: cargo-rpm-macros +BuildRequires: systemd-rpm-macros +BuildRequires: libbpf-devel +BuildRequires: clang-devel + +Packager: Owen Zimmerman + +%description +%{summary}. + +%prep +%autosetup +%cargo_prep_online + +%build +%cargo_build + +%install +install -Dm0755 target/rpm/cardwire %{buildroot}%{_bindir}/cardwire +install -Dm0755 target/rpm/cardwired %{buildroot}%{_bindir}/cardwired +install -Dm0644 assets/cardwired.service %{buildroot}%{_unitdir}/cardwired.service +install -Dm0644 assets/com.github.opengamingcollective.cardwire.conf %{buildroot}%{_datadir}/dbus-1/system.d/com.github.opengamingcollective.cardwire.conf + +%{cargo_license_online} > LICENSE.dependencies + +%post +%systemd_post cardwired.service + +%preun +%systemd_preun cardwired.service + +%postun +%systemd_postun_with_restart cardwired.service + +%files +%license LICENSE +%license LICENSE.dependencies +%{_bindir}/cardwire +%{_bindir}/cardwired +%{_unitdir}/cardwired.service +%{_datadir}/dbus-1/system.d/com.github.opengamingcollective.cardwire.conf + +%changelog +* Wed May 06 2026 Owen Zimmerman +- Initial commit diff --git a/anda/system/cardwire/update.rhai b/anda/system/cardwire/update.rhai new file mode 100644 index 0000000000..2e39cdc8ec --- /dev/null +++ b/anda/system/cardwire/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("OpenGamingCollective/cardwire"));