Subject: pkg/8125: netatalk package broken on ELF environment.
To: None <gnats-bugs@gnats.netbsd.org>
From: Takahiro Kambe <taca@sky.yamashina.kyoto.jp>
List: netbsd-bugs
Date: 07/31/1999 20:30:00
>Number:         8125
>Category:       pkg
>Synopsis:       netatalk package broken on ELF environment.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 31 20:20:00 1999
>Last-Modified:
>Originator:     Takahiro Kambe
>Organization:
>Release:        NetBSD-current 1999/7/31
>Environment:
	
System: NetBSD land.sky.yamashina.kyoto.jp 1.4I NetBSD 1.4I (LAND) #76: Sun Aug 1 10:30:26 JST 1999 taca@land.sky.yamashina.kyoto.jp:/usr/src/sys/arch/i386/compile/LAND i386


>Description:
	netatalk package broken on ELF environment.  Atalkd and afpd
	can't find the libatalk shared library.
>How-To-Repeat:
	After migrating ELF? environment, rebuild netatalk package and run it.
>Fix:
	Add -R${LOCALBASE}/lib to ld's option.  I have changed
	sys/netbsd/Makefile like bellow, and works fine.

$NetBSD: patch-ac,v 1.1.1.1 1998/12/26 22:09:27 agc Exp $

Pass ATALK_DESTDIR down, rather than DESTDIR, so we don't trigger DESTDIR
rules in <bsd.sys.mk> governing nostdinc and idirafter

--- sys/netbsd/Makefile.orig	Sun Sep 27 00:15:09 1998
+++ sys/netbsd/Makefile	Sun Aug  1 11:57:32 1999
@@ -1,9 +1,8 @@
 # NetBSD specific defines, passed to subdirectories.
 DEFS=	-DBSD4_4
-OPTOPTS=	-O2
 CC=	gcc -Werror -I../../sys/netbsd/
 INSTALL=	install
-ADDLIBS=	-lcrypt
+ADDLIBS=	-R${LOCALBASE}/lib -lcrypt
 
 ALL=	../../libatalk ../../include ../../bin ../../etc ../../man
 
@@ -16,12 +15,13 @@
 	    ADDLIBS="${ADDLIBS}" DEFS="${DEFS}" OPTOPTS="${OPTOPTS}" \
 	    SBINDIR="${SBINDIR}" BINDIR="${BINDIR}" RESDIR="${RESDIR}" \
 	    ETCDIR="${ETCDIR}" LIBDIR="${LIBDIR}" INCDIR="${INCDIR}" \
-	    DESTDIR="${DESTDIR}" AFSDIR="${AFSDIR}" KRBDIR="${KRBDIR}" all
+	    ATALK_DESTDIR="${ATALK_DESTDIR}" AFSDIR="${AFSDIR}" KRBDIR="${KRBDIR}" all
 
 FRC:
 
 install :
-	-mkdir ${DESTDIR} ${SBINDIR} ${BINDIR} ${ETCDIR} ${LIBDIR}
+	-mkdir ${ATALK_DESTDIR} ${SBINDIR} ${BINDIR} ${ETCDIR}
+	-mkdir ${LIBDIR} ${LIBEXECDIR} ${RESDIR}
 	for i in ${ALL}; \
 	    do (cd $$i; ${MAKE} ${MFLAGS} CC="${CC}" \
 		ADDLIBS="${ADDLIBS}" DEFS="${DEFS}" OPTOPTS="${OPTOPTS}" \
@@ -31,7 +31,7 @@
 		INSTALL="${INSTALL}" $@); \
 	done
 	rm -f ${ETCDIR}/rc.atalk
-	sed -e s@:DESTDIR:@${DESTDIR}@ -e s@:SBINDIR:@${SBINDIR}@ \
+	sed -e s@:DESTDIR:@${ATALK_DESTDIR}@ -e s@:SBINDIR:@${SBINDIR}@ \
 		-e s@:BINDIR:@${BINDIR}@ -e s@:RESDIR:@${RESDIR}@ \
 		-e s@:ETCDIR:@${ETCDIR}@ -e s@:LIBDIR:@${LIBDIR}@ \
 		-e s@:INCDIR:@${INCDIR}@ \
>Audit-Trail:
>Unformatted: