From thierry@pompo.net  Thu Mar  8 20:31:52 2007
Return-Path: <thierry@pompo.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id C54DF16A400;
	Thu,  8 Mar 2007 20:31:52 +0000 (UTC)
	(envelope-from thierry@pompo.net)
Received: from graf.pompo.net (graf.pompo.net [81.56.186.139])
	by mx1.freebsd.org (Postfix) with ESMTP id 38BB013C481;
	Thu,  8 Mar 2007 20:31:52 +0000 (UTC)
	(envelope-from thierry@pompo.net)
Received: by graf.pompo.net (Postfix, from userid 1001)
	id 669E41142C; Thu,  8 Mar 2007 21:31:46 +0100 (CET)
Message-Id: <20070308203146.669E41142C@graf.pompo.net>
Date: Thu,  8 Mar 2007 21:31:46 +0100 (CET)
From: Thierry Thomas <thierry@FreeBSD.org>
Reply-To: Thierry Thomas <thierry@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Marcus Alves Grando <mnag@FreeBSD.org>
Subject: databases/sqlite3: create a slave port for threads-override-locks.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         110104
>Category:       ports
>Synopsis:       databases/sqlite3: create a slave port for threads-override-locks.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    mnag
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 08 20:40:00 GMT 2007
>Closed-Date:    Sun Mar 25 20:03:47 GMT 2007
>Last-Modified:  Sun Mar 25 20:10:11 GMT 2007
>Originator:     Thierry Thomas
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
Kabbale Eros
>Environment:
System: FreeBSD graf.pompo.net 6.2-STABLE FreeBSD 6.2-STABLE #0: Sun Jan 28 10:29:56 CET 2007 thierry@graf.pompo.net:/usr/obj/usr/src/sys/GRAF060511 i386


	
>Description:
	Some ports / packages (e.g. deskutils/pinot) work better when
	threads-override-locks is enabled in sqlite3. For packaging reasons
	I'm proposing to create a slave port for this option.

	The attached patch and shar file do the following:

	- create sqlite3-threads as a slave port, which sets USE_THOL;
	- update sqlite3 to handle this variable;
	- define conflicts between sqlite3-threads & sqlite3;
	- sqlite3-threads will touch a dummy file
	  etc/sqlite3_installed_with_threads-override-locks to test which
	  package has been installed
	- the current option WITH_THREADS is only available in the master
	  port.

>How-To-Repeat:
	N/A

>Fix:
	Please accept the following patches:

--- sqlite3.diff begins here ---
diff -urN databases/sqlite3.orig/Makefile databases/sqlite3/Makefile
--- databases/sqlite3.orig/Makefile	Wed Feb 14 07:46:41 2007
+++ databases/sqlite3/Makefile	Wed Mar  7 23:47:58 2007
@@ -10,6 +10,9 @@
 PORTVERSION=	3.3.12
 CATEGORIES=	databases
 MASTER_SITES=	http://www.sqlite.org/
+.if defined(USE_THOL)
+PKGNAMESUFFIX=	-threads
+.endif
 
 MAINTAINER=	mnag@FreeBSD.org
 COMMENT=	An SQL database engine in a C library w/ Tcl wrapper
@@ -29,14 +32,25 @@
 OPTIONS=	DEBUG		"Enable debugging & verbose explain"	off \
 		DOCS		"Building docs (depends on TCL)"	on \
 		FTS1		"Enable FTS1 (Full Text Search) module"	off \
-		TCLWRAPPER	"TCL wrapper for SQLITE"		off \
-		THREADS		"Enable threads support"		off
+		TCLWRAPPER	"TCL wrapper for SQLITE"		off
 
 # Defaults, for building the docs:
 TCL_V?=		8.4
 MAKE_ARGS+=	TCLSH=tclsh${TCL_V}
 MAKE_ENV+=	TCL_VER=${TCL_V}
 
+.if !defined(USE_THOL)
+OPTIONS+=	THREADS		"Enable threads support"		off
+PLIST_SUB+=	THOL="@comment "
+CONFLICTS=	sqlite-threads-3*
+.else
+CONFIGURE_ARGS+=--enable-threadsafe --enable-threads-override-locks
+PLIST_SUB+=	THOL=""
+CONFLICTS=	sqlite-3*
+.endif
+
+SLAVEDIRS=	databases/sqlite3-threads
+
 .include <bsd.port.pre.mk>
 
 .if defined(WITH_DEBUG)
@@ -68,8 +82,8 @@
 CONFIGURE_ARGS+=	--enable-threadsafe
 .endif
 
-post-patch:
-.if defined(WITH_THREADS)
+pre-configure:
+.if defined(WITH_THREADS) || defined(USE_THOL)
 	@${REINPLACE_CMD} -e "s|-lpthread|${PTHREAD_LIBS}|g" \
 		${WRKSRC}/configure
 	@${REINPLACE_CMD} -E -e "s|(Libs:.*)|\1 ${PTHREAD_LIBS}|" \
@@ -99,5 +113,8 @@
 .endif
 	@${MKDIR} ${EXAMPLESDIR}
 	@${INSTALL_DATA} ${FILESDIR}/example.tcl ${EXAMPLESDIR}
+.if defined(USE_THOL)
+	${TOUCH} ${PREFIX}/etc/sqlite3_installed_with_threads-override-locks
+.endif
 
 .include <bsd.port.post.mk>
diff -urN databases/sqlite3.orig/pkg-plist databases/sqlite3/pkg-plist
--- databases/sqlite3.orig/pkg-plist	Wed Feb 14 07:46:41 2007
+++ databases/sqlite3/pkg-plist	Wed Mar  7 23:39:08 2007
@@ -1,5 +1,6 @@
 bin/sqlite3
 %%WITH_TCLWRAPPER%%bin/tclsqlite3
+%%THOL%%etc/sqlite3_installed_with_threads-override-locks
 include/sqlite3.h
 include/sqlite3ext.h
 lib/libsqlite3.a
--- sqlite3.diff ends here ---

--- sqlite3-threads.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	databases/sqlite3-threads
#	databases/sqlite3-threads/Makefile
#
echo c - databases/sqlite3-threads
mkdir -p databases/sqlite3-threads > /dev/null 2>&1
echo x - databases/sqlite3-threads/Makefile
sed 's/^X//' >databases/sqlite3-threads/Makefile << 'END-of-databases/sqlite3-threads/Makefile'
X# New ports collection makefile for:	sqlite3-threads
X# Date created:		07 March 2007
X# Whom:			thierry@pompo.net
X#
X# $FreeBSD$
X#
X
XPORTNAME=	sqlite3
X
XCOMMENT=	SQLite 3 with threads overriding each others locks enabled
X
XMASTERDIR=	${.CURDIR}/../sqlite3
X
XUSE_THOL=	yes
X
X.include "${MASTERDIR}/Makefile"
END-of-databases/sqlite3-threads/Makefile
exit
--- sqlite3-threads.shar ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->mnag 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Mar 8 20:40:16 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110104 
State-Changed-From-To: open->closed 
State-Changed-By: mnag 
State-Changed-When: Sun Mar 25 20:03:45 UTC 2007 
State-Changed-Why:  
Committed, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110104 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/110104: commit references a PR
Date: Sun, 25 Mar 2007 20:02:10 +0000 (UTC)

 mnag        2007-03-25 20:02:04 UTC
 
   FreeBSD ports repository
 
   Modified files:
     databases            Makefile 
     databases/sqlite3    Makefile distinfo pkg-plist 
   Added files:
     databases/sqlite3-threads Makefile 
   Log:
   * databases/Makefile
   
   - Add sqlite3-threads port
   
   * databases/sqlite3
   
   - Upgrade to 3.3.13 [1]
   
   * databases/sqlite3-threads
   
   - Create a slave port for threads-override-locks. [2]
   
   PR:             110446 [1], 110104 [2]
   Submitted by:   Michael Scheidell <scheidell___secnap.net> [1], thierry [2]
   
   Revision  Changes    Path
   1.599     +1 -0      ports/databases/Makefile
   1.1       +16 -0     ports/databases/sqlite3-threads/Makefile (new)
   1.24      +36 -19    ports/databases/sqlite3/Makefile
   1.16      +3 -3      ports/databases/sqlite3/distinfo
   1.9       +2 -0      ports/databases/sqlite3/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
