Subject: pkg/22858: Fix benchmarks/dbench on SunOS
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <jonathan@perkin.org.uk>
List: netbsd-bugs
Date: 09/19/2003 15:27:13
>Number:         22858
>Category:       pkg
>Synopsis:       Fix benchmarks/dbench on SunOS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 19 15:28: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:
dbench requires (the usual) extra libraries on Solaris.

While we're here, remove assumption on gcc, and move WRKSRC around
to appease pkglint.
>How-To-Repeat:

>Fix:
http://www.perkin.org.uk/projects/netbsd/dbench.diff

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/benchmarks/dbench/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile	2003/07/17 21:24:38	1.2
+++ Makefile	2003/09/19 15:23:33
@@ -2,6 +2,7 @@
 #
 
 DISTNAME=	dbench-1.3
+WRKSRC=		${WRKDIR}/dbench
 CATEGORIES=	benchmarks
 MASTER_SITES=	ftp://dnuc.polyn.kiae.su/pub/dbench/
 
@@ -9,7 +10,11 @@
 HOMEPAGE=	http://samba.org/ftp/tridge/dbench/README
 COMMENT=	Simulation of the Ziff-Davis netbench benchmark
 
-WRKSRC=		${WRKDIR}/dbench
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "SunOS"
+MAKE_ENV+=	DB_LDFLAGS="-lrt" TB_LDFLAGS="-lsocket -lnsl"
+.endif
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/dbench ${PREFIX}/bin/dbench
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/benchmarks/dbench/distinfo,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 distinfo
--- distinfo	2003/07/17 15:11:44	1.1.1.1
+++ distinfo	2003/09/19 15:23:33
@@ -3,4 +3,4 @@
 SHA1 (dbench-1.3.tar.gz) = b46f72ac0a81acf7a0f368e20e5d83ee3932a35a
 Size (dbench-1.3.tar.gz) = 266746 bytes
 SHA1 (patch-aa) = 1c34848d3ce3294a1ae228243ff6fcae8a874826
-SHA1 (patch-ab) = 3d0d79e1542368d63534b994cb96fb0602acca24
+SHA1 (patch-ab) = 63d2fd91fcd1e282179ba10c9d6ae06e89f6b945
Index: patches/patch-ab
===================================================================
RCS file: /cvsroot/pkgsrc/benchmarks/dbench/patches/patch-ab,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 patch-ab
--- patches/patch-ab	2003/07/17 15:11:44	1.1.1.1
+++ patches/patch-ab	2003/09/19 15:23:33
@@ -1,13 +1,33 @@
 $NetBSD: patch-ab,v 1.1.1.1 2003/07/17 15:11:44 agc Exp $
 
---- Makefile	2003/07/17 14:51:51	1.1
-+++ Makefile	2003/07/17 14:52:17
-@@ -2,7 +2,7 @@
+--- Makefile.orig	Mon Sep 10 05:21:01 2001
++++ Makefile	Fri Sep 19 16:06:02 2003
+@@ -1,8 +1,8 @@
+ VERSION = 1.2.01
  
- CC = gcc
- CFLAGS = -O2 -Wall 
+-CC = gcc
+-CFLAGS = -O2 -Wall 
 -CPPFLAGS = "-DVERSION=\"$(VERSION)\""
++#CC = gcc
++#CFLAGS = -O2 -Wall 
 +CPPFLAGS = "-DVERSION=\"$(VERSION)\"" -DPREFIX='"${PREFIX}"'
  
  DB_OBJS = fileio.o util.o dbench.o child.o
  TB_OBJS = sockio.o util.o dbench.o child.o socklib.o
+@@ -11,13 +11,13 @@
+ all: dbench tbench tbench_srv
+ 
+ dbench: $(DB_OBJS)
+-	$(CC) -o $@ $(DB_OBJS)
++	$(CC) -o $@ $(DB_OBJS) $(DB_LDFLAGS)
+ 
+ tbench: $(TB_OBJS)
+-	$(CC) -o $@ $(TB_OBJS)
++	$(CC) -o $@ $(TB_OBJS) $(TB_LDFLAGS)
+ 
+ tbench_srv: $(SRV_OBJS)
+-	$(CC) -o $@ $(SRV_OBJS)
++	$(CC) -o $@ $(SRV_OBJS) $(TB_LDFLAGS)
+ 
+ clean:
+ 	rm -f *.o *~ dbench tbench tbench_srv
>Release-Note:
>Audit-Trail:
>Unformatted: