pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/37127 (ElectricFence fails on Linux)



> Synopsis: ElectricFence fails on Linux

See attached file

- update from encient version to the latest one (according to its home page).
- tested under NetBSD-4/x86 and Linux/x86 - both works (not only built) fine.
- libtoolized, i.e. efence can be used with LD_PRELOAD or analog
  without recompiling and relinking.

? update.patch
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/electricfence/Makefile,v
retrieving revision 1.13
diff -u -r1.13 Makefile
--- Makefile    3 Mar 2008 17:45:35 -0000       1.13
+++ Makefile    28 Nov 2008 22:53:41 -0000
@@ -1,15 +1,19 @@
 # $NetBSD: Makefile,v 1.13 2008/03/03 17:45:35 jlam Exp $
 
-DISTNAME=              ElectricFence-2.1
-PKGREVISION=           1
+DISTNAME=              electric-fence_2.1.13-0.1
+PKGNAME=               ElectricFence_2.1.13.0.1
 CATEGORIES=            devel
-MASTER_SITES=          ftp://ftp.perens.com/pub/ElectricFence/
+MASTER_SITES=          http://perens.com/works/software/ElectricFence/
 
 MAINTAINER=            pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=              http://www.perens.com/FreeSoftware/
 COMMENT=               Different kind of malloc() debugger
 
 PKG_DESTDIR_SUPPORT=   user-destdir
+USE_LIBTOOL=           yes
+WRKSRC=                        ${WRKDIR}/${DISTNAME:C/-0.1//1:C/_/-/1}
+
+MAKE_FLAGS+=           INSTALL_MAN=${INSTALL_MAN:Q}
 
 .include "../../mk/bsd.prefs.mk"
 
@@ -21,9 +25,7 @@
 
 INSTALLATION_DIRS=     lib ${PKGMANDIR}/man3
 
-do-install:
-       ${INSTALL_DATA} ${WRKSRC}/libefence.a ${DESTDIR}${PREFIX}/lib
-       ${INSTALL_MAN} ${WRKSRC}/libefence.3 \
-               ${DESTDIR}${PREFIX}/${PKGMANDIR}/man3
+PTHREAD_AUTO_VARS=     yes
 
+.include "../../mk/pthread.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/devel/electricfence/PLIST,v
retrieving revision 1.1
diff -u -r1.1 PLIST
--- PLIST       1 Nov 2001 01:23:21 -0000       1.1
+++ PLIST       28 Nov 2008 22:53:41 -0000
@@ -1,3 +1,3 @@
 @comment $NetBSD: PLIST,v 1.1 2001/11/01 01:23:21 zuntum Exp $
-lib/libefence.a
+lib/libefence.la
 man/man3/libefence.3
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/devel/electricfence/distinfo,v
retrieving revision 1.9
diff -u -r1.9 distinfo
--- distinfo    8 Jan 2006 20:25:34 -0000       1.9
+++ distinfo    28 Nov 2008 22:53:41 -0000
@@ -1,9 +1,7 @@
 $NetBSD: distinfo,v 1.9 2006/01/08 20:25:34 joerg Exp $
 
-SHA1 (ElectricFence-2.1.tar.gz) = 1794db6d446f31045ebf845543cf6759cbab1e4f
-RMD160 (ElectricFence-2.1.tar.gz) = 4513b43b2c9b4212822c2b2d749b6485909d8f67
-Size (ElectricFence-2.1.tar.gz) = 47917 bytes
-SHA1 (patch-aa) = 53c7c23d6d0a5b4f9814125bce8d6280f474fd56
-SHA1 (patch-ab) = 54c2dca3c58f430fd2ffe3a59ddfd6d89fc4bbda
-SHA1 (patch-ac) = 4c56eeea0b8e53cdf260b61aa8fdef16f601b186
-SHA1 (patch-ad) = 28cb084b2cbf6ecb6ec38c9ba11237fd2204aa92
+SHA1 (electric-fence_2.1.13-0.1.tar.gz) = 
e6765bcb1543272040b806eea706fc7ae9b60524
+RMD160 (electric-fence_2.1.13-0.1.tar.gz) = 
75e41de7bef263007f24a1053528959f9f7fe1fa
+Size (electric-fence_2.1.13-0.1.tar.gz) = 29991 bytes
+SHA1 (patch-aa) = 9b2f1720a92c805d8d4b36631317493124c2f2d7
+SHA1 (patch-ab) = 64c503ce8d2ea9b55432d59a187e644af38e257b
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/devel/electricfence/patches/patch-aa,v
retrieving revision 1.4
diff -u -r1.4 patch-aa
--- patches/patch-aa    4 Feb 2004 13:33:36 -0000       1.4
+++ patches/patch-aa    28 Nov 2008 22:53:41 -0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-aa,v 1.4 2004/02/04 13:33:36 grant Exp $
+$NetBSD$
 
---- Makefile.orig      1998-03-13 06:52:19.000000000 +1100
+--- Makefile.orig      2002-02-19 23:51:44.000000000 +0200
 +++ Makefile
-@@ -1,12 +1,12 @@
+@@ -1,12 +1,14 @@
 -ASFLAGS= -mips2
 -CC= cc
 -AR= ar
@@ -19,8 +19,67 @@
 +#MV= mv
 +#CHMOD= chmod
 +#CFLAGS= -g
-+#LIB_INSTALL_DIR= /usr/lib
-+#MAN_INSTALL_DIR= /usr/man/man3
++LIB_INSTALL_DIR=      ${PREFIX}/lib
++MAN_INSTALL_DIR=      ${PREFIX}/${PKGMANDIR}/man3
++SO_VER=                       0:0
++LIBTOOL=              libtool
  
  PACKAGE_SOURCE= README libefence.3 Makefile efence.h \
        efence.c page.c print.c eftest.c tstheap.c CHANGES COPYING
+@@ -26,9 +28,9 @@ PACKAGE_SOURCE= README libefence.3 Makef
+ # as well if using Sun's compiler, -static if using GCC.
+ # CFLAGS= -g -Bstatic -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS
+ 
+-OBJECTS= efence.o page.o print.o
++OBJECTS= efence.lo page.lo print.lo
+ 
+-all:  libefence.a tstheap eftest
++all:  libefence.la tstheap eftest
+       @ echo
+       @ echo "Testing Electric Fence."
+       @ echo "After the last test, it should print that the test has PASSED."
+@@ -38,11 +40,9 @@ all:        libefence.a tstheap eftest
+       @ echo "Electric Fence confidence test PASSED." 
+       @ echo
+ 
+-install: libefence.a libefence.3
+-      $(MV) libefence.a $(LIB_INSTALL_DIR)
+-      $(CHMOD) 644 $(LIB_INSTALL_DIR)/libefence.a
+-      $(INSTALL) libefence.3 $(MAN_INSTALL_DIR)/libefence.3
+-      $(CHMOD) 644 $(MAN_INSTALL_DIR)/libefence.3
++install: libefence.la libefence.3
++      $(LIBTOOL) --mode=install $(INSTALL) -c libefence.la 
$(DESTDIR)${LIB_INSTALL_DIR}
++      $(INSTALL_MAN) libefence.3 ${DESTDIR}$(MAN_INSTALL_DIR)/libefence.3
+ 
+ clean:
+       - rm -f $(OBJECTS) tstheap.o eftest.o tstheap eftest libefence.a \
+@@ -57,16 +57,22 @@ ElectricFence.shar: $(PACKAGE_SOURCE)
+ 
+ shar: ElectricFence.shar
+ 
+-libefence.a: $(OBJECTS)
+-      - rm -f libefence.a
+-      $(AR) crv libefence.a $(OBJECTS)
++libefence.la: $(OBJECTS)
++      $(LIBTOOL) --tag=CC --mode=link ${CC} -o libefence.la \
++              ${OBJECTS} ${LDFLAGS} ${LIBS} \
++              -rpath ${LIB_INSTALL_DIR} -version-info ${SO_VER}
+ 
+-tstheap: libefence.a tstheap.o
++tstheap: libefence.la tstheap.o
+       - rm -f tstheap
+-      $(CC) $(CFLAGS) tstheap.o libefence.a -o tstheap -lpthread
++      $(CC) $(CFLAGS) tstheap.o .libs/libefence.a -o tstheap -lpthread
+ 
+-eftest: libefence.a eftest.o
++eftest: libefence.la eftest.o
+       - rm -f eftest
+-      $(CC) $(CFLAGS) eftest.o libefence.a -o eftest -lpthread
++      $(CC) $(CFLAGS) eftest.o .libs/libefence.a -o eftest -lpthread
+ 
+ $(OBJECTS) tstheap.o eftest.o: efence.h
++
++.SUFFIXES: .lo
++.c.lo:
++      $(LIBTOOL) --tag=CC --mode=compile $(CC) -o ${.TARGET} \
++              -c ${CPPFLAGS} ${CFLAGS} ${.IMPSRC}
Index: patches/patch-ab
===================================================================
RCS file: /cvsroot/pkgsrc/devel/electricfence/patches/patch-ab,v
retrieving revision 1.5
diff -u -r1.5 patch-ab
--- patches/patch-ab    8 Nov 2005 03:27:32 -0000       1.5
+++ patches/patch-ab    28 Nov 2008 22:53:41 -0000
@@ -1,48 +1,28 @@
-$NetBSD: patch-ab,v 1.5 2005/11/08 03:27:32 tv Exp $
+$NetBSD$
 
---- page.c.orig        1996-04-26 18:57:38.000000000 -0400
+--- page.c.orig        2001-04-11 17:44:04.000000000 +0300
 +++ page.c
-@@ -3,6 +3,7 @@
- #include <unistd.h>
- #include <fcntl.h>
- #include <sys/mman.h>
-+#include <sys/param.h>
- #include <stdio.h>
- #include <errno.h>
- #include <string.h>
-@@ -29,7 +30,7 @@
+@@ -29,7 +29,7 @@
  
  static caddr_t        startAddr = (caddr_t) 0;
  
 -#if ( !defined(sgi) && !defined(_AIX) )
-+#if ( !defined(sgi) && !defined(_AIX) && !(defined(BSD) && BSD >= 199306)) && 
!defined(linux) && !defined(__INTERIX)
++#if ( !defined(sgi) && !defined(_AIX) && !(defined(BSD) && BSD >= 199306) && 
!defined(linux) && !defined(__INTERIX) )
  extern int    sys_nerr;
- extern char * sys_errlist[];
+ /*extern char *       sys_errlist[];*/
  #endif
-@@ -39,7 +40,7 @@ stringErrorReport(void)
+@@ -39,13 +39,8 @@ stringErrorReport(void)
  {
  #if ( defined(sgi) )
        return strerror(oserror());
 -#elif ( defined(_AIX) )
-+#elif ( defined(_AIX) || defined(__INTERIX) )
-       return strerror(errno);
+-      return strerror(errno);
  #else
-       if ( errno > 0 && errno < sys_nerr )
-@@ -70,7 +71,7 @@ Page_Create(size_t size)
-        */
-       allocation = (caddr_t) mmap(
-        startAddr
--      ,(int)size
-+      ,size
-       ,PROT_READ|PROT_WRITE
-       ,MAP_PRIVATE|MAP_ANONYMOUS
-       ,-1
-@@ -122,7 +123,7 @@ Page_Create(size_t size)
-        */
-       allocation = (caddr_t) mmap(
-        startAddr
--      ,(int)size
-+      ,size
-       ,PROT_READ|PROT_WRITE
-       ,MAP_PRIVATE
-       ,devZeroFd
+-      if ( errno > 0 && errno < sys_nerr )
+-              return sys_errlist[errno];
+-      else
+-              return "Unknown error.\n";
++      return strerror(errno);
+ #endif
+ }
+ 
-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index