# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # lxpanel # lxpanel/Makefile # lxpanel/distinfo # lxpanel/pkg-descr # lxpanel/pkg-plist # lxpanel/files # lxpanel/files/patch-src-plugin.h # lxpanel/files/patch-src-plugin.c # lxpanel/files/patch-src-plugin-cpu-cpu.c # echo c - lxpanel mkdir -p lxpanel > /dev/null 2>&1 echo x - lxpanel/Makefile sed 's/^X//' >lxpanel/Makefile << 'END-of-lxpanel/Makefile' X# New ports collection makefile for: lxpanel X# Date created: Sat Oct 7 01:22:35 CST 2006 X# Whom: Lin, Cheng-Tao X# X# $FreeBSD$ X# X XPORTNAME= lxpanel XPORTVERSION= 0.2.4 XCATEGORIES= x11 XMASTER_SITES= ${MASTER_SITE_SOURCEFORGE} XMASTER_SITE_SUBDIR= lxde X XMAINTAINER= b89605222@ntu.edu.tw XCOMMENT= LXPanel is a lightweight X11 desktop panel X XUSE_XLIB= yes XUSE_GNOME= gtk20 gnomelibs gnomedesktop XGNU_CONFIGURE= yes XUSE_AUTOTOOLS= automake:19 XCONFIGURE_ARGS= --prefix=${PREFIX} XCONFIGURE_ENV= LDFLAGS="-L${X11BASE}/lib" CFLAGS="-I${LOCALBASE}/include" XCFLAGS+= -I${WRKSRC} XUSE_GMAKE= yes XUSE_LDCONFOG= yes X X.if !defined(WITHOUT_NLS) XUSE_GETTEXT= yes XPLIST_SUB+= NLS="" X.else XCONFIGURE_ARGS+=--disable-nls XPLIST_SUB+= NLS="@comment " X.endif X Xpre-patch: X @${REINPLACE_CMD} -e 's,linux,sys,' \ X ${WRKSRC}/src/plugins/volume/volume-impl.c X @${REINPLACE_CMD} -e 's,$$(DATADIRNAME)/locale,share/locale,' \ X ${WRKSRC}/po/Makefile.in.in X X.include END-of-lxpanel/Makefile echo x - lxpanel/distinfo sed 's/^X//' >lxpanel/distinfo << 'END-of-lxpanel/distinfo' XMD5 (lxpanel-0.2.4.tar.gz) = 37d0e9f2993fc63d9e7e1684552e10b4 XSHA256 (lxpanel-0.2.4.tar.gz) = c6e9bb54bb999f0a00bb6f6f77f01e572b4ad66b753339cf796c68525d557f79 XSIZE (lxpanel-0.2.4.tar.gz) = 714278 END-of-lxpanel/distinfo echo x - lxpanel/pkg-descr sed 's/^X//' >lxpanel/pkg-descr << 'END-of-lxpanel/pkg-descr' XLXpanel is a lightweight desktop panel like fbpanel. X XIt's not only with fbpanel features but also X X* supports i18n X* provides lxpanelctl to control lxpanel X XWWW: http://lxpanel.sourceforge.net/ END-of-lxpanel/pkg-descr echo x - lxpanel/pkg-plist sed 's/^X//' >lxpanel/pkg-plist << 'END-of-lxpanel/pkg-plist' Xbin/lxpanel Xbin/lxpanelctl Xlib/lxpanel/plugins/netstatus.so Xlib/lxpanel/plugins/volume.so Xlib/lxpanel/plugins/cpu.so Xlib/lxpanel/plugins/deskno.so X%%NLS%%share/locale/hu/LC_MESSAGES/lxpanel.mo X%%NLS%%share/locale/ko/LC_MESSAGES/lxpanel.mo X%%NLS%%share/locale/zh_TW/LC_MESSAGES/lxpanel.mo X%%DATADIR%%/default X%%DATADIR%%/images/my-computer.svg X%%DATADIR%%/images/redhat-internet.svg X%%DATADIR%%/images/stock_volume.png X%%DATADIR%%/images/thunderbird.svg X%%DATADIR%%/images/default.xpm X%%DATADIR%%/images/emacs.svg X%%DATADIR%%/images/file-manager.svg X%%DATADIR%%/images/firefox2.svg X%%DATADIR%%/images/gnome-applications.png X%%DATADIR%%/images/gnome-control-center.png X%%DATADIR%%/images/gnome-devel.png X%%DATADIR%%/images/gnome-fs-desktop.svg X%%DATADIR%%/images/gnome-globe.png X%%DATADIR%%/images/gnome-graphics.png X%%DATADIR%%/images/gnome-joystick.png X%%DATADIR%%/images/gnome-multimedia.png X%%DATADIR%%/images/gnome-logout.png X%%DATADIR%%/images/gnome-settings.png X%%DATADIR%%/images/gnome-netstatus-0-24.png X%%DATADIR%%/images/gnome-netstatus-25-49.png X%%DATADIR%%/images/gnome-netstatus-50-74.png X%%DATADIR%%/images/gnome-netstatus-75-100.png X%%DATADIR%%/images/gnome-netstatus-disconn.svg X%%DATADIR%%/images/gnome-netstatus-error.svg X%%DATADIR%%/images/gnome-netstatus-idle.svg X%%DATADIR%%/images/gnome-netstatus-rx.svg X%%DATADIR%%/images/gnome-netstatus-txrx.svg X%%DATADIR%%/images/gnome-netstatus-tx.svg X%%DATADIR%%/images/gnome-setting.svg X%%DATADIR%%/images/gnome-system.png X%%DATADIR%%/images/gnome_terminal.svg X%%DATADIR%%/images/gnome-util.png X%%DATADIR%%/pager X@dirrmtry lib/lxpanel/plugins X@dirrmtry lib/lxpanel X@dirrm %%DATADIR%%/images X@dirrm %%DATADIR%% END-of-lxpanel/pkg-plist echo c - lxpanel/files mkdir -p lxpanel/files > /dev/null 2>&1 echo x - lxpanel/files/patch-src-plugin.h sed 's/^X//' >lxpanel/files/patch-src-plugin.h << 'END-of-lxpanel/files/patch-src-plugin.h' X--- src/plugin.h.orig Sat Dec 23 22:15:11 2006 X+++ src/plugin.h Sat Dec 23 22:16:07 2006 X@@ -88,6 +88,7 @@ X #define STATIC_MENU X #define STATIC_SPACE X #define STATIC_ICONS X+#define STATIC_CPU X X #if 0 X /* Try to handle GTypePlugin problems, but in vain. :-( */ END-of-lxpanel/files/patch-src-plugin.h echo x - lxpanel/files/patch-src-plugin.c sed 's/^X//' >lxpanel/files/patch-src-plugin.c << 'END-of-lxpanel/files/patch-src-plugin.c' X--- src/plugin.c.orig Sat Dec 23 22:15:17 2006 X+++ src/plugin.c Sat Dec 23 22:17:21 2006 X@@ -148,6 +148,10 @@ X REGISTER_PLUGIN_CLASS(icons_plugin_class, 0); X #endif X X+#if defined(STATIC_CPU) && defined(PLUGIN_CPU) X+ REGISTER_PLUGIN_CLASS(cpu_plugin_class, 0); X+#endif X+ X RET(); X } X END-of-lxpanel/files/patch-src-plugin.c echo x - lxpanel/files/patch-src-plugin-cpu-cpu.c sed 's/^X//' >lxpanel/files/patch-src-plugin-cpu-cpu.c << 'END-of-lxpanel/files/patch-src-plugin-cpu-cpu.c' X--- src/plugins/cpu/cpu.c.orig Sat Dec 23 17:32:42 2006 X+++ src/plugins/cpu/cpu.c Sat Dec 23 17:32:49 2006 X@@ -24,7 +24,15 @@ X #include X #include X #include X-#include X+ X+#ifdef __FreeBSD__ X+# include X+# include X+# include X+#else X+# include X+#endif X+ X #include X #include X X@@ -61,6 +69,38 @@ X struct cpu_stat cpu_anterior; X } cpu_t; X X+#ifdef __FreeBSD__ X+static void X+get_procstat(unsigned long *u, unsigned long *n, unsigned long *s, X+ unsigned long *i) X+{ X+ static int mib[2] = { -1, -1 }, init = 0, j, realhz; X+ long ct[CPUSTATES]; X+ X+ X+ if(init == 0) { X+ struct clockinfo ci; X+ j = sizeof(ci); X+ sysctlbyname("kern.clockrate", &ci, &j, NULL, 0); X+ realhz = ci.stathz ? ci.stathz : ci.hz; X+ X+ j = 2; X+ sysctlnametomib("kern.cp_time", mib, &j); X+ X+ init = 1; X+ j = sizeof(ct); X+ } X+ X+ sysctl(mib, 2, ct, &j, NULL, 0); X+ *u = ct[CP_USER] / realhz; X+ *n = ct[CP_NICE] / realhz; X+ *s = ct[CP_SYS] / realhz; X+ *i = ct[CP_IDLE] / realhz; X+ X+ return; X+ } X+#endif X+ X X static int X cpu_update(cpu_t *c) X@@ -68,18 +108,28 @@ X int cpu_u=0, cpu_s=0, cpu_n=0, cpu_i=100; X unsigned int i; X struct cpu_stat cpu, cpu_r; X+ X+#ifndef __FreeBSD__ X+ FILE *stat; X+#endif X+ X FILE *stat; X float total; X X ENTER; X if(!c->pixmap) X RET(TRUE); X+ X+#ifdef __FreeBSD__ X+ get_procstat(&cpu.u, &cpu.n, &cpu.s, &cpu.i); X+#else X X stat = fopen("/proc/stat", "r"); X if(!stat) X RET(TRUE); X fscanf(stat, "cpu %lu %lu %lu %lu", &cpu.u, &cpu.n, &cpu.s, &cpu.i); X fclose(stat); X+#endif X X cpu_r.u = cpu.u - c->cpu_anterior.u; X cpu_r.n = cpu.n - c->cpu_anterior.n; END-of-lxpanel/files/patch-src-plugin-cpu-cpu.c exit