Subject: pkg/22907: Build/install fixes for sysutils/dog
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <jonathan@perkin.org.uk>
List: netbsd-bugs
Date: 09/23/2003 09:28:43
>Number:         22907
>Category:       pkg
>Synopsis:       Build/install fixes for sysutils/dog
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 23 09:29: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:
Builds of dog on Solaris are missing the usual socket libraries, as
well as getopt_long (which is already provided in the package, but
disabled).

Enable both, and fix the install target to use the standard macros,
along with some other cleanups.

Tested on SunOS-5.9/sparc and NetBSD-1.6ZC/sparc64
>How-To-Repeat:
===> Building for dog-1.7
/home/jonp/pkg/gcc-3.3/bin/gcc -O -c dog.c -o dog.o
/home/jonp/pkg/gcc-3.3/bin/gcc -O -o dog dog.o
Undefined                       first referenced
 symbol                             in file
socket                              dog.o
gethostbyname                       dog.o
accept                              dog.o
bind                                dog.o
getopt_long                         dog.o
listen                              dog.o
connect                             dog.o
ld: fatal: Symbol referencing errors. No output written to dog
collect2: ld returned 1 exit status
gmake: *** [dog] Error 1
*** Error code 2
>Fix:
http://www.perkin.org.uk/projects/netbsd/dog.diff

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/dog/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- Makefile	2003/07/17 22:53:28	1.5
+++ Makefile	2003/09/23 09:22:48
@@ -12,4 +12,11 @@
 USE_GMAKE=	yes
 ALL_TARGET=	dog
 
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "SunOS"
+LDFLAGS+=	-lsocket -lnsl
+MAKE_ENV+=	OBJS="getopt.o getopt1.o"
+.endif
+
 .include "../../mk/bsd.pkg.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/dog/distinfo,v
retrieving revision 1.2
diff -u -r1.2 distinfo
--- distinfo	2001/04/19 11:29:01	1.2
+++ distinfo	2003/09/23 09:22:48
@@ -2,4 +2,4 @@
 
 SHA1 (dog-1.7.tar.gz) = a1af9c76daa0c9768cdf0c31839b3004e6ccc417
 Size (dog-1.7.tar.gz) = 30433 bytes
-SHA1 (patch-aa) = c0dc5315d16950f3cc927074ea7b7536adac880c
+SHA1 (patch-aa) = d7fdbe2bfa5c6c69493f8b68802a45841869899f
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/dog/patches/patch-aa,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 patch-aa
--- patches/patch-aa	2001/01/19 01:35:05	1.1.1.1
+++ patches/patch-aa	2003/09/23 09:22:48
@@ -1,17 +1,16 @@
 $NetBSD: patch-aa,v 1.1.1.1 2001/01/19 01:35:05 hubertf Exp $
 
---- Makefile.orig	Tue Jul 13 20:32:24 1999
-+++ Makefile
-@@ -12,18 +12,20 @@
+--- Makefile.orig	Wed Jun 21 17:00:57 2000
++++ Makefile	Tue Sep 23 10:15:48 2003
+@@ -18,22 +18,23 @@
  #  dogboy@photodex.com!
  
  INSTALL = /usr/bin/install -c
 -OBJS = dog.o getopt.o getopt1.o
 -CFLAGS = -O3 -Wall
 +#HF#OBJS = dog.o getopt.o getopt1.o
-+OBJS = dog.o # NetBSD (and about any other Unix) has getopt in libc :-)
-+CC ?= cc
-+CFLAGS ?= -O -pipe
++OBJS += dog.o # NetBSD (and about any other Unix) has getopt in libc :-)
++#CFLAGS = -O3 -Wall
  
 -prefix = /usr/local
 +prefix = ${PREFIX}
@@ -24,7 +23,13 @@
  
  dog:	${OBJS}
 -	gcc ${CFLAGS} -o dog ${OBJS}
-+	$(CC) ${CFLAGS} -o dog ${OBJS}
++	$(CC) ${CFLAGS} -o dog ${OBJS} ${LDFLAGS}
  
  install:	dog
- 	$(INSTALL) -m 644 dog.1 ${mandir}/man1
+-	$(INSTALL) -m 644 dog.1 ${mandir}/man1
+-	$(INSTALL) -m 755 dog ${bindir}
++	$(BSD_INSTALL_MAN) dog.1 ${mandir}/man1/dog.1
++	$(BSD_INSTALL_PROGRAM) dog ${bindir}/dog
+ 
+ clean:
+ 	rm -f dog *.o *~
>Release-Note:
>Audit-Trail:
>Unformatted: