summaryrefslogtreecommitdiff
path: root/x11-plugins/wmcms
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /x11-plugins/wmcms
reinit the tree, so we can have metadata
Diffstat (limited to 'x11-plugins/wmcms')
-rw-r--r--x11-plugins/wmcms/Manifest7
-rw-r--r--x11-plugins/wmcms/files/wmcms-0.3.5-s4t4n.patch274
-rw-r--r--x11-plugins/wmcms/metadata.xml9
-rw-r--r--x11-plugins/wmcms/wmcms-0.3.5-r1.ebuild33
-rw-r--r--x11-plugins/wmcms/wmcms-0.3.5-r2.ebuild33
5 files changed, 356 insertions, 0 deletions
diff --git a/x11-plugins/wmcms/Manifest b/x11-plugins/wmcms/Manifest
new file mode 100644
index 000000000000..b38b413b043c
--- /dev/null
+++ b/x11-plugins/wmcms/Manifest
@@ -0,0 +1,7 @@
+AUX wmcms-0.3.5-s4t4n.patch 8562 SHA256 555cb99107b28322a9744e2cbe8e14d89aa9fdefa24d14df46d01c47b5cc1baa SHA512 ad25dead5271907845ae96efec52844de1005f31ddbf4d2e43996633ef8c54c89f9137421b019079462227a16052df950c7f589d112815c8b02b435f863e8b09 WHIRLPOOL bf669f1c567fe3eb631d0784fa2b0b89084e2a8b52802c54afb23d318d85a4b87a8aa2c141ae4b2a0ede28c9ae9b16764d7e2c8cda4c7dcae72c0fcb81a488c3
+DIST wmcms-0.3.5.tar.bz2 18920 SHA256 9b47672b3fa5a2474fe26dabb0e95030a4792766ce6577391ab1cd784f21d09b SHA512 f2852f8b81e1eac0396ca0964590fdf2560b97b5ee5266288641487ddfe77879e552c5e77e42f398ecf974a9030dd147ad64eedf7f7c32af53d69be31c8598fd WHIRLPOOL 5271e3a7c42745ea8f0b2a27dcba8d717e9b3e9243a862975d1f6b6f8430a0a92a80d3eaa0695ad8ba620a4b9d32c5a692c6178780ebde1168ff30bc5b478a84
+EBUILD wmcms-0.3.5-r1.ebuild 741 SHA256 a78eabf9da9da77145c1e1b8c6ad82f6fc50fc38ec3a4b1eb52ac842f682c075 SHA512 8e5d970a51e23f5eda98df3458380c97cfca7def9b98ca0ae66bf8ec3a8593f4e14b9fac79dad4fcecf3d066b2986b3c0922b35f4de3813120792b0e2ad4d159 WHIRLPOOL b3d89f82151a476c97aa7a3d19be1190b09d08264d95a85d6987b87cfb7c13898f92efab45dc204fc755a9a69c301ab5aa78e7a22f4b6f704dd75eef306ee836
+EBUILD wmcms-0.3.5-r2.ebuild 737 SHA256 adeaa4436b7f83b586c8ca0c985f7e727019d6f6b29f326216c06e6ff55a11f9 SHA512 bff3367b118587288fe102efe521174dad468e7174de0610ef2fabae90621c0ed3123f508c6c887f58d8a66c3123ba79453c2dce1a6d4c38882be7c890185efa WHIRLPOOL 4cebd94ea472ad343ead9336970b29ccbb5819d7abc223a7465229a913552b2afc6d0d5a4c84d28b83141bbe4da79bd802843b88f9ae0e74adae963bd04c95aa
+MISC ChangeLog 3207 SHA256 6c2150c88e046447ff49931f9cbf9f91858acc604e701a4d1bd15f651dfc22df SHA512 1b1c99feed50b2f136e186524cacfc865f247b4c0033f44d6940ddf9cddf76ef7811b66f3c2f7a27589a07505d19402538f9b41d52f41b9e2559b3a91761d4d8 WHIRLPOOL e404a605c4ed1204c4441a31ad1382148412923d842b5dbebc971999838178f5617169aad2fdf55858542da2ed8c8d2daddb615dd040393eea27327d5261f7f8
+MISC ChangeLog-2015 2151 SHA256 ceab54fc9f2dbfbe85543bd9c6bad7ca2c60e0a0e313bd520e5c72e42d7ecb9d SHA512 38ee9261e049463a4dbda0292ae51a5988f11fd25d418dedaf89f57849cab7ec6ad1a56e29327140fe0fd2139d5dabe498886f23c6aa253f64daeb1c7bd5d375 WHIRLPOOL 0f7c0498f027d72f92878ddb5d250dd506cafcf3b7591094f3db59caafaee2c3a707ad0f587e1361dee1d075922ff284d45e38672cebe1291a6544362ed36396
+MISC metadata.xml 249 SHA256 ab0de85cc2ebef9f9bca3773395bc5c909312efb834a8b3948806c1b00dee4e5 SHA512 1a1312bb0e9f74f1e3852218d8fd4817fbad3bc65633cecbe8735607bc33c1e05b414c2628ff3f6e24dfc4a3999de7191f6cdadd2161b03cf614d5b6f24fab8d WHIRLPOOL 3d7026fc5a045f5c90505dab413fe4534364d8c9a47c053ffbfaf3579478e55f77427eb00b05bd4c593a372c69eefae5ca93a2bab9398f52d20d374c2265fb2d
diff --git a/x11-plugins/wmcms/files/wmcms-0.3.5-s4t4n.patch b/x11-plugins/wmcms/files/wmcms-0.3.5-s4t4n.patch
new file mode 100644
index 000000000000..522add1e7690
--- /dev/null
+++ b/x11-plugins/wmcms/files/wmcms-0.3.5-s4t4n.patch
@@ -0,0 +1,274 @@
+diff -Naur wmcms-0.3.5/state_linux.h wmcms-0.3.5/state_linux.h
+--- wmcms-0.3.5/state_linux.h 2001-09-24 00:56:28.000000000 +0200
++++ wmcms-0.3.5/state_linux.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,47 +0,0 @@
+-/* wmcms - WindowMaker CPU / Mem Usage Monitor DockApp
+- * state_linux.h
+- * Linux specific functions to get system usage, may someone write it to another plataform
+- * Copyright (C) 2001 Fabio Pugliese Ornellas <fabio.ornellas@poli.usp.br>
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+- */
+-
+-int cpu_user;
+-int cpu_nice;
+-int cpu_kernel;
+-int cpu_idle;
+-
+-int mem_total;
+-int mem_used;
+-int mem_buffers;
+-int mem_cached;
+-
+-int swap_total;
+-int swap_used;
+-
+-void get_cpuinfo ( void )
+-{
+- FILE *fp;
+- fp = fopen ( "/proc/stat", "r" );
+- fscanf ( fp, "%*s %d %d %d %d", &cpu_user, &cpu_nice, &cpu_kernel, &cpu_idle );
+- fclose ( fp );
+-}
+-
+-void get_meminfo ( void )
+-{
+- FILE *fp;
+- fp = fopen ( "/proc/meminfo", "r" );
+- fscanf ( fp, "%*s %*s %*s %*s %*s %*s %*s %d %d %*d %*d %d %d %*s %d %d", &mem_total, &mem_used, &mem_buffers, &mem_cached, &swap_total, &swap_used );
+- fclose ( fp );
+-}
+diff -Naur wmcms-0.3.5/state_linux_2.4.h wmcms-0.3.5/state_linux_2.4.h
+--- wmcms-0.3.5/state_linux_2.4.h 1970-01-01 01:00:00.000000000 +0100
++++ wmcms-0.3.5/state_linux_2.4.h 2004-07-20 22:09:11.157182296 +0200
+@@ -0,0 +1,47 @@
++/* wmcms - WindowMaker CPU / Mem Usage Monitor DockApp
++ * state_linux.h
++ * Linux specific functions to get system usage, may someone write it to another plataform
++ * Copyright (C) 2001 Fabio Pugliese Ornellas <fabio.ornellas@poli.usp.br>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++
++int cpu_user;
++int cpu_nice;
++int cpu_kernel;
++int cpu_idle;
++
++int mem_total;
++int mem_used;
++int mem_buffers;
++int mem_cached;
++
++int swap_total;
++int swap_used;
++
++void get_cpuinfo_24 ( void )
++{
++ FILE *fp;
++ fp = fopen ( "/proc/stat", "r" );
++ fscanf ( fp, "%*s %d %d %d %d", &cpu_user, &cpu_nice, &cpu_kernel, &cpu_idle );
++ fclose ( fp );
++}
++
++void get_meminfo_24 ( void )
++{
++ FILE *fp;
++ fp = fopen ( "/proc/meminfo", "r" );
++ fscanf ( fp, "%*s %*s %*s %*s %*s %*s %*s %d %d %*d %*d %d %d %*s %d %d", &mem_total, &mem_used, &mem_buffers, &mem_cached, &swap_total, &swap_used );
++ fclose ( fp );
++}
+diff -Naur wmcms-0.3.5/state_linux_2.6.h wmcms-0.3.5/state_linux_2.6.h
+--- wmcms-0.3.5/state_linux_2.6.h 1970-01-01 01:00:00.000000000 +0100
++++ wmcms-0.3.5/state_linux_2.6.h 2004-07-20 22:08:54.256751552 +0200
+@@ -0,0 +1,55 @@
++/* wmcms - WindowMaker CPU / Mem Usage Monitor DockApp
++ * state_linux.h
++ * Linux specific functions to get system usage, may someone write it to another plataform
++ * Copyright (C) 2001 Fabio Pugliese Ornellas <fabio.ornellas@poli.usp.br>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++
++int cpu_user;
++int cpu_nice;
++int cpu_kernel;
++int cpu_idle;
++
++int mem_total;
++int mem_free;
++int mem_used;
++int mem_buffers;
++int mem_cached;
++
++int swap_total;
++int swap_free;
++int swap_used;
++
++void get_cpuinfo_26 ( void )
++{
++ FILE *fp;
++ fp = fopen ( "/proc/stat", "r" );
++ fscanf ( fp, "%*s %d %d %d %d", &cpu_user, &cpu_nice, &cpu_kernel, &cpu_idle );
++ fclose ( fp );
++}
++
++void get_meminfo_26 ( void )
++{
++ FILE *fp;
++ fp = fopen ( "/proc/meminfo", "r" );
++/* The format of /proc/meminfo has changed with the 2.6 kernel; this new line will work for 2.6 -- idh
++ fscanf ( fp, "%*s %*s %*s %*s %*s %*s %*s %d %d %*d %*d %d %d %*s %d %d", &mem_total, &mem_used, &mem_buffers, &mem_cached, &swap_total, &swap_used ); */
++ fscanf ( fp, "%*s %d %*s %*s %d %*s %*s %d %*s %*s %d %*s %*s %*d %*s %*s %*d %*s %*s %*d %*s %*s %*d %*s %*s %*d %*s %*s %*d %*s %*s %*d %*s %*s %d %*s %*s %d %*s",
++ &mem_total, &mem_free, &mem_buffers, &mem_cached, &swap_total, &swap_free );
++ fclose ( fp );
++
++ mem_used = mem_total - mem_free;
++ swap_used = swap_total - swap_free;
++}
+diff -Naur wmcms-0.3.5/wmcms.c wmcms-0.3.5/wmcms.c
+--- wmcms-0.3.5/wmcms.c 2001-09-24 00:57:06.000000000 +0200
++++ wmcms-0.3.5/wmcms.c 2004-07-20 22:34:26.917751664 +0200
+@@ -19,7 +19,8 @@
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <dockapp.h>
+-#include "state_linux.h"
++#include "state_linux_2.6.h"
++#include "state_linux_2.4.h"
+ #include "wmcms.xpm"
+
+ char *displayName = "";
+@@ -34,6 +35,13 @@
+ int no_nice;
+ char *exe = "";
+
++typedef enum
++{
++ IS_2_6 = 0,
++ IS_OTHER
++} kernel_versions;
++kernel_versions kernel_version;
++
+ /* command line */
+ static DAProgramOption options[] = {
+ {"-d", "--display", "display to use", DOString, False, {&displayName} },
+@@ -44,6 +52,8 @@
+ {"-p", "--program", "program to run on CPU click", DOString, False, {&exe} }
+ };
+
++kernel_versions Get_Kernel_version(void);
++
+ /* draw bars */
+ void bar ( int size, int x, int y, int barx, int bary )
+ {
+@@ -156,6 +166,9 @@
+ /* define callbacks */
+ DACallbacks callbacks = { NULL, change, NULL, NULL, NULL, NULL };
+
++ /* determine kernel version */
++ kernel_version = Get_Kernel_version();
++
+ advanced = 0;
+ up = 0;
+ no_nice = 0;
+@@ -204,14 +217,23 @@
+ XCopyArea ( DADisplay, backdrop, pixmap, gc, 3, 140, 58, 58, 0, 0);
+ DASetPixmap(pixmap);
+
+- /* initial cpu total while splash */
+- get_cpuinfo();
++ /* initial cpu total while splash */
++ if (kernel_version == IS_2_6)
++ get_cpuinfo_26();
++ else
++ get_cpuinfo_24();
++
+ old_cpu_user = cpu_user;
+ old_cpu_nice = cpu_nice;
+ old_cpu_kernel = cpu_kernel;
+ old_cpu_idle = cpu_idle;
+ usleep ( delay );
+- get_cpuinfo();
++
++ if (kernel_version == IS_2_6)
++ get_cpuinfo_26();
++ else
++ get_cpuinfo_24();
++
+ cpu_total = cpu_user - old_cpu_user + cpu_nice - old_cpu_nice + cpu_kernel - old_cpu_kernel + cpu_idle - old_cpu_idle;
+
+ /* draw background */
+@@ -230,8 +252,16 @@
+ XCopyArea ( DADisplay, backdrop, pixmap, gc, 4, 14, 56, 8, 1, 49 );
+
+ /* read values */
+- get_cpuinfo ();
+- get_meminfo ();
++ if (kernel_version == IS_2_6)
++ {
++ get_cpuinfo_26 ();
++ get_meminfo_26 ();
++ }
++ else
++ {
++ get_cpuinfo_24 ();
++ get_meminfo_24 ();
++ }
+
+ /* cpu total */
+ cpu_total = cpu_user - old_cpu_user + cpu_nice - old_cpu_nice + cpu_kernel - old_cpu_kernel + cpu_idle - old_cpu_idle;
+@@ -328,3 +358,20 @@
+ fprintf(stderr, "Congratulations, something truely awful has happened.\n");
+ return -1;
+ }
++
++kernel_versions Get_Kernel_version(void)
++{
++ FILE *fp = fopen("/proc/version", "r");
++ char buf[512];
++
++ if (!fp) return IS_OTHER;
++ if (!fgets(buf, 512, fp))
++ {
++ fclose(fp);
++ return IS_OTHER;
++ }
++ fclose(fp);
++
++ if (strstr(buf, "2.6.")) return IS_2_6;
++ return IS_OTHER;
++}
diff --git a/x11-plugins/wmcms/metadata.xml b/x11-plugins/wmcms/metadata.xml
new file mode 100644
index 000000000000..1d5e6504004e
--- /dev/null
+++ b/x11-plugins/wmcms/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>voyageur@gentoo.org</email>
+ <name>Bernard Cafarelli</name>
+</maintainer>
+
+</pkgmetadata>
diff --git a/x11-plugins/wmcms/wmcms-0.3.5-r1.ebuild b/x11-plugins/wmcms/wmcms-0.3.5-r1.ebuild
new file mode 100644
index 000000000000..ac579029206f
--- /dev/null
+++ b/x11-plugins/wmcms/wmcms-0.3.5-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils
+
+DESCRIPTION="WindowMaker CPU and Memory Usage Monitor Dock App"
+SRC_URI="http://orbita.starmedia.com/~neofpo/files/${P}.tar.bz2"
+HOMEPAGE="http://orbita.starmedia.com/~neofpo/wmcms.html"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 sparc x86"
+IUSE=""
+
+RDEPEND="<x11-libs/libdockapp-0.7"
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/wmcms-0.3.5-s4t4n.patch
+
+ # Respect LDFLAGS, see bug #335031
+ sed -i 's/ -o wmcms/ ${LDFLAGS} -o wmcms/' "Makefile"
+}
+
+src_compile() {
+ emake CFLAGS="${CFLAGS}" || die "emake failed."
+}
+
+src_install() {
+ dobin wmcms || die "dobin failed."
+}
diff --git a/x11-plugins/wmcms/wmcms-0.3.5-r2.ebuild b/x11-plugins/wmcms/wmcms-0.3.5-r2.ebuild
new file mode 100644
index 000000000000..6c1a11c25e70
--- /dev/null
+++ b/x11-plugins/wmcms/wmcms-0.3.5-r2.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="WindowMaker CPU and Memory Usage Monitor Dock App"
+SRC_URI="http://orbita.starmedia.com/~neofpo/files/${P}.tar.bz2"
+HOMEPAGE="http://orbita.starmedia.com/~neofpo/wmcms.html"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+DEPEND=">=x11-libs/libdockapp-0.7:="
+
+src_prepare() {
+ epatch "${FILESDIR}"/wmcms-0.3.5-s4t4n.patch
+
+ # Respect LDFLAGS, see bug #335031
+ sed -e 's/ -o wmcms/ ${LDFLAGS} -o wmcms/' -i Makefile || die
+
+ sed -e 's#<dockapp.h>#<libdockapp/dockapp.h>#' -i *.c || die
+}
+
+src_compile() {
+ emake CFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ dobin wmcms
+}