Subject: pkg/22903: Port sysutils/tload to non-NetBSD targets
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <jonathan@perkin.org.uk>
List: netbsd-bugs
Date: 09/23/2003 08:14:18
>Number:         22903
>Category:       pkg
>Synopsis:       Port sysutils/tload to non-NetBSD targets
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 23 08:15:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jonathan Perkin
>Release:        N/A
>Organization:
British Broadcasting Corporation
>Environment:
SunOS build1 5.9 Generic_112233-01 sun4u sparc SUNW,UltraSPARC-IIi-cEngine
>Description:
Nice simple patch which gets tload running on non-NetBSD pkgsrc hosts.

This could probably do with a check on a Linux host if possible, and
there may be some pkgsrc systems (IRIX? Darwin?) which may possibly
lack getloadavg().  This gets it building on *BSD and Solaris at least,
though, rather than just NetBSD.
>How-To-Repeat:
===> Building for tload-2.0.6nb1
cd /tmp/pkgsrc/sysutils/tload/work.build1/procps-2.0.6 ;  /home/jonp/pkg/gcc-3.3/bin/gcc -O tload.c -o tload
Undefined                       first referenced
 symbol                             in file
loadavg                             /var/tmp//ccubn3uA.o
display_version                     /var/tmp//ccubn3uA.o
ld: fatal: Symbol referencing errors. No output written to tload
collect2: ld returned 1 exit status
*** Error code 1
>Fix:
http://www.perkin.org.uk/projects/netbsd/tload.diff

Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/tload/distinfo,v
retrieving revision 1.3
diff -u -r1.3 distinfo
--- distinfo	2001/05/22 02:59:25	1.3
+++ distinfo	2003/09/23 08:12:16
@@ -2,4 +2,4 @@
 
 SHA1 (procps-2.0.6.tar.gz) = 8006cbc096922c53d340cdfe1e8dd9504cd2e203
 Size (procps-2.0.6.tar.gz) = 188674 bytes
-SHA1 (patch-aa) = 955d3d9d425a7264cb1a5aea450694a3634a136c
+SHA1 (patch-aa) = bad2c06427292e4c4ff6276d451de34f2ce5a6ca
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/tload/patches/patch-aa,v
retrieving revision 1.2
diff -u -r1.2 patch-aa
--- patches/patch-aa	2001/05/22 02:59:25	1.2
+++ patches/patch-aa	2003/09/23 08:12:16
@@ -6,11 +6,11 @@
  extern int optind;
  extern char *optarg;
  
-+#ifdef __NetBSD__
++#ifndef linux
 +void
 +display_version(void)
 +{
-+	printf("procps 2.0.6, NetBSD port\n");
++	printf("procps 2.0.6, pkgsrc port\n");
 +}
 +
 +
>Release-Note:
>Audit-Trail:
>Unformatted: