use cmake

Signed-off-by: Owen-sz <owen@fyralabs.com>
This commit is contained in:
Owen-sz
2026-06-16 16:24:31 +02:00
parent 86aff1beb4
commit 0603ec22c8
2 changed files with 7 additions and 28 deletions
@@ -1,22 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paskal Sitepu <rmnscnce@ya.ru>
Date: Sat, 4 Nov 2023 09:54:38 +0700
Subject: [PATCH] (RPM) makefile: Remove unused Makefile variables
Signed-off-by: Paskal Sitepu <rmnscnce@ya.ru>
---
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
+7 -6
View File
@@ -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}/