Subject: pkg/33959: devel/elfsh update from 0.51 to 0.65rc1
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <pancake@phreaker.net>
List: pkgsrc-bugs
Date: 07/09/2006 18:35:00
>Number:         33959
>Category:       pkg
>Synopsis:       devel/elfsh is outdated
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 09 18:35:00 +0000 2006
>Originator:     pancake@phreaker.net
>Release:        Linux 2.6.15bare
>Organization:
	
>Environment:
	
	
System: Linux bare 2.6.15bare #7 PREEMPT Tue Mar 14 14:34:34 CET 2006 i686 GNU/Linux
Architecture: unknown
Machine: i686
>Description:
I've updated the elfsh package from 0.51 to 0.65, too many changes and fixups
has been done since the other release and seems that no more updates are
planned since this 0.65 release. (Aug 2005)

BTW I've fixed some building issues on NetBSD and fixed some minor stuff on
the Makefiles.

Tested on NetBSD and GNU/Linux.

>How-To-Repeat:
	
>Fix:
	

new files: patch-ad, patch-ae:

patch-ad:

--- configure.orig	2006-07-09 18:34:08.000000000 +0200
+++ configure	2006-07-09 18:34:28.000000000 +0200
@@ -228,7 +228,7 @@
 echo "RM      = rm -f "						>> Makefile
 echo "ETAGS   = etags "					        >> Makefile
 echo "CTAGS   = ctags "						>> Makefile
-echo "BASEPATH = \$(DESTDIR)/usr"				>> Makefile
+echo "BASEPATH = \$(PREFIX)"				>> Makefile
 echo "MODPATH = \$(BASEPATH)/share/elfsh/"			>> Makefile
 echo "BINPATH = \$(BASEPATH)/bin/"				>> Makefile
 echo "LIBPATH = \$(BASEPATH)/lib/"				>> Makefile
@@ -236,7 +236,7 @@
 echo "MANPATH = \$(BASEPATH)/share/man"				>> Makefile
 
 echo " "							>> Makefile
-echo "all     : world final modules tags"			>> Makefile
+echo "all     : world final modules "			>> Makefile
 echo " "							>> Makefile
 
 echo "world   : "						>> Makefile

patch-ae:
--- vm/Makefile.orig	2006-07-09 18:21:34.000000000 +0200
+++ vm/Makefile	2006-07-09 18:22:10.000000000 +0200
@@ -26,20 +26,19 @@
 
 
 
-CC			= gcc
 RM			= rm -f
 NAME			= elfsh
 DBGNAME			= e2dbg
 
-CFLAGS			= -fPIC -g3 -Wall -Iinclude $(DYNOPT) $(BUILDOP) \
+CFLAGS			+= -fPIC -Wall -Iinclude $(DYNOPT) $(BUILDOP) \
 			-I../libhash/include/ -I../libelfsh/include/ \
 			-I../libdump/include/ -I../libasm/include/ \
 			-DELFSH_INTERN $(STATOPT2) $(ASMOPT) $(READLNOPT) \
 			$(BITS)
 
-LDFLAGS			= -L../libelfsh/ -lelfsh -L../libhash/ -lhashelfsh \
+LDFLAGS			+= -L../libelfsh/ -lelfsh -L../libhash/ -lhashelfsh \
 			  -L../libdump/ -L/usr/pkg/lib/ -L../libasm/ -lasm \
-			-g3 $(LDASMOPT) $(LDREADLNOPT) $(DLOPT) $(DYNOPT) \
+			$(LDASMOPT) $(LDREADLNOPT) $(DLOPT) $(DYNOPT) \
 			$(BITS) $(EXTRAOPT) $(LDDUMPOPT)
 
 all		       	: $(OBJ) $(OBJ_STEP)


Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/elfsh/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- Makefile	18 Jun 2006 00:56:11 -0000	1.16
+++ Makefile	9 Jul 2006 17:20:14 -0000
@@ -1,10 +1,8 @@
 # $NetBSD: Makefile,v 1.16 2006/06/18 00:56:11 rillig Exp $
 #
 
