diff options
author | rillig <rillig@pkgsrc.org> | 2007-11-30 19:32:55 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2007-11-30 19:32:55 +0000 |
commit | 7b57bb3b2c84f971aecf7096543e18e6a5d1b3f0 (patch) | |
tree | 221fa3021018f64f609d6cad1a28fe92009e7106 /sysutils | |
parent | 976310a3bc2d8861927e3e4f692d3f4b90e7e619 (diff) | |
download | pkgsrc-7b57bb3b2c84f971aecf7096543e18e6a5d1b3f0.tar.gz |
Allow xosview to be installed by unprivileged users, especially on BSD
systems.
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/xosview/Makefile | 9 | ||||
-rw-r--r-- | sysutils/xosview/distinfo | 4 | ||||
-rw-r--r-- | sysutils/xosview/patches/patch-aa | 44 |
3 files changed, 45 insertions, 12 deletions
diff --git a/sysutils/xosview/Makefile b/sysutils/xosview/Makefile index 4860d348583..f98062f0d95 100644 --- a/sysutils/xosview/Makefile +++ b/sysutils/xosview/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.64 2007/09/29 12:04:39 obache Exp $ +# $NetBSD: Makefile,v 1.65 2007/11/30 19:32:55 rillig Exp $ DISTNAME= xosview-1.8.3 PKGREVISION= 1 @@ -38,6 +38,13 @@ LIBS+= -lsocket -lnsl USE_TOOLS+= gmake .endif +.if ${UNPRIVILEGED:M[Yy][Ee][Ss]} != "" +SUBST_CLASSES+= unpriv +SUBST_STAGE.unpriv= pre-configure +SUBST_FILES.unpriv= config/Makefile.top.in +SUBST_SED.unpriv= -e s,@INSTALL_ARGS@,, +.endif + SUBST_CLASSES+= paths SUBST_STAGE.paths= post-configure SUBST_MESSAGE.paths= Fixing manpage path. diff --git a/sysutils/xosview/distinfo b/sysutils/xosview/distinfo index e13f8167b47..c904cfbdd2c 100644 --- a/sysutils/xosview/distinfo +++ b/sysutils/xosview/distinfo @@ -1,9 +1,9 @@ -$NetBSD: distinfo,v 1.21 2007/04/15 08:13:50 veego Exp $ +$NetBSD: distinfo,v 1.22 2007/11/30 19:32:55 rillig Exp $ SHA1 (xosview-1.8.3.tar.gz) = 420fd0620ff9fb9ba83fc833eeb8b872414e377e RMD160 (xosview-1.8.3.tar.gz) = 595e812dee686ccaa5d95eb537782679d752271b Size (xosview-1.8.3.tar.gz) = 259793 bytes -SHA1 (patch-aa) = 48445a5e52cbcaec4147f25d3d758af207350d61 +SHA1 (patch-aa) = 85d392004017e7dfe79262b3e7fcacfd8499b8a2 SHA1 (patch-ab) = 274b83fd3488af8e0c4ce0184b8c78f4f6ef87df SHA1 (patch-ac) = 3e9073c4ccd7e08d29a76b08f2ed0c7f9f9d9ede SHA1 (patch-ad) = 02ae8395e200e5cbf8d6339eced33fe5aa421d38 diff --git a/sysutils/xosview/patches/patch-aa b/sysutils/xosview/patches/patch-aa index 1e309099929..39113dcb1f0 100644 --- a/sysutils/xosview/patches/patch-aa +++ b/sysutils/xosview/patches/patch-aa @@ -1,7 +1,7 @@ -$NetBSD: patch-aa,v 1.17 2007/04/15 08:12:36 veego Exp $ +$NetBSD: patch-aa,v 1.18 2007/11/30 19:32:56 rillig Exp $ --- bsd/kernel.cc.orig 2006-02-18 08:36:06.000000000 +0100 -+++ bsd/kernel.cc 2007-04-14 21:34:03.000000000 +0200 ++++ bsd/kernel.cc 2007-10-11 01:53:02.000000000 +0200 @@ -115,8 +115,16 @@ // in __NetBSD_Version__ for us if needed. #if defined(XOSVIEW_NETBSD) && defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106010000) @@ -19,7 +19,33 @@ $NetBSD: patch-aa,v 1.17 2007/04/15 08:12:36 veego Exp $ #include "general.h" #include "kernel.h" /* To grab CVSID stuff. */ -@@ -400,6 +408,8 @@ +@@ -303,9 +311,11 @@ + + void + OpenKDIfNeeded() { ++ static int initialized = 0; + char unusederrorstring[_POSIX2_LINE_MAX]; + +- if (kd) return; // kd is non-NULL, so it has been initialized. BCG ++ if (initialized) return; ++ initialized = 1; + + /* Open it read-only, for a little added safety. */ + /* If the first character of kernelFileName is not '\0', then use +@@ -313,8 +323,10 @@ + specifying NULL. */ + if ((kd = kvm_openfiles ((kernelFileName[0]) ? kernelFileName : NULL, + NULL, NULL, O_RDONLY, unusederrorstring)) +- == NULL) +- err (-1, "OpenKDIfNeeded():kvm-open()"); ++ == NULL) { ++ warn ("OpenKDIfNeeded():kvm-open()"); ++ return; ++ } + // Parenthetical note: FreeBSD kvm_openfiles() uses getbootfile() to get + // the correct kernel file if the 1st arg is NULL. As far as I can see, + // one should always use NULL in FreeBSD, but I suppose control is never a +@@ -400,6 +412,8 @@ static int mib[] = { CTL_KERN, KERN_CPUSTATS }; #endif #if defined(XOSVIEW_NETBSD) && (__NetBSD_Version__ >= 104260000) @@ -28,7 +54,7 @@ $NetBSD: patch-aa,v 1.17 2007/04/15 08:12:36 veego Exp $ static int mib[] = { CTL_KERN, KERN_CP_TIME }; #endif -@@ -407,14 +417,11 @@ +@@ -407,14 +421,11 @@ if (CPUSTATES != 5) errx (-1, "Error: xosview for *BSD expects 5 cpu states!\n"); #if defined(__NetBSD_Version__) && __NetBSD_Version__ > 104260000 /* > 1.4Z */ @@ -47,7 +73,7 @@ $NetBSD: patch-aa,v 1.17 2007/04/15 08:12:36 veego Exp $ #else #ifdef XOSVIEW_BSDI if (sysctl(mib, 2, &cpu, &size, NULL, 0) < 0) { -@@ -441,7 +448,7 @@ +@@ -441,7 +452,7 @@ } void @@ -56,7 +82,7 @@ $NetBSD: patch-aa,v 1.17 2007/04/15 08:12:36 veego Exp $ struct ifnet * ifnetp; -@@ -466,7 +473,8 @@ +@@ -466,7 +477,8 @@ while (ifnetp) { // Now, dereference the pointer to get the ifnet struct. safe_kvm_read ((u_long) ifnetp, &ifnet, sizeof(ifnet)); @@ -66,7 +92,7 @@ $NetBSD: patch-aa,v 1.17 2007/04/15 08:12:36 veego Exp $ char ifname[256]; #ifdef NETBSD_OLD_IFACE // In pre-1.2A, getting the interface name was more complicated. -@@ -476,15 +484,21 @@ +@@ -476,15 +488,21 @@ safe_kvm_read ((u_long) (((char*)ifnetp) + (&ifnet.if_xname[0] - (char*)&ifnet)), ifname, 256); snprintf (ifname, 256, "%s", ifname); #endif @@ -89,7 +115,7 @@ $NetBSD: patch-aa,v 1.17 2007/04/15 08:12:36 veego Exp $ // Linked-list step taken from if.c in netstat source, line 120. #ifdef XOSVIEW_FREEBSD #if (__FreeBSD_version >= 300000) -@@ -773,13 +787,12 @@ +@@ -773,13 +791,12 @@ #ifdef NETBSD_1_6A // Do a sysctl with a NULL data pointer to get the size that would // have been returned, and use that to figure out # drives. @@ -105,7 +131,7 @@ $NetBSD: patch-aa,v 1.17 2007/04/15 08:12:36 veego Exp $ return 1; #endif return ValidSymbol(DISKLIST_SYM_INDEX); -@@ -816,19 +829,29 @@ +@@ -816,19 +833,29 @@ #else #if defined(NETBSD_1_6A) // Use the new sysctl to do this for us. |