aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2008-04-11 11:44:14 +0000
committerRenato Botelho <garga@FreeBSD.org>2008-04-11 11:44:14 +0000
commit5dbde632d4f47b515f1dd077a4dd97492b282de4 (patch)
treed7b3ace7718af190b23d3c9142b143be01a4ed7d /sysutils
parent989ac675fc016bb0f7bd8e652a7c0b5cdbde817c (diff)
downloadports-5dbde632d4f47b515f1dd077a4dd97492b282de4.tar.gz
ports-5dbde632d4f47b515f1dd077a4dd97492b282de4.zip
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/wmcube/Makefile26
-rw-r--r--sysutils/wmcube/files/patch-wmcube.c47
-rw-r--r--sysutils/wmcube/files/pkg-message.in (renamed from sysutils/wmcube/pkg-message)0
-rw-r--r--sysutils/wmcube/pkg-descr2
-rw-r--r--sysutils/wmcube/pkg-plist4
5 files changed, 54 insertions, 25 deletions
diff --git a/sysutils/wmcube/Makefile b/sysutils/wmcube/Makefile
index 25829a7e2d77..723193262e91 100644
--- a/sysutils/wmcube/Makefile
+++ b/sysutils/wmcube/Makefile
@@ -7,20 +7,21 @@
PORTNAME= wmcube
PORTVERSION= 0.98
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= sysutils windowmaker
MASTER_SITES= ${MASTER_SITE_TUCOWS} \
http://dockapps.org/download.php/id/222/ \
- http://mirror2.unixfreunde.de/ \
http://freebsd.unixfreunde.de/sources/
MASTER_SITE_SUBDIR= x11/dock
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= garga@FreeBSD.org
COMMENT= Window Maker dockapp that displays cpu load and a realtime 3d object
WRKSRC= ${WRKDIR}/${PORTNAME}/${PORTNAME}
USE_XORG= xpm
MAKEFILE= Makefile.FREEBSD
+PORTDOCS= CHANGES README TODO
+SUB_FILES= pkg-message
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/wmcube ${PREFIX}/bin
@@ -30,20 +31,17 @@ do-install:
post-install:
.for file in *.wmc
@${ECHO} "===> Installing extra 3d objects in ${PREFIX}/share/${PORTNAME}"
- @${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m 555 \
- ${PREFIX}/share/${PORTNAME}
- @${INSTALL_DATA} ${WRKDIR}/${PORTNAME}/3dObjects/${file} \
- ${PREFIX}/share/${PORTNAME}
+ @${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m 555 ${DATADIR}
+ @${INSTALL_DATA} ${WRKDIR}/${PORTNAME}/3dObjects/${file} ${DATADIR}
.endfor
.ifndef(NOPORTDOCS)
@${ECHO} "===> Installing README in ${PREFIX}/share/doc/${PORTNAME}"
@${ECHO} "===> Please Read pkg-descr and README for usage information"
- @${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m 555 \
- ${PREFIX}/share/doc/${PORTNAME}
-.for file in CHANGES README TODO
- @${INSTALL_DATA} ${WRKSRC}/../${file} ${PREFIX}/share/doc/${PORTNAME}
-.endfor
-.endif # !NOPORTDOCS
- @${SED} -e "s|%%PREFIX%%|${PREFIX}|" ${PKGMESSAGE}
+ @${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m 555 ${DOCSDIR}
+. for f in ${PORTDOCS}
+ @${INSTALL_DATA} ${WRKSRC}/../${f} ${DOCSDIR}
+. endfor
+.endif
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/sysutils/wmcube/files/patch-wmcube.c b/sysutils/wmcube/files/patch-wmcube.c
index 6f77d7f73613..b12d941b2450 100644
--- a/sysutils/wmcube/files/patch-wmcube.c
+++ b/sysutils/wmcube/files/patch-wmcube.c
@@ -1,6 +1,14 @@
---- wmcube.c.orig Mon Oct 23 22:11:47 2000
-+++ wmcube.c Tue May 15 16:17:02 2001
-@@ -913,7 +926,7 @@ int loadobj(char *filename) {
+--- wmcube.c.orig 2000-10-23 18:11:47.000000000 -0200
++++ wmcube.c 2008-04-11 08:23:35.000000000 -0300
+@@ -125,6 +125,7 @@
+ #ifdef FREEBSD
+ static kvm_t *kd;
+ static struct nlist nlst[] = { {"_cp_time"}, {0} };
++static int cp_time_mib[2];
+ #endif
+
+ int main(int argc, char **argv)
+@@ -913,7 +914,7 @@
exit(0);
}
@@ -9,7 +17,7 @@
if (strcmp(tmp,"WMCUBE_COORDINATES") != 0) {
printf("\nError in objectfile: it must start with WMCUBE_COORDINATES\n\n");
-@@ -921,7 +934,7 @@ int loadobj(char *filename) {
+@@ -921,7 +922,7 @@
exit(0);
}
@@ -18,7 +26,7 @@
counter = atoi(tmp);
while ((strcmp(tmp,"WMCUBE_LINES") != 0) && (strcmp(tmp,"WMCUBE_PLANES") != 0)) {
-@@ -938,7 +951,7 @@ int loadobj(char *filename) {
+@@ -938,7 +939,7 @@
fclose(fp);
exit(0);
}
@@ -27,3 +35,32 @@
if (feof(fp)) {
printf("\nError in objectfile: you must have a section WMCUBE_LINES or WMCUBE_PLANES\n\n");
+@@ -1224,9 +1225,14 @@
+ #include <nlist.h>
+ #include <fcntl.h>
+ #include <sys/dkstat.h>
++#include <sys/sysctl.h>
+
+ int init_calc_cpu()
+ {
++ size_t len = 2;
++ if (sysctlnametomib("kern.cp_time", cp_time_mib, &len) == 0)
++ return 0;
++ printf("\nWarning: unable to sysctl kern.cp_time\n\n");
+
+ if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
+ {
+@@ -1249,6 +1255,13 @@
+ int cpu,nice,system,idle;
+ unsigned long int cpu_time[CPUSTATES];
+
++ if (cp_time_mib[0] != 0) {
++ size_t cpu_time_len = sizeof (cpu_time);
++ if (sysctl(cp_time_mib, 2, cpu_time, &cpu_time_len, NULL, 0) < 0) {
++ printf("\nError sysctl\n\n");
++ exit(0);
++ }
++ } else
+ if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time))
+ != sizeof(cpu_time))
+ {
diff --git a/sysutils/wmcube/pkg-message b/sysutils/wmcube/files/pkg-message.in
index 785ca4fb3a4e..785ca4fb3a4e 100644
--- a/sysutils/wmcube/pkg-message
+++ b/sysutils/wmcube/files/pkg-message.in
diff --git a/sysutils/wmcube/pkg-descr b/sysutils/wmcube/pkg-descr
index 972443ab9327..bd4e18a6f6d7 100644
--- a/sysutils/wmcube/pkg-descr
+++ b/sysutils/wmcube/pkg-descr
@@ -4,5 +4,3 @@ faster/slower. You can zoom in and out by clicking on the dockapp.
WWW: http://dockapps.org/file.php/id/162
Author: Robert Kling <robkli-8@student.luth.se>
-
-- Patrick Li <pat@FreeBSD.org>
diff --git a/sysutils/wmcube/pkg-plist b/sysutils/wmcube/pkg-plist
index 798bf0149f06..25f7e14f9be5 100644
--- a/sysutils/wmcube/pkg-plist
+++ b/sysutils/wmcube/pkg-plist
@@ -1,7 +1,4 @@
bin/wmcube
-%%PORTDOCS%%%%DOCSDIR%%/CHANGES
-%%PORTDOCS%%%%DOCSDIR%%/README
-%%PORTDOCS%%%%DOCSDIR%%/TODO
%%DATADIR%%/2planes-solid.wmc
%%DATADIR%%/4d.wmc
%%DATADIR%%/8star-small.wmc
@@ -37,4 +34,3 @@ bin/wmcube
%%DATADIR%%/starcube.wmc
%%DATADIR%%/wmlogo.wmc
@dirrm %%DATADIR%%
-%%PORTDOCS%%@dirrm %%DOCSDIR%%