From 0603ec22c8ccb2cf55629d1dcc4a124943c94ab3 Mon Sep 17 00:00:00 2001 From: Owen-sz Date: Tue, 16 Jun 2026 16:24:31 +0200 Subject: [PATCH] use cmake Signed-off-by: Owen-sz --- ...ile-Remove-unused-Makefile-variables.patch | 22 ------------------- anda/tools/amdctl/amdctl.spec | 13 ++++++----- 2 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 anda/tools/amdctl/0001-RPM-makefile-Remove-unused-Makefile-variables.patch diff --git a/anda/tools/amdctl/0001-RPM-makefile-Remove-unused-Makefile-variables.patch b/anda/tools/amdctl/0001-RPM-makefile-Remove-unused-Makefile-variables.patch deleted file mode 100644 index e0e225078b..0000000000 --- a/anda/tools/amdctl/0001-RPM-makefile-Remove-unused-Makefile-variables.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Paskal Sitepu -Date: Sat, 4 Nov 2023 09:54:38 +0700 -Subject: [PATCH] (RPM) makefile: Remove unused Makefile variables - -Signed-off-by: Paskal Sitepu ---- - makefile | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/makefile b/makefile -index 5ca6bab..0091429 100644 ---- a/makefile -+++ b/makefile -@@ -1,5 +1,3 @@ --CC=gcc --CFLAGS=-Wall -pedantic -Wextra -std=c99 -O2 - all: amdctl - %.o: %.c - $(CC) -c -o $@ $< $(CFLAGS) --- -2.41.0 diff --git a/anda/tools/amdctl/amdctl.spec b/anda/tools/amdctl/amdctl.spec index 7e8a896dfe..6100ce2b37 100644 --- a/anda/tools/amdctl/amdctl.spec +++ b/anda/tools/amdctl/amdctl.spec @@ -5,13 +5,11 @@ URL: https://github.com/kevinlekiller/%{name} Version: 0.11 Release: 2%{?dist} Source0: https://github.com/kevinlekiller/%{name}/archive/refs/tags/v%{version}.tar.gz -# Remove hardcoded CFLAGS and CC -Patch0: 0001-RPM-makefile-Remove-unused-Makefile-variables.patch BuildRequires: make BuildRequires: gcc BuildRequires: kernel-headers -BuildRequires: glibc-headers +BuildRequires: glibc-headers cmake-rpm-macros cmake gcc-c++ systemd-rpm-macros Requires: kernel-core Requires: systemd-udev Requires: coreutils @@ -21,15 +19,18 @@ Tool for changing voltages and clock speeds for AMD processors with control over every power state and CPU core. %prep -%autosetup -p1 +%autosetup + +%conf +%cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 %build -%make_build +%cmake_build %install # install the 'amdctl' binary mkdir -p %{buildroot}/%{_bindir} -install -m 0755 ./%{name} %{buildroot}/%{_bindir}/ +install -m 0755 redhat-linux-build/%{name} %{buildroot}/%{_bindir}/ # add modules.load.d entry mkdir -p %{buildroot}/%{_modulesloaddir}/