-VERS=		0.51b3
-DISTNAME=	elfsh-${VERS}-portable
-PKGNAME=	elfsh-${VERS}
-PKGREVISION=	2
+VERS=		0.65rc1
+DISTNAME=	elfsh-${VERS}
 CATEGORIES=	devel
 MASTER_SITES=	http://elfsh.segfault.net/files/
 EXTRACT_SUFX=	.tgz
@@ -14,6 +12,8 @@
 COMMENT=	ELF format exploration shell
 
 WRKSRC=		${WRKDIR}/${PKGNAME_NOREV}
+HAS_CONFIGURE=	YES
+CONFIGURE_ARGS+= --enable-32 --enable-readline --enable-network
 
 USE_GNU_READLINE=	yes
 
@@ -30,12 +30,15 @@
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/vm/elfsh ${PREFIX}/bin/elfsh
-	${INSTALL_DATA} ${WRKSRC}/libelfsh/libelfsh.a ${PREFIX}/lib/libelfsh.a
-	${INSTALL_DATA} ${WRKSRC}/libelfsh/libelfsh.so ${PREFIX}/lib/libelfsh.so
+	${INSTALL_DATA} ${WRKSRC}/libelfsh/libelfsh.a ${PREFIX}/lib/
+	${INSTALL_DATA} ${WRKSRC}/libelfsh/libelfsh.so ${PREFIX}/lib/
+	${INSTALL_DATA_DIR} ${PREFIX}/include/libelfsh
 	${INSTALL_DATA} ${WRKSRC}/libelfsh/include/libelfsh.h ${PREFIX}/include/libelfsh.h
