2 changed files with 606 additions and 0 deletions
@ -0,0 +1,482 @@
|
||||
--- src/aapm.cc.orig Sat Jan 4 01:25:45 2003
|
||||
+++ src/aapm.cc Mon Jan 6 19:00:50 2003
|
||||
@@ -26,6 +26,13 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
+#ifdef __FreeBSD__
|
||||
+#include <sys/file.h>
|
||||
+#include <sys/ioctl.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <machine/apm_bios.h>
|
||||
+#endif
|
||||
+
|
||||
YColor *YApm::apmBg = 0;
|
||||
YColor *YApm::apmFg = 0;
|
||||
YFont *YApm::apmFont = 0;
|
||||
@@ -47,8 +54,12 @@
|
||||
|
||||
|
||||
void ApmStr(char *s, bool Tool) {
|
||||
+#ifdef __FreeBSD__
|
||||
+ struct apm_info ai;
|
||||
+#else
|
||||
char buf[80];
|
||||
- int len, i, fd = open("/proc/apm", O_RDONLY);
|
||||
+#endif
|
||||
+ int len, i, fd = open(APMDEV, O_RDONLY);
|
||||
char driver[16];
|
||||
char apmver[16];
|
||||
int apmflags;
|
||||
@@ -60,9 +71,27 @@
|
||||
char units[16];
|
||||
|
||||
if (fd == -1) {
|
||||
+ static int error = 0;
|
||||
+ if (!error)
|
||||
+ perror("Can't open the apm device");
|
||||
+ error = 1;
|
||||
return ;
|
||||
}
|
||||
-
|
||||
+#ifdef __FreeBSD__
|
||||
+ if (ioctl(fd,APMIO_GETINFO, &ai) == -1)
|
||||
+ {
|
||||
+ static int error = 0;
|
||||
+ if (!error)
|
||||
+ perror("Can't ioctl the apm device");
|
||||
+ error = 1;
|
||||
+ close(fd);
|
||||
+ return;
|
||||
+ }
|
||||
+ close(fd);
|
||||
+ BATlife = ai.ai_batt_life;
|
||||
+ ACstatus = ai.ai_acline ;
|
||||
+ BATflag = ai.ai_batt_stat == 3 ? 8 : 0;
|
||||
+#else
|
||||
len = read(fd, buf, sizeof(buf) - 1);
|
||||
close(fd);
|
||||
|
||||
@@ -76,10 +105,11 @@
|
||||
static int error = 1;
|
||||
if (error) {
|
||||
error = 0;
|
||||
- warn(_("/proc/apm - unknown format (%d)"), i);
|
||||
+ warn(_("%s - unknown format (%d)"), APMDEV, i);
|
||||
}
|
||||
return ;
|
||||
}
|
||||
+#endif
|
||||
if (BATlife == -1)
|
||||
BATlife = 0;
|
||||
|
||||
--- src/apppstatus.cc.orig Sat Mar 17 00:17:37 2001
|
||||
+++ src/apppstatus.cc Thu Apr 5 22:45:29 2001
|
||||
@@ -270,6 +270,7 @@
|
||||
return isUpIsdn();
|
||||
#endif
|
||||
|
||||
+#ifndef __FreeBSD__
|
||||
char buffer[32 * sizeof(struct ifreq)];
|
||||
struct ifconf ifc;
|
||||
struct ifreq *ifr;
|
||||
@@ -301,6 +302,38 @@
|
||||
}
|
||||
|
||||
close(s);
|
||||
+
|
||||
+#else // __FreeBSD__
|
||||
+ // FreeBSD code by Ronald Klop <ronald@cs.vu.nl>
|
||||
+ struct ifmibdata ifmd;
|
||||
+ size_t ifmd_size=sizeof(ifmibdata);
|
||||
+ int nr_network_devs;
|
||||
+ size_t int_size=sizeof(int);
|
||||
+ int name[6];
|
||||
+ name[0] = CTL_NET;
|
||||
+ name[1] = PF_LINK;
|
||||
+ name[2] = NETLINK_GENERIC;
|
||||
+ name[3] = IFMIB_IFDATA;
|
||||
+ name[5] = IFDATA_GENERAL;
|
||||
+
|
||||
+ if(sysctlbyname("net.link.generic.system.ifcount",&nr_network_devs,
|
||||
+ &int_size,(void*)0,0) == -1) {
|
||||
+ printf("%s@%d: %s\n",__FILE__,__LINE__,strerror(errno));
|
||||
+ } else {
|
||||
+ for(int i=1;i<=nr_network_devs;i++) {
|
||||
+ name[4] = i; /* row of the ifmib table */
|
||||
+
|
||||
+ if(sysctl(name, 6, &ifmd, &ifmd_size, (void *)0, 0) == -1) {
|
||||
+ printf(_("%s@%d: %s\n"),__FILE__,__LINE__,strerror(errno));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (strcmp(ifmd.ifmd_name, netDevice) == 0 && (ifmd.ifmd_flags & IFF_RUNNING)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+#endif // __FreeBSD__
|
||||
return false;
|
||||
#endif // if 0
|
||||
}
|
||||
--- src/ylocale.cc.orig Tue Oct 9 23:54:04 2001
|
||||
+++ src/ylocale.cc Wed Feb 20 17:32:28 2002
|
||||
@@ -18,7 +18,9 @@
|
||||
|
||||
#ifdef CONFIG_I18N
|
||||
#include <errno.h>
|
||||
+#if __FreeBSD__ >= 5
|
||||
#include <langinfo.h>
|
||||
+#endif
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -31,6 +33,41 @@
|
||||
YLocale * YLocale::locale(NULL);
|
||||
#endif
|
||||
|
||||
+#ifdef CONFIG_I18N
|
||||
+#if __FreeBSD__ < 5
|
||||
+#undef CONFIG_NL_CODESETS
|
||||
+#define CONFIG_NL_CODESETS 0
|
||||
+char* icewm_nl_langinfo(void* item) {
|
||||
+ char* mylocale = setlocale(LC_ALL, "");
|
||||
+
|
||||
+ if( mylocale == NULL || *mylocale == '\0' )
|
||||
+ return NULL;
|
||||
+
|
||||
+ if( strncmp(mylocale, "ja", strlen("ja")) == 0 ) {
|
||||
+ return strdup("EUC-JP");
|
||||
+ } if( strncmp(mylocale, "zh_TW", strlen("zh_TW")) == 0 ) {
|
||||
+ return strdup("BIG5");
|
||||
+ } if( strncmp(mylocale, "ko", strlen("ko")) == 0 ) {
|
||||
+ return strdup("EUC-KR");
|
||||
+ } if( strncmp(mylocale, "ru", strlen("ru")) == 0 ) {
|
||||
+ return "KOI8-R";
|
||||
+ } if( strncmp(mylocale, "ro", strlen("ro")) == 0 ) {
|
||||
+ return "ISO-8859-2";
|
||||
+ } if( strncmp(mylocale, "hr", strlen("hr")) == 0 ) {
|
||||
+ return "ISO-8859-2";
|
||||
+ } if( strncmp(mylocale, "hu", strlen("hu")) == 0 ) {
|
||||
+ return "ISO-8859-2";
|
||||
+ } if( strncmp(mylocale, "pl", strlen("pl")) == 0 ) {
|
||||
+ return "ISO-8859-2";
|
||||
+ } if( strncmp(mylocale, "lt", strlen("lt")) == 0 ) {
|
||||
+ return "ISO-8859-13";
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+#endif
|
||||
+#endif /* CONFIG_I18N */
|
||||
+
|
||||
#ifndef CONFIG_I18N
|
||||
YLocale::YLocale(char const * ) {
|
||||
#else
|
||||
@@ -45,8 +82,12 @@
|
||||
char const * codeset("");
|
||||
int const codesetItems[] = { CONFIG_NL_CODESETS };
|
||||
|
||||
+#if __FreeBSD__ >= 5
|
||||
for (int const * csi(codesetItems); *csi &&
|
||||
NULL != (codeset = nl_langinfo(*csi)) && '\0' == *codeset; ++csi);
|
||||
+#else
|
||||
+ codeset = icewm_nl_langinfo(NULL);
|
||||
+#endif
|
||||
|
||||
if (NULL == codeset || '\0' == *codeset) {
|
||||
warn(_("Failed to determinate the current locale's codeset. "
|
||||
--- src/sysdep.h.orig Tue Oct 9 23:54:03 2001
|
||||
+++ src/sysdep.h Wed Feb 20 15:22:43 2002
|
||||
@@ -57,7 +57,9 @@
|
||||
|
||||
#ifdef CONFIG_I18N
|
||||
#include <locale.h>
|
||||
+#if __FreeBSD__ >= 5
|
||||
#include <langinfo.h>
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
--- src/acpustatus.cc.orig Sun Mar 9 04:37:52 2003
|
||||
+++ src/acpustatus.cc Thu Apr 24 05:09:50 2003
|
||||
@@ -26,7 +26,16 @@
|
||||
|
||||
#include "intl.h"
|
||||
|
||||
-#if (defined(linux) || defined(HAVE_KSTAT_H))
|
||||
+#if (defined(linux) || defined(HAVE_KSTAT_H) || defined(__FreeBSD__))
|
||||
+
|
||||
+#ifdef __FreeBSD__
|
||||
+#include <fcntl.h>
|
||||
+#include <kvm.h>
|
||||
+#include <nlist.h>
|
||||
+#include <sys/dkstat.h>
|
||||
+#include <sys/resource.h>
|
||||
+#include <devstat.h>
|
||||
+#endif
|
||||
|
||||
#define UPDATE_INTERVAL 500
|
||||
|
||||
@@ -49,13 +58,42 @@
|
||||
color[IWM_SYS] = new YColor(clrCpuSys);
|
||||
color[IWM_IDLE] = *clrCpuIdle
|
||||
? new YColor(clrCpuIdle) : NULL;
|
||||
-
|
||||
+#ifdef __FreeBSD__
|
||||
+ color[IWM_INTR] = new YColor(clrCpuIntr);
|
||||
+ for (unsigned int i = 0; i < taskBarCPUSamples; i++) {
|
||||
+ cpu[i][IWM_USER] = cpu[i][IWM_NICE] =
|
||||
+ cpu[i][IWM_SYS] = cpu[i][IWM_INTR] = 0;
|
||||
+ cpu[i][IWM_IDLE] = 1;
|
||||
+ }
|
||||
+ setSize(taskBarCPUSamples, 20);
|
||||
+ last_cpu[IWM_USER] = last_cpu[IWM_NICE] = last_cpu[IWM_SYS] =
|
||||
+ last_cpu[IWM_IDLE] = last_cpu[IWM_INTR] = 0;
|
||||
+ if( setegid( 2 ) == 0 ) {
|
||||
+ char errbuf[_POSIX2_LINE_MAX];
|
||||
+ kd = kvm_openfiles( NULL, NULL, NULL, O_RDONLY, errbuf );
|
||||
+ setegid( getgid() );
|
||||
+ if( kd == NULL )
|
||||
+ fprintf( stderr, "kvm_openfiles: %s\n", errbuf );
|
||||
+ else {
|
||||
+ memset( namelist, 0, sizeof(namelist) );
|
||||
+ namelist[0].n_name = (char*)("_cp_time");
|
||||
+ if( kvm_nlist( kd, namelist ) != 0 ) {
|
||||
+ kvm_close( kd );
|
||||
+ kd = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ fprintf( stderr, "can't setegid(2), I'm not a setgid exec ?\n" );
|
||||
+ kd = NULL;
|
||||
+ }
|
||||
+#else
|
||||
for (int i(0); i < taskBarCPUSamples; i++) {
|
||||
cpu[i][IWM_USER] = cpu[i][IWM_NICE] = cpu[i][IWM_SYS] = 0;
|
||||
cpu[i][IWM_IDLE] = 1;
|
||||
}
|
||||
setSize(taskBarCPUSamples, 20);
|
||||
last_cpu[IWM_USER] = last_cpu[IWM_NICE] = last_cpu[IWM_SYS] = last_cpu[IWM_IDLE] = 0;
|
||||
+#endif
|
||||
getStatus();
|
||||
updateStatus();
|
||||
updateToolTip();
|
||||
@@ -70,6 +108,13 @@
|
||||
delete color[IWM_NICE]; color[IWM_NICE] = 0;
|
||||
delete color[IWM_SYS]; color[IWM_SYS] = 0;
|
||||
delete color[IWM_IDLE]; color[IWM_IDLE] = 0;
|
||||
+#ifdef __FreeBSD__
|
||||
+ delete color[IWM_INTR]; color[IWM_INTR] = 0;
|
||||
+ if( kd != NULL ) {
|
||||
+ kvm_close( kd );
|
||||
+ kd = NULL;
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
|
||||
void CPUStatus::paint(Graphics &g, const YRect &/*r*/) {
|
||||
@@ -80,13 +125,34 @@
|
||||
int nice = cpu[i][IWM_NICE];
|
||||
int sys = cpu[i][IWM_SYS];
|
||||
int idle = cpu[i][IWM_IDLE];
|
||||
+#ifdef __FreeBSD__
|
||||
+ int intr = cpu[i][IWM_INTR];
|
||||
+ int total = user + sys + intr + nice + idle;
|
||||
+ int totald = total;
|
||||
+#else
|
||||
int total = user + sys + nice + idle;
|
||||
+#endif
|
||||
|
||||
int y = height() - 1;
|
||||
|
||||
if (total > 0) {
|
||||
+#ifdef __FreeBSD__
|
||||
+ if (intr) {
|
||||
+ totald -= intr;
|
||||
+ n = (h * totald) / total; // check rounding
|
||||
+ if (n >= y) n = y;
|
||||
+ g.setColor(color[IWM_INTR]);
|
||||
+ g.drawLine(i, y, i, n);
|
||||
+ y = n - 1;
|
||||
+ }
|
||||
+#endif
|
||||
if (sys) {
|
||||
+#ifdef __FreeBSD__
|
||||
+ totald -= nice;
|
||||
+ n = (h * totald)/ total;
|
||||
+#else
|
||||
n = (h * (total - sys)) / total; // check rounding
|
||||
+#endif
|
||||
if (n >= y) n = y;
|
||||
g.setColor(color[IWM_SYS]);
|
||||
g.drawLine(i, y, i, n);
|
||||
@@ -102,7 +168,12 @@
|
||||
}
|
||||
|
||||
if (user) {
|
||||
+#ifdef __FreeBSD__
|
||||
+ totald -= user;
|
||||
+ n = (h * totald)/ total;
|
||||
+#else
|
||||
n = (h * (total - sys - nice - user))/ total;
|
||||
+#endif
|
||||
if (n >= y) n = y;
|
||||
g.setColor(color[IWM_USER]);
|
||||
g.drawLine(i, y, i, n);
|
||||
@@ -152,6 +223,14 @@
|
||||
sprintf(load, _("CPU Load: %3.2f %3.2f %3.2f, %d processes."),
|
||||
l1, l5, l15, sys.procs);
|
||||
setToolTip(load);
|
||||
+#elif defined(__FreeBSD__)
|
||||
+ char load[31]; // enough for "CPU Load: 999.99 999.99 999.99\0"
|
||||
+ double loadavg[3];
|
||||
+ if( kd != NULL && kvm_getloadavg( kd, loadavg, 3 ) != 3 )
|
||||
+ return;
|
||||
+ snprintf(load, sizeof(load), "CPU Load: %3.2f %3.2f %3.2f",
|
||||
+ loadavg[0], loadavg[1], loadavg[2]);
|
||||
+ setToolTip(load);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -169,13 +248,43 @@
|
||||
cpu[i - 1][IWM_NICE] = cpu[i][IWM_NICE];
|
||||
cpu[i - 1][IWM_SYS] = cpu[i][IWM_SYS];
|
||||
cpu[i - 1][IWM_IDLE] = cpu[i][IWM_IDLE];
|
||||
+#ifdef __FreeBSD__
|
||||
+ cpu[i - 1][IWM_INTR] = cpu[i][IWM_INTR];
|
||||
+#endif
|
||||
}
|
||||
getStatus(),
|
||||
repaint();
|
||||
}
|
||||
|
||||
void CPUStatus::getStatus() {
|
||||
-#ifdef linux
|
||||
+#ifdef __FreeBSD__
|
||||
+
|
||||
+ cpu[taskBarCPUSamples-1][IWM_USER] = 0;
|
||||
+ cpu[taskBarCPUSamples-1][IWM_NICE] = 0;
|
||||
+ cpu[taskBarCPUSamples-1][IWM_SYS] = 0;
|
||||
+ cpu[taskBarCPUSamples-1][IWM_INTR] = 0;
|
||||
+ cpu[taskBarCPUSamples-1][IWM_IDLE] = 0;
|
||||
+
|
||||
+ if( kd == NULL ) return;
|
||||
+
|
||||
+ long cp_time[CPUSTATES];
|
||||
+ int c = sizeof( cp_time );
|
||||
+ if (kvm_read(kd, namelist[0].n_value, &cp_time, c) != c)
|
||||
+ return;
|
||||
+
|
||||
+ long cur[IWM_STATES];
|
||||
+ cur[IWM_USER] = cp_time[CP_USER];
|
||||
+ cur[IWM_NICE] = cp_time[CP_NICE];
|
||||
+ cur[IWM_SYS] = cp_time[CP_SYS];
|
||||
+ cur[IWM_INTR] = cp_time[CP_INTR];
|
||||
+ cur[IWM_IDLE] = cp_time[CP_IDLE];
|
||||
+
|
||||
+ for (int i = 0; i < IWM_STATES; i++) {
|
||||
+ cpu[taskBarCPUSamples-1][i] = cur[i] - last_cpu[i];
|
||||
+ last_cpu[i] = cur[i];
|
||||
+ }
|
||||
+
|
||||
+#elif defined(linux)
|
||||
char *p, buf[128];
|
||||
long cur[IWM_STATES];
|
||||
int len, fd = open("/proc/stat", O_RDONLY);
|
||||
@@ -209,8 +318,8 @@
|
||||
cpu[taskBarCPUSamples-1][IWM_USER], cpu[taskBarCPUSamples-1][IWM_NICE],
|
||||
cpu[taskBarCPUSamples-1][IWM_SYS], cpu[taskBarCPUSamples-1][IDLE]);
|
||||
#endif
|
||||
-#endif /* linux */
|
||||
-#ifdef HAVE_KSTAT_H
|
||||
+
|
||||
+#elif defined(HAVE_KSTAT_H)
|
||||
#ifdef HAVE_OLD_KSTAT
|
||||
#define ui32 ul
|
||||
#endif
|
||||
--- src/acpustatus.h.orig Sun Mar 9 04:37:52 2003
|
||||
+++ src/acpustatus.h Sun Apr 13 12:02:47 2003
|
||||
@@ -1,19 +1,29 @@
|
||||
#ifndef __CPUSTATUS_H
|
||||
#define __CPUSTATUS_H
|
||||
|
||||
-#if defined(linux) || defined(HAVE_KSTAT_H)
|
||||
+#if (defined(linux) || defined(HAVE_KSTAT_H)) || defined (__FreeBSD__)
|
||||
|
||||
#ifdef HAVE_KSTAT_H
|
||||
#include <kstat.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#endif /* have_kstat_h */
|
||||
|
||||
+#ifdef __FreeBSD__
|
||||
+#include <kvm.h>
|
||||
+#include <nlist.h>
|
||||
+#endif
|
||||
|
||||
#define IWM_USER (0)
|
||||
#define IWM_NICE (1)
|
||||
#define IWM_SYS (2)
|
||||
+#ifdef __FreeBSD__
|
||||
+#define IWM_INTR (3)
|
||||
+#define IWM_IDLE (4)
|
||||
+#define IWM_STATES (5)
|
||||
+#else
|
||||
#define IWM_IDLE (3)
|
||||
#define IWM_STATES (4)
|
||||
+#endif
|
||||
|
||||
#include "ywindow.h"
|
||||
#include "ytimer.h"
|
||||
@@ -38,6 +48,10 @@
|
||||
long last_cpu[IWM_STATES];
|
||||
YColor *color[IWM_STATES];
|
||||
YTimer *fUpdateTimer;
|
||||
+#ifdef __FreeBSD__
|
||||
+ struct nlist namelist[2];
|
||||
+ kvm_t *kd;
|
||||
+#endif
|
||||
};
|
||||
#else
|
||||
#undef CONFIG_APPLET_CPU_STATUS
|
||||
--- src/default.h.orig Thu May 16 14:00:02 2002
|
||||
+++ src/default.h Tue May 28 04:44:02 2002
|
||||
@@ -455,6 +455,7 @@
|
||||
XSV(const char *, clrLabelText, "rgb:00/00/00")
|
||||
XSV(const char *, clrCpuUser, "rgb:00/FF/00")
|
||||
XSV(const char *, clrCpuSys, "rgb:FF/00/00")
|
||||
+XSV(const char *, clrCpuIntr, "rgb:FF/FF/00")
|
||||
XSV(const char *, clrCpuNice, "rgb:00/00/FF")
|
||||
XSV(const char *, clrCpuIdle, "rgb:00/00/00")
|
||||
XSV(const char *, clrNetSend, "rgb:FF/FF/00")
|
||||
@@ -837,6 +838,7 @@
|
||||
#ifdef CONFIG_APPLET_CPU_STATUS
|
||||
OSV("ColorCPUStatusUser", &clrCpuUser, "User load on the CPU monitor"),
|
||||
OSV("ColorCPUStatusSystem", &clrCpuSys, "System load on the CPU monitor"),
|
||||
+ OSV("ColorCPUStatusInterrupts", &clrCpuIntr, "Interrupts on the CPU monitor"),
|
||||
OSV("ColorCPUStatusNice", &clrCpuNice, "Nice load on the CPU monitor"),
|
||||
OSV("ColorCPUStatusIdle", &clrCpuIdle, "Idle (non) load on the CPU monitor, leave empty to force transparency"),
|
||||
#endif
|
||||
--- src/wmapp.cc.orig Sun Mar 9 04:37:52 2003
|
||||
+++ src/wmapp.cc Sun Apr 13 00:09:19 2003
|
||||
@@ -1503,6 +1503,9 @@
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
+#ifdef __FreeBSD__
|
||||
+ setegid( getgid() );
|
||||
+#endif
|
||||
YLocale locale;
|
||||
|
||||
#ifndef NO_CONFIGURE
|
||||
--- src/wmclient.h.orig Tue Mar 26 14:29:05 2002
|
||||
+++ src/wmclient.h Tue Mar 26 14:29:13 2002
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "ymenu.h"
|
||||
#include "MwmUtil.h"
|
||||
|
||||
+#include <X11/Xutil.h>
|
||||
+
|
||||
class YFrameWindow;
|
||||
class WindowListItem;
|
||||
|
||||
@ -0,0 +1,124 @@
|
||||
## |
||||
## icewm.spec -- OpenPKG RPM Specification |
||||
## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/> |
||||
## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com> |
||||
## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/> |
||||
## |
||||
## Permission to use, copy, modify, and distribute this software for |
||||
## any purpose with or without fee is hereby granted, provided that |
||||
## the above copyright notice and this permission notice appear in all |
||||
## copies. |
||||
## |
||||
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
||||
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
||||
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
||||
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
||||
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
||||
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
||||
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
||||
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
||||
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
||||
## SUCH DAMAGE. |
||||
## |
||||
|
||||
# package information |
||||
Name: icewm |
||||
Summary: ICE Window Manager |
||||
URL: http://www.icewm.org/ |
||||
Vendor: M. Macek & M. Hasselmann |
||||
Packager: The OpenPKG Project |
||||
Distribution: OpenPKG [EVAL] |
||||
Group: X11 |
||||
License: GPL |
||||
Version: 1.2.9 |
||||
Release: 20030717 |
||||
|
||||
# package options |
||||
%option with_iconv no |
||||
%option with_shape no |
||||
%option with_xft no |
||||
|
||||
# list of sources |
||||
Source0: http://ftp1.sourceforge.net/icewm/icewm-%{version}.tar.gz |
||||
Patch0: icewm.patch |
||||
|
||||
# build information |
||||
Prefix: %{l_prefix} |
||||
BuildRoot: %{l_buildroot} |
||||
BuildPreReq: OpenPKG, openpkg >= 20030103, X11, imlib, gcc, make |
||||
PreReq: OpenPKG, openpkg >= 20030103, X11, imlib |
||||
%if "%{with_libiconv}" == "yes" |
||||
BuildPreReq: libiconv |
||||
PreReq: libiconv |
||||
%endif |
||||
AutoReq: no |
||||
AutoReqProv: no |
||||
|
||||
%description |
||||
IceWM is a window manager for the X11 Window System. The goal of |
||||
IceWM is speed, simplicity, and not getting in the user's way. |
||||
|
||||
%prep |
||||
%setup -q |
||||
%patch -p0 |
||||
|
||||
%build |
||||
case "%{l_target}" in |
||||
*-freebsd* ) libs="-lkvm" ;; |
||||
* ) libs="" ;; |
||||
esac |
||||
CC="%{l_cc}" \ |
||||
CXX="%{l_cxx}" \ |
||||
CFLAGS="%{l_cflags -O}" \ |
||||
CXXFLAGS="%{l_cxxflags -O}" \ |
||||
CPPFLAGS="%{l_cppflags}" \ |
||||
LDFLAGS="%{l_ldflags}" \ |
||||
LIBS="$libs" \ |
||||
./configure \ |
||||
--prefix=%{l_prefix} \ |
||||
--with-cfgdir=%{l_prefix}/etc/icewm \ |
||||
--with-libdir=%{l_prefix}/share/icewm \ |
||||
--with-imlib=%{l_prefix}/bin \ |
||||
%if "%{with_shape}" == "yes" |
||||
--enable-shape \ |
||||
--enable-shaped-decorations \ |
||||
%else |
||||
--disable-shape \ |
||||
--disable-shaped-decorations \ |
||||
%endif |
||||
%if "%{with_iconv}" == "yes" |
||||
--enable-i18n \ |
||||
%else |
||||
--disable-i18n \ |
||||
%endif |
||||
%if "%{with_xft}" == "yes" |
||||
--enable-xfreetype \ |
||||
--enable-gradients \ |
||||
--enable-antialiasing \ |
||||
%else |
||||
--disable-xfreetype \ |
||||
--disable-gradients \ |
||||
--disable-antialiasing \ |
||||
%endif |
||||
--disable-nls \ |
||||
--disable-xinerama |
||||
%{l_make} %{l_mflags -O} |
||||
|
||||
%install |
||||
rm -rf $RPM_BUILD_ROOT |
||||
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
||||
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
||||
case "%{l_target}" in |
||||
*-freebsd* ) attr="2755,%{l_musr},kmem" ;; |
||||
* ) attr="0755,%{l_musr},%{l_mgrp}" ;; |
||||
esac |
||||
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
||||
%{l_files_std} "%attr($attr) %{l_prefix}/bin/icewm" |
||||
|
||||
%files -f files |
||||
|
||||
%clean |
||||
rm -rf $RPM_BUILD_ROOT |
||||
|
||||
Loading…
Reference in new issue