1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

Update to 1.4 [1]

Add LICENSE
Fix build under CLANG

PR:		ports/159732
Submitted by:	Jesse <jessefrgsmith@yahoo.ca> (maintainer) [1]
Approved by:	wxs (mentor)
This commit is contained in:
Ryan Steinmetz 2011-08-16 14:34:58 +00:00
parent 12667965f5
commit 92cec64c8a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=279810
4 changed files with 23 additions and 35 deletions

View File

@ -6,16 +6,23 @@
#
PORTNAME= cpulimit
PORTVERSION= 1.1
PORTVERSION= 1.4
CATEGORIES= sysutils
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}/
MASTER_SITES= SF/limitcpu/limitcpu/
MAINTAINER= jessefrgsmith@yahoo.ca
COMMENT= A program to limit the CPU usage of a process
PLIST_FILES= bin/${PORTNAME}
LICENSE= GPLv2
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
CFLAGS+= -lkvm -Wall -O2
MANCOMPRESSED= yes
PLIST_FILES= bin/${PORTNAME}
MAN1= ${PORTNAME}.1
post-patch:
@${REINPLACE_CMD} -e 's|share/||g' ${WRKSRC}/Makefile
@${REINPLACE_CMD} -e 's|gcc|${CC}|g' ${WRKSRC}/Makefile
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (cpulimit-1.1.tar.gz) = ee734e82692dc496a083c003340b326bd779567f5de99fcae99e451606c85c00
SIZE (cpulimit-1.1.tar.gz) = 5130
SHA256 (cpulimit-1.4.tar.gz) = 48bb37801c83c926bf891ca66927c4c51ed1f2186bb3d61a70b19168d3c576df
SIZE (cpulimit-1.4.tar.gz) = 15950

View File

@ -1,8 +1,8 @@
--- cpulimit.c.orig 2010-08-20 19:35:15.000000000 -0300
+++ cpulimit.c 2010-08-21 14:17:52.000000000 -0300
@@ -43,6 +43,15 @@
#include <errno.h>
#include <string.h>
--- ./cpulimit.c.orig 2011-08-12 19:35:36.000000000 -0300
+++ ./cpulimit.c 2011-08-12 21:31:58.000000000 -0300
@@ -35,6 +35,15 @@
#include <limits.h> // for compatibility
+#include <limits.h>
+#include <fcntl.h>
@ -16,7 +16,7 @@
//kernel time resolution (inverse of one jiffy interval) in Hertz
//i don't know how to detect it, then define to the default (not very clean!)
#define HZ 100
@@ -235,6 +244,31 @@
@@ -245,6 +254,31 @@
}
//get jiffies count from /proc filesystem
@ -48,9 +48,9 @@
int getjiffies(int pid) {
static char stat[20];
static char buffer[1024];
@@ -255,6 +289,8 @@
int ktime=atoi(p+1);
return utime+ktime;
@@ -271,6 +305,8 @@
// could not read info
return -1;
}
+*/
+

View File

@ -1,19 +0,0 @@
--- Makefile.old 2005-06-24 07:53:43.000000000 -0300
+++ Makefile 2010-08-21 15:10:45.000000000 -0300
@@ -1,7 +1,15 @@
+PREFIX=/usr/local
+
all:: cpulimit
cpulimit: cpulimit.c
- gcc -o cpulimit cpulimit.c -lrt -Wall -O2
+ gcc -o cpulimit cpulimit.c -lrt -Wall -O2 -lkvm
+
+install: cpulimit
+ cp cpulimit ${PREFIX}/bin
+
+deinstall:
+ rm -f ${PREFIX}/bin/cpulimit
clean:
rm -f *~ cpulimit