cpulimit: upgrade to v2.8

Use latest source from sourceforge instead of github.
More info at: https://github.com/opsengine/cpulimit/issues/112

Change-Id: I6a0740b5ab277a771237a2612535be46458c5434
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/18257
Reviewed-by: Shreenidhi Shedi <sshedi@vmware.com>
Tested-by: gerrit-photon <photon-checkins@vmware.com>
This commit is contained in:
Shreenidhi Shedi 2022-07-11 14:23:32 -07:00
parent eb22e93a8d
commit 997b14b4a2
2 changed files with 12 additions and 58 deletions

View File

@ -1,17 +1,15 @@
Name: cpulimit
Version: 1.2
Version: 2.8
Release: 1%{?dist}
Summary: CPU Usage Limiter for Linux
Vendor: VMware, Inc.
Distribution: Photon
Group: Applications/System
License: GPLv2+
URL: https://github.com/opsengine/cpulimit
URL: https://sourceforge.net/projects/limitcpu
Source0: https://github.com/opsengine/cpulimit/archive/refs/tags/%{name}-%{version}.tar.gz
%define sha512 %{name}=50f6ab4dc7bffa09fa475b7554d518ec9d75ac325d7247a964b417feecbe466f61d217347513e6e6d111a43af61077a9c6e92b790c71e51c2e27c90fbfd43b1a
Patch0: fix-include-warning-ifdef-macro-errors.patch
Source0: https://sourceforge.net/projects/limitcpu/files/limitcpu/%{name}-%{version}.tar.gz
%define sha512 %{name}=aeb121739a5dc9f94c6ddb0905ed05eb7d146c9d0e71c34ba46aad798bda2c30b7ccc548338b4c468f9885f09d97a4565c00199c8df6af74dc9b6f23940c540e
BuildRequires: glibc-devel
@ -28,24 +26,25 @@ is able to adapt itself to the overall system load, dynamically and quickly.
%autosetup -p1
%build
make %{?_smp_mflags}
%make_build
%install
install -Dp -m 755 src/%{name} %{buildroot}%{_bindir}/%{name}
%if 0%{?with_check}
%check
cd tests && ./process_iterator_test
%endif
export PREFIX=%{buildroot}%{_prefix}
%make_install %{?_smp_mflags}
%clean
rm -rf %{buildroot}
%ldconfig_scriptlets
%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_mandir}/man1/*
%changelog
* Mon Jul 11 2022 Gerrit Photon <photon-checkins@vmware.com> 2.8-1
- Automatic Version Bump
* Mon May 30 2022 Shreenidhi Shedi <sshedi@vmware.com> 1.2-1
- Upgrade to v1.2
- Actual tag version is 0.2 but to maintain proper versioning, using 1.2

View File

@ -1,45 +0,0 @@
From c1ff6d0325dfc68a88236bbf9f8f9ac832a7aa10 Mon Sep 17 00:00:00 2001
From: Shreenidhi Shedi <sshedi@vmware.com>
Date: Mon, 30 May 2022 23:39:40 +0530
Subject: [PATCH] fix include warning & ifdef macro errors
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
---
src/cpulimit.c | 3 +--
tests/process_iterator_test.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/cpulimit.c b/src/cpulimit.c
index 50eabea..2acebf1 100644
--- a/src/cpulimit.c
+++ b/src/cpulimit.c
@@ -38,12 +38,11 @@
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
-#include <sys/sysctl.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/wait.h>
-#ifdef __APPLE__ || __FREEBSD__
+#if defined __APPLE__ || defined __FREEBSD__
#include <libgen.h>
#endif
diff --git a/tests/process_iterator_test.c b/tests/process_iterator_test.c
index 1615196..6fba4c0 100644
--- a/tests/process_iterator_test.c
+++ b/tests/process_iterator_test.c
@@ -28,7 +28,7 @@
#include <signal.h>
#include <string.h>
-#ifdef __APPLE__ || __FREEBSD__
+#if defined __APPLE__ || defined __FREEBSD__
#include <libgen.h>
#endif
--
2.25.1