-	${INSTALL_DATA_DIR} ${PREFIX}/lib/elfsh
-	${INSTALL_DATA} ${WRKSRC}/modules/modremap.so ${PREFIX}/lib/elfsh
-	${INSTALL_DATA} ${WRKSRC}/modules/modtest.so ${PREFIX}/lib/elfsh
+	${INSTALL_DATA} ${WRKSRC}/libelfsh/include/libelfsh/* ${PREFIX}/include/libelfsh/
+	${INSTALL_DATA} ${WRKSRC}/libasm/include/libasm.h ${PREFIX}/include/
+	${INSTALL_DATA_DIR} ${PREFIX}/include/libasm/
+	${INSTALL_DATA} ${WRKSRC}/libasm/include/libasm-i386.h ${PREFIX}/include/libasm/
+	${INSTALL_MAN} ${WRKSRC}/doc/elfsh.1 ${PREFIX}/man/man1/
 	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/elfsh
 	${INSTALL_DATA} ${WRKSRC}/doc/elfsh-ref.txt ${PREFIX}/share/doc/elfsh/elfsh-ref.txt
 	${INSTALL_DATA} ${WRKSRC}/doc/libelfsh-ref.txt ${PREFIX}/share/doc/elfsh/libelfsh-ref.txt
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/devel/elfsh/PLIST,v
retrieving revision 1.4
diff -u -r1.4 PLIST
--- PLIST	23 Oct 2005 16:03:10 -0000	1.4
+++ PLIST	9 Jul 2006 17:20:14 -0000
@@ -1,11 +1,25 @@
-@comment $NetBSD: PLIST,v 1.4 2005/10/23 16:03:10 rillig Exp $
+@comment $NetBSD$
 bin/elfsh
+include/libasm.h
+include/libasm/libasm-i386.h
 include/libelfsh.h
-lib/elfsh/modremap.so
-lib/elfsh/modtest.so
+include/libelfsh/libelfsh-alpha.h
+include/libelfsh/libelfsh-bsd.h
+include/libelfsh/libelfsh-compat.h
+include/libelfsh/libelfsh-cray.h
+include/libelfsh/libelfsh-hppa.h
+include/libelfsh/libelfsh-ia32.h
+include/libelfsh/libelfsh-ia64.h
+include/libelfsh/libelfsh-internal.h
+include/libelfsh/libelfsh-mips.h
+include/libelfsh/libelfsh-ppc.h
+include/libelfsh/libelfsh-sparc.h
+include/libelfsh/libelfsh-sunos.h
 lib/libelfsh.a
 lib/libelfsh.so
+man/man1/elfsh.1
 share/doc/elfsh/elfsh-ref.txt
 share/doc/elfsh/libelfsh-ref.txt
 @dirrm share/doc/elfsh
-@dirrm lib/elfsh
+@dirrm include/libelfsh
+@dirrm include/libasm
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/devel/elfsh/distinfo,v
retrieving revision 1.4
diff -u -r1.4 distinfo
--- distinfo	23 Feb 2005 22:24:13 -0000	1.4
+++ distinfo	9 Jul 2006 17:20:14 -0000
@@ -1,8 +1,10 @@
 $NetBSD: distinfo,v 1.4 2005/02/23 22:24:13 agc Exp $
 
-SHA1 (elfsh-0.51b3-portable.tgz) = d8afc99cb2966710aa4b6a781ad9008bf0baaeb9
-RMD160 (elfsh-0.51b3-portable.tgz) = 278b2c846335d14953b27fa8946763622acb6303
-Size (elfsh-0.51b3-portable.tgz) = 136679 bytes
-SHA1 (patch-aa) = 0494158b7daf4d1b55984bf98c161bf70e114430
-SHA1 (patch-ab) = 4db74e87f1505e4bd0334060019944eccd9f5cd3
-SHA1 (patch-ac) = e60e109b4e2664619defc9a56616d1c7b7c3b35a
+SHA1 (elfsh-0.65rc1.tgz) = 5ad9a72a8dea73e2619098573b4515c63321d4de
+RMD160 (elfsh-0.65rc1.tgz) = b70f3a71d14413c35bd26c8a6cf25493c7751cbd
+Size (elfsh-0.65rc1.tgz) = 326670 bytes
+SHA1 (patch-aa) = 917a3654ad0e5128f48d096b97eb8f90f9fec15f
+SHA1 (patch-ab) = b267fdd96ce2b5b09e56be1c11f4d4d19855a2ac
+SHA1 (patch-ac) = 4a3f19d5c5553f210641d5abdd49b13a04b5eb8c
+SHA1 (patch-ad) = da1f5f84707d20cefd68b16014e0cd2e128fe888
+SHA1 (patch-ae) = add3ccd476314a00f2e5db70ab0ac8cf2b6ed7a4
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/devel/elfsh/patches/patch-aa,v
retrieving revision 1.2
diff -u -r1.2 patch-aa
--- patches/patch-aa	17 Feb 2004 12:45:56 -0000	1.2
+++ patches/patch-aa	9 Jul 2006 17:20:14 -0000
@@ -1,28 +1,11 @@
-$NetBSD: patch-aa,v 1.2 2004/02/17 12:45:56 cube Exp $
-
---- libelfsh/Makefile.orig	2003-08-21 03:11:03.000000000 +0200
-+++ libelfsh/Makefile
-@@ -5,10 +5,10 @@
- ## Last update Tue Jun  3 09:30:50 2003 mayhem
- ##
- 
--CC			= gcc
--RM			= rm -f 
--AR			= ar rc
--CFLAGS			= -rdynamic -Iinclude -Wall -fPIC -g3 -O2 -DELFSH_INTERN
-+# CC			= gcc
-+# RM			= rm -f 
-+# AR			= ar rc
-+CFLAGS			+= -rdynamic -Iinclude -Wall -fPIC -g3 -O2 -DELFSH_INTERN
- SRC			= dynamic.c dynsym.c elf.c fixup.c got.c hash.c \
-                         interp.c pht.c plt.c section.c sht.c error.c stab.c \
- 			symbol.c notes.c reloc.c blocks.c ctors.c dtors.c \
-@@ -22,7 +22,7 @@ RANLIB			= ranlib
- 
- all			: $(OBJ)
- 			@$(CC) -shared $(OBJ) -o $(NAME).so #-lasm
--			@$(AR) $(NAME).a $(OBJ)
-+			@$(AR) rc $(NAME).a $(OBJ)
- 			@$(RANLIB) $(NAME).a
- 
- clean			: 
+--- libelfsh/runtime.c.orig	2006-07-09 17:47:12.000000000 +0200
++++ libelfsh/runtime.c	2006-07-09 17:47:17.000000000 +0200
+@@ -47,7 +47,7 @@
+   addr = (elfsh_Addr) mmap((void *) 0, segment->p_memsz, 
+ 			   prot,
+ 			   //elfsh_get_segment_flags(segment), 
+-			   MAP_PRIVATE | MAP_ANONYMOUS, 
++			   MAP_PRIVATE | MAP_ANON, 
+ 			   0, 0);
+   
+   if (addr == 0 && segment->p_vaddr)
Index: patches/patch-ab
===================================================================
RCS file: /cvsroot/pkgsrc/devel/elfsh/patches/patch-ab,v
retrieving revision 1.2
diff -u -r1.2 patch-ab
--- patches/patch-ab	17 Feb 2004 12:45:56 -0000	1.2
+++ patches/patch-ab	9 Jul 2006 17:20:14 -0000
@@ -1,35 +1,12 @@
-$NetBSD: patch-ab,v 1.2 2004/02/17 12:45:56 cube Exp $
-
---- vm/Makefile.orig	2003-08-21 03:23:17.000000000 +0200
-+++ vm/Makefile
-@@ -19,8 +19,8 @@
- #LDASMOPT		= -lasm
- 
- # Uncommant that to use libreadline
--#READLNOPT		= -DUSE_READLN
--#LDREADLNOPT		= -lreadline -ltermcap
-+READLNOPT		= -DUSE_READLN
-+LDREADLNOPT		= -lreadline -ltermcap
- 
- 
- # End of configurable Makefile
-@@ -36,15 +36,15 @@ SRC			= grammar.c disasm.c dyn.c hdr.c m
- OBJ			= $(SRC:.c=.o)
- SRC_DYN			= elfsh_etdyn.c
- OBJ_DYN			= $(SRC_DYN:.c=.o)
--CC			= gcc
--RM			= rm -f
-+# CC			= gcc
-+# RM			= rm -f
- NAME			= elfsh
- 
--CFLAGS			= -rdynamic -fPIC -g3 -O2 -Wall -Iinclude \
-+CFLAGS			+= -rdynamic -fPIC -g3 -O2 -Wall -Iinclude \
- 			-I../libhash/include/ -I../libelfsh/include/ \
- 			-DELFSH_INTERN $(DLOPT) $(ASMOPT) $(READLNOPT)
- 
--LDFLAGS			= -L../libelfsh/ -lelfsh -L../libhash/ -lhashelfsh \
-+LDFLAGS			+= -L../libelfsh/ -lelfsh -L../libhash/ -lhashelfsh \
- 			-rdynamic -g3 $(LDASMOPT) $(LDREADLNOPT) $(DLOPT)\
- 			$(EXTRAOPT)
- 
+--- vm/opt.c.orig	2006-07-09 18:17:36.000000000 +0200
++++ vm/opt.c	2006-07-09 18:17:49.000000000 +0200
+@@ -138,8 +138,7 @@
+ 	  *off = 0;								
+ 	}									
+       
+-      if (regcomp(&cur->name, argv[idx + 1], REG_EXTENDED) < 0 ||
+-	  !cur->name.buffer)
++      if (regcomp(&cur->name, argv[idx + 1], REG_EXTENDED) < 0)
+ 	{
+ 	  vm_output("[elfsh:vm_add2list] Regular expression failed \n");
+ 	  return (-1);
Index: patches/patch-ac
===================================================================
RCS file: /cvsroot/pkgsrc/devel/elfsh/patches/patch-ac,v
retrieving revision 1.2
diff -u -r1.2 patch-ac
--- patches/patch-ac	17 Feb 2004 12:45:56 -0000	1.2
+++ patches/patch-ac	9 Jul 2006 17:20:14 -0000
@@ -1,17 +1,29 @@
-$NetBSD: patch-ac,v 1.2 2004/02/17 12:45:56 cube Exp $
-
---- vm/include/elfsh.h.orig	2003-08-21 03:11:02.000000000 +0200
-+++ vm/include/elfsh.h
-@@ -91,10 +91,10 @@
- #define	ELFSH_SPACE		' '
- #define	ELFSH_VERSION		"0.51b3"
- #define ELFSH_PROMPT		"[ELFsh-"ELFSH_VERSION"]$ "
--#define	ELFSH_SHELL		"/bin/bash"
-+#define	ELFSH_SHELL		"@@SH@@"
- #define	ELFSH_INIT		"elfsh_init"
- #define	ELFSH_FINI		"elfsh_fini"
--#define	ELFSH_MODPATH		"/usr/share/elfsh/"
-+#define	ELFSH_MODPATH		"@@PREFIX@@/lib/elfsh/"
+--- vm/dumpregs.c.orig	2006-07-09 19:14:20.000000000 +0200
++++ vm/dumpregs.c	2006-07-09 19:16:34.000000000 +0200
+@@ -31,6 +31,8 @@
+   E2DBG_PROFILE_IN(__FILE__, __FUNCTION__, __LINE__);
+   
+   vm_output(" .:: Registers ::. \n\n");
++
++#if __linux__
+   vm_dumpreg("EAX", e2dbgworld.context->uc_mcontext.gregs[REG_EAX]);
+   vm_dumpreg("EBX", e2dbgworld.context->uc_mcontext.gregs[REG_EBX]);
+   vm_dumpreg("ECX", e2dbgworld.context->uc_mcontext.gregs[REG_ECX]);
+@@ -40,6 +42,17 @@
+   vm_dumpreg("ESP", e2dbgworld.context->uc_mcontext.gregs[REG_ESP]);
+   vm_dumpreg("EBP", e2dbgworld.context->uc_mcontext.gregs[REG_EBP]);
+   vm_dumpreg("EIP", e2dbgworld.context->uc_mcontext.gregs[REG_EIP]);
++#else
++  vm_dumpreg("EAX", e2dbgworld.context->uc_mcontext.__gregs[_REG_EAX]);
++  vm_dumpreg("EBX", e2dbgworld.context->uc_mcontext.__gregs[_REG_EBX]);
++  vm_dumpreg("ECX", e2dbgworld.context->uc_mcontext.__gregs[_REG_ECX]);
++  vm_dumpreg("EDX", e2dbgworld.context->uc_mcontext.__gregs[_REG_EDX]);
++  vm_dumpreg("ESI", e2dbgworld.context->uc_mcontext.__gregs[_REG_ESI]);
++  vm_dumpreg("EDI", e2dbgworld.context->uc_mcontext.__gregs[_REG_EDI]);
++  vm_dumpreg("ESP", e2dbgworld.context->uc_mcontext.__gregs[_REG_ESP]);
++  vm_dumpreg("EBP", e2dbgworld.context->uc_mcontext.__gregs[_REG_EBP]);
++  vm_dumpreg("EIP", e2dbgworld.context->uc_mcontext.__gregs[_REG_EIP]);
++#endif
+   
+   printf("\n");
  
- /* For elfsh/elfsh/disasm.c:display_object() */
- #define	ELFSH_HEXA_VIEW		0

>Unformatted: