Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Jun 2006 08:29:50 +0200 (CEST)
From:      <pfgshield-freebsd@yahoo.com>
To:        FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/95179: devel/ptmalloc doesn't include a header
Message-ID:  <20060604062950.33986.qmail@web32708.mail.mud.yahoo.com>
In-Reply-To: <200604010000.k3100Vv2088403@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
While reviewing this port I ended up updating it to version 2 (version 3 is
under development).  I tried to portlint it a bit so I moved the COPYRIGHT to
pkg-message. This package is, fortunately, not GPL'd so updating it is a good
idea compared to providing another port.
____________

diff -ruN ptmalloc.orig/Makefile ptmalloc/Makefile
--- ptmalloc.orig/Makefile	Sun Jun  4 00:12:33 2006
+++ ptmalloc/Makefile	Sun Jun  4 01:17:04 2006
@@ -5,19 +5,27 @@
 #
 # $FreeBSD: ports/devel/ptmalloc/Makefile,v 1.1 2004/12/14 02:18:24 grog Exp $
 
-PORTNAME=	ptmalloc
-PORTVERSION=	1.0
+PORTNAME=	ptmalloc2
+PORTVERSION=	2.0
 CATEGORIES=	devel
 MASTER_SITES=	http://www.malloc.de/malloc/
-DISTNAME=	ptmalloc
+DISTNAME=	${PORTNAME}-current
 
 MAINTAINER=	grog@FreeBSD.org
 COMMENT=	Alternative malloc, performs better with threaded applications
 
+WRKSRC=	${WRKDIR}/${PORTNAME}
+INSTALLS_SHLIB= yes
+
+post-patch:
+	@${REINPLACE_CMD} -e 's+-pthread+${PTHREAD_LIBS}+g ;'	\
+		${WRKSRC}/Makefile
 do-install:	all
-	${INSTALL_PROGRAM} ${WRKSRC}/ptmalloc.so ${PREFIX}/lib/libptmalloc.so.1
-	${INSTALL_PROGRAM} ${WRKSRC}/ptmalloc.so ${PREFIX}/lib/libptmalloc.so
-	${INSTALL_PROGRAM} ${WRKSRC}/libptmalloc.a ${PREFIX}/lib/libptmalloc.a
+	${MKDIR} ${PREFIX}/include/ptmalloc
+	${INSTALL_DATA} ${WRKSRC}/malloc.h ${PREFIX}/include/ptmalloc/malloc.h
+	${INSTALL_PROGRAM} ${WRKSRC}/malloc.so ${PREFIX}/lib/libptmalloc.so.1
+	${INSTALL_PROGRAM} ${WRKSRC}/malloc.so ${PREFIX}/lib/libptmalloc.so
+	${INSTALL_PROGRAM} ${WRKSRC}/libmalloc.a ${PREFIX}/lib/libptmalloc.a
 
 post-install:
 	@${ECHO_CMD}
diff -ruN ptmalloc.orig/distinfo ptmalloc/distinfo
--- ptmalloc.orig/distinfo	Sun Jun  4 00:12:33 2006
+++ ptmalloc/distinfo	Sun Jun  4 00:14:49 2006
@@ -1,3 +1,3 @@
-MD5 (ptmalloc.tar.gz) = 10b3fce4711eeada16726fd5e218309b
-SHA256 (ptmalloc.tar.gz) =
806761559619e37ee78477682dd4b38b861c173c4a7167c753ac6d1799a1af3d
-SIZE (ptmalloc.tar.gz) = 55961
+MD5 (ptmalloc2-current.tar.gz) = 37a0b6d757d272bbb1f8bf1a38fe3cb5
+SHA256 (ptmalloc2-current.tar.gz) =
8b9242a36d523a34d0a54782f35bb040cca0be543e838fd838279d70833c7fa2
+SIZE (ptmalloc2-current.tar.gz) = 78506
diff -ruN ptmalloc.orig/files/patch-Makefile ptmalloc/files/patch-Makefile
--- ptmalloc.orig/files/patch-Makefile	Sun Jun  4 00:12:33 2006
+++ ptmalloc/files/patch-Makefile	Sun Jun  4 00:52:40 2006
@@ -1,57 +1,45 @@
---- Makefile.orig	Mon Dec 20 21:58:38 1999
-+++ Makefile	Tue Dec 14 13:22:01 2004
-@@ -10,7 +10,7 @@
- 
- OPT_FLAGS  = -O #-g
- WARN_FLAGS = # -Wall
--SH_FLAGS   = -shared
-+SH_FLAGS   = -shared -fpic
- 
- # Flags for the test programs
- T_FLAGS   = -DUSE_MALLOC=1 -DMALLOC_HOOKS -DTEST=1
-@@ -27,6 +27,9 @@
- THR_FLAGS = -DUSE_PTHREADS=1 -DUSE_TSD_DATA_HACK -D_REENTRANT
- THR_LIBS  = -lpthread
+--- Makefile.orig	Sat Nov  6 07:32:00 2004
++++ Makefile	Sun Jun  4 00:47:43 2006
+@@ -15,12 +15,12 @@
+ TAR_FLAGS = --numeric-owner --exclude "*~" --exclude "debian/tmp*"
+ 
+ #CC = /pkg/gcc-2.95.2-wg/bin/gcc
+-CC = cc
++CC ?= cc
+ 
+ SYS_FLAGS  =
+-OPT_FLAGS  = -g -O # -O2
++OPT_FLAGS  = -O # -O2
+ WARN_FLAGS = #-Wall -Wstrict-prototypes
+-SH_FLAGS   = -shared -fpic
++SH_FLAGS   = -shared -fPIC
+ 
+ INC_FLAGS  = -Isysdeps/generic
+ 
+@@ -40,13 +40,13 @@
+ RANLIB    = ranlib
+ 
+ MALLOC_OBJ = malloc.o malloc-stats.o
+-LIB_MALLOC = libmalloc.a
++LIB_MALLOC = libmalloc.a malloc.so
+ 
+ T_SUF =
+ TESTS = t-test1$(T_SUF) t-test2$(T_SUF) \
+         tst-mallocstate$(T_SUF) tst-mstats$(T_SUF)
  
-+# Target libraries
-+LIBS=		libptmalloc.a ptmalloc.so
-+
- RM        = rm -f
+-CFLAGS = $(SYS_FLAGS) $(OPT_FLAGS) $(WARN_FLAGS) $(THR_FLAGS) $(INC_FLAGS)
++CFLAGS += $(SYS_FLAGS) $(OPT_FLAGS) $(WARN_FLAGS) $(THR_FLAGS) $(INC_FLAGS)
  
- # Don't need it for the Linux C library 6, see `glibc' target below.
-@@ -40,7 +43,9 @@
  .c.o:
  	$(CC) -c $(CFLAGS) $<
- 
--all: $(TESTS)
-+all: ${LIBS} 
-+
-+tests: $(TESTS)
- 
- shared: ptmalloc.so
- 
-@@ -48,14 +53,14 @@
- 	$(CC) -c $(CFLAGS) $(M_FLAGS) $<
- 
- ptmalloc.so: ptmalloc.c ptmalloc.h thread-m.h
--	$(CC) $(SH_FLAGS) $(CFLAGS) $(M_FLAGS) $< -o $@
-+	$(CC) $(SH_FLAGS) $(CFLAGS) $(M_FLAGS) ptmalloc.c -o $@
- 
- again:
- 	$(RM) $(TESTS)
- 	$(MAKE) $(TESTS)
- 
- clean:
--	$(RM) ptmalloc.o ptmalloc.so $(TESTS) core
-+	$(RM) ptmalloc.o ptmalloc.so $(TESTS) core lib*
- 
- t-test1$(T_SUF): t-test1.c t-test.h thread-m.h $(MALLOC)
- 	$(CC) $(CFLAGS) $(T_FLAGS) t-test1.c $(MALLOC) $(THR_LIBS) -o $@
-@@ -129,3 +134,7 @@
- dist:
- 	cd ..; tar cf - $(DIST_FILES2:%=ptmalloc/%) | \
- 	 gzip -9 >ptmalloc.tar.gz
+@@ -137,6 +137,10 @@
+  OPT_FLAGS='$(OPT_FLAGS)' THR_FLAGS='-DUSE_TSD_DATA_HACK' \
+  INC_FLAGS='-Isysdeps/pthread -Isysdeps/generic -I.' M_FLAGS='$(M_FLAGS)' \
+  malloc.so
 +
 +libptmalloc.a: ptmalloc.o
 +	ar qcvf $@ ptmalloc.o
 +	ranlib $@
+ 
+ sproc:
+ 	$(MAKE) THR_FLAGS='' THR_LIBS='' OPT_FLAGS='$(OPT_FLAGS)' CC='$(CC)' \
diff -ruN ptmalloc.orig/pkg-descr ptmalloc/pkg-descr
--- ptmalloc.orig/pkg-descr	Sun Jun  4 00:12:33 2006
+++ ptmalloc/pkg-descr	Sun Jun  4 01:19:56 2006
@@ -1,39 +1,19 @@
 ptmalloc is the original version of the malloc that was later included
-in GNU libc.  Under some circumsntaces, notably with pthreads and
-excessive calls to realloc, it performs significantly better than
-FreeBSD malloc.  This version is *not* GPL or LGPL:
+in GNU libc.  Under some circumstances, notably with pthreads and
+excessive calls to realloc, it can perform significantly better than
+FreeBSD malloc.
 
-  Copyright (c) 1999 Wolfram Gloger
-  
-  Permission to use, copy, modify, distribute, and sell this software
-  and its documentation for any purpose is hereby granted without fee,
-  provided that (i) the above copyright notices and this permission
-  notice appear in all copies of the software and related
-  documentation, and (ii) the name of Wolfram Gloger may not be used
-  in any advertising or publicity relating to the software.
-  
-  THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-  EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-  WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-  
-  IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL,
-  INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
-  DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-  WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY
-  THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-  PERFORMANCE OF THIS SOFTWARE.
+As aprt of GNU glibc this package is *also* available under the GNU LGPL, 
+however when using the standalone package *only* the conditions 
+spelled out in COPYRIGHT apply.
 
-This is not the latest version: it's older than the one in GNU libc.
 There is a newer version, but it's still marked as "current snapshot".
-It's in /usr/ports/devel/ptmalloc-2/.
 
 See the web site for more details: WWW: http://www.malloc.de/en/
 
-This package comes with no documentation beyond a README, which isn't
-worth installing.  It appears that the GNU libc man page malloc(3)
-applies, but it's not included here for copyright reasons.  There's
-nothing unusual about it.  In particular, the section TUNING in
-FreeBSD malloc(3) does not apply.
+It appears that the GNU libc man page malloc(3) applies, but it's not 
+included here for copyright reasons.  There's nothing unusual about it.  
+The section TUNING, in particular, does not apply in FreeBSD malloc(3) 
 
 This library uses the POSIX pthread_atfork() function which was not
 committed to -CURRENT until 10 December 2004.  See PR bin/68841 for
diff -ruN ptmalloc.orig/pkg-message ptmalloc/pkg-message
--- ptmalloc.orig/pkg-message	Wed Dec 31 19:00:00 1969
+++ ptmalloc/pkg-message	Sun Jun  4 01:16:02 2006
@@ -0,0 +1,19 @@
+Copyright (c) 2001-2004 Wolfram Gloger
+
+Permission to use, copy, modify, distribute, and sell this software
+and its documentation for any purpose is hereby granted without fee,
+provided that (i) the above copyright notices and this permission
+notice appear in all copies of the software and related documentation,
+and (ii) the name of Wolfram Gloger may not be used in any advertising
+or publicity relating to the software.
+
+THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL,
+INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
+DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY
+OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
diff -ruN ptmalloc.orig/pkg-plist ptmalloc/pkg-plist
--- ptmalloc.orig/pkg-plist	Sun Jun  4 00:12:33 2006
+++ ptmalloc/pkg-plist	Sun Jun  4 00:13:15 2006
@@ -1,3 +1,5 @@
+include/ptmalloc/malloc.h
+@dirrm include/ptmalloc
 lib/libptmalloc.a
 lib/libptmalloc.so
 lib/libptmalloc.so.1


Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060604062950.33986.qmail>