sqlite stable port information

Package: sqlite
Version: 2.8.5
Revision: 1014

Description: Embedded SQL database
DescDetail: <<
SQLite is a C library that implements an embeddable SQL database engine.
Programs that link with the SQLite library can have SQL database access
without running a separate RDBMS process. The distribution comes with a
standalone command-line access program ( sqlite ) that can be used to
administer an SQLite database and which serves as an example of how to
use the SQLite library.
<<
DescPort: <<
Patch configure to find the Fink readline headers. This package requires
readline present to build due to issues with the default sqlite configure
script when run on OS X.
<<

License: Public Domain
Maintainer: Blair Zajac
Homepage: http://www.sqlite.org/

DocFiles: README LICENSE

Depends: %N-shlibs (= %v-%r), readline5-shlibs (>= 5.0-1004)
BuildDepends: readline5 (>= 5.0-1004), libncurses5 (>= 5.4-20041023-1006)

Source: http://sqlite.org/%n-%v.tar.gz
Source-MD5: 990586435d2ec9ccf1a9837c70f237cf
SourceDirectory: sqlite

# Patch Phase:
PatchScript: <<
sed 's|@PREFIX@|%p|g' < %a/%n.patch | patch -p1
head -n 10 src/%n.h.in > LICENSE
perl -pi.bak -e "s/-flat_namespace -undefined suppress//g" configure
<<

SetCFLAGS: -I%P/include
CompileScript: <<
#!/bin/sh -ev
LIBRARY_PATH=%P/lib C_INCLUDE_PATH=%P/include ./configure --without-tcl --prefix=%P
LIBRARY_PATH=%P/lib C_INCLUDE_PATH=%P/include make
<<

SplitOff: <<
Package: %N-shlibs
DocFiles: README LICENSE
Shlibs: %p/lib/libsqlite.0.dylib 6.0.0 %n (>= 2.8.5-2)
Files: lib/libsqlite.0.5.3.dylib lib/libsqlite.0.dylib
<<

SplitOff2: <<
Package: %N-dev
DocFiles: README LICENSE
Depends: %N-shlibs (= %v-%r)
BuildDependsOnly: True
Files: lib/libsqlite.la lib/libsqlite.a include/sqlite.h lib/libsqlite.dylib
<<
DescPackaging: <<
This package was previously maintained by Peter Wilkinson
.
<<

sqlite stable port .patch

diff -uNbr sqlite/configure sqlite.new/configure
--- sqlite/configure Tue Apr 22 18:04:49 2003
+++ sqlite.new/configure Thu Jul 31 17:48:41 2003
@@ -9164,7 +9164,7 @@

fi
if test "$found" = "no"; then
- for dir in /usr /usr/local /usr/local/readline /usr/contrib; do
+ for dir in /usr /usr/local /usr/local/readline /usr/contrib @PREFIX@; do
as_ac_File=`echo "ac_cv_file_$dir/include/readline.h" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $dir/include/readline.h" >&5
echo $ECHO_N "checking for $dir/include/readline.h... $ECHO_C" >&6

sqlite _unstable_ port information

Package: sqlite
Version: 2.8.17
Revision: 1002
Description: Embedded SQL database (binary)
License: Public Domain
Homepage: http://www.sqlite.org/
Maintainer: Blair Zajac

# Dependencies.
Depends: %N-shlibs (= %v-%r), readline5-shlibs (>= 5.0-1004)
BuildDepends: libncurses5 (>= 5.4-20041023-1006), readline5 (>= 5.0-1004), tcltk (<< 8.5), tcltk-dev (<< 8.5)

# Unpack Phase.
Source: http://sqlite.org/%n-%v.tar.gz
Source-MD5: 838dbac20b56d2c4292e98848505a05b

# Patch Phase:
PatchScript: <<
#!/bin/sh -ev
sed 's|@PREFIX@|%p|g' < %a/%n.patch | patch -p1
head -n 10 src/%n.h.in > LICENSE
perl -pi.bak -e "s/-flat_namespace -undefined suppress//g" configure
find . -type d -name CVS -print0 | xargs -0 rm -fr
<<

# Compile Phase.
SetCFLAGS: -Os -I. -I./src -I%p/include -L%p/lib
ConfigureParams: --enable-utf8 --disable-maintainer-mode
CompileScript: <<
#!/bin/sh -ev
./configure %c
cp -f %p/lib/fink/update/ltmain.sh .
cp -f %p/lib/fink/update/ltconfig .
make
make libtclsqlite.la
make doc
<<

# Install Phase.
InstallScript: <<
#!/bin/sh -ev
TCLLIBPATH=%p/lib/tcl8.4 DESTDIR=%d make install
TCLLIBPATH=%p/lib/tcl8.4 DESTDIR=%d tclsh tclinstaller.tcl 2.8
perl -i -pe 's,%i,%p,g' %i/lib/tcl8.4/sqlite/pkgIndex.tcl
<<
DocFiles: LICENSE README

SplitOff: <<
Package: %N-shlibs
Description: Embedded SQL database (libraries)
Shlibs: %p/lib/libsqlite.0.dylib 9.0.0 %n (>= 2.8.16-1)
Files: <<
lib/libsqlite.0.dylib
lib/libsqlite.0.8.6.dylib
<<
DocFiles: LICENSE README
<<

SplitOff2: <<
Package: %N-tcl
Description: Embedded SQL database (Tcl/Tk bindings)
Depends: %N-shlibs (= %v-%r), tcltk (<< 8.5)
Conflicts: %N-tcltk
Replaces: %N-tcltk
Shlibs: %p/lib/tcl8.4/sqlite/libtclsqlite.0.dylib 9.0.0 %n (>= 2.8.16-3)
Files: lib/tcl8.4
DocFiles: LICENSE README
<<

SplitOff3: <<
Package: %N-dev
Description: Embedded SQL database (header files and linkable libraries)
Depends: %N-shlibs (= %v-%r)
BuildDependsOnly: True
Files: <<
include
lib/libsqlite.a
lib/libsqlite.dylib
lib/libsqlite.la
lib/pkgconfig
<<
DocFiles: LICENSE README
<<

SplitOff4: <<
Package: %N-doc
Description: Embedded SQL database (HTML documentation)
DocFiles: doc/* LICENSE README
<<

DescDetail: <<
SQLite is a C library that implements an embeddable SQL database
engine. Programs that link with the SQLite library can have SQL
database access without running a separate RDBMS process. The
distribution comes with a standalone command-line access program
(sqlite) that can be used to administer an SQLite database and which
serves as an example of how to use the SQLite library.
<<

DescPort: <<
Patch configure to find the Fink readline headers. This package
requires readline5 present to build due to issues with the default
sqlite configure script when run on OS X.
<<

DescPackaging: <<
This package was previously maintained by Peter Wilkinson
.
<<

sqlite _unstable_ port .patch

--- sqlite-2.8.16.orig/Makefile.in 2005-02-14 01:22:04.000000000 +0100
+++ sqlite-2.8.16/Makefile.in 2005-12-16 07:04:22.000000000 +0100
@@ -183,7 +183,7 @@
# of the most recently modified source code file
#
last_change: $(SRC)
- cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \
+ cat $(SRC) | grep '$$Id: ' | sort -k 5 | tail -n 1 \
| awk '{print $$5,$$6}' >last_change

libsqlite.la: $(LIBOBJ)
diff -ru sqlite-2.8.16.orig/configure sqlite-2.8.16/configure
--- sqlite-2.8.16.orig/configure 2005-02-13 16:22:04.000000000 -0800
+++ sqlite-2.8.16/configure 2005-11-03 21:54:13.000000000 -0800
@@ -20385,7 +20385,7 @@

fi
if test "$found" = "no"; then
- for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do
+ for dir in @PREFIX@ /usr /usr/local /usr/local/readline /usr/contrib /mingw; do
as_ac_File=`echo "ac_cv_file_$dir/include/readline.h" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $dir/include/readline.h" >&5
echo $ECHO_N "checking for $dir/include/readline.h... $ECHO_C" >&6
diff -ruN sqlite-2.8.16.orig/tclinstaller.tcl sqlite-2.8.16/tclinstaller.tcl
--- sqlite-2.8.16.orig/tclinstaller.tcl 1969-12-31 16:00:00.000000000 -0800
+++ sqlite-2.8.16/tclinstaller.tcl 2005-11-08 22:39:15.000000000 -0800
@@ -0,0 +1,29 @@
+# This script attempts to install SQLite2 so that it can be used
+# by TCL. Invoke this script with single argument which is the
+# version number of SQLite. Example:
+#
+# tclsh tclinstaller.tcl 2.8
+#
+set VERSION [lindex $argv 0]
+set LIBFILE .libs/libtclsqlite[info sharedlibextension]
+if { ![info exists env(DESTDIR)] } { set env(DESTDIR) "" }
+set LIBDIR $env(DESTDIR)[lindex $auto_path 0]
+set LIBNAME [file tail $LIBFILE]
+set LIB $LIBDIR/sqlite/$LIBNAME
+
+file delete -force $LIBDIR/sqlite
+file mkdir $LIBDIR/sqlite
+set fd [open $LIBDIR/sqlite/pkgIndex.tcl w]
+puts $fd "package ifneeded sqlite $VERSION \[list load $LIB sqlite\]"
+close $fd
+
+# We cannot use [file copy] because that will just make a copy of
+# a symbolic link. We have to open and copy the file for ourselves.
+#
+set in [open $LIBFILE]
+fconfigure $in -translation binary
+set out [open $LIB w]
+fconfigure $out -translation binary
+puts -nonewline $out [read $in]
+close $in
+close $out


##
## This patch was taken from Ubuntu's sqlite-2.8.16-1 package.
##
diff -ruN sqlite/tool/lemon.c sqlite-new/tool/lemon.c
--- sqlite-2.8.16.orig/tool/lemon.c 2004-04-24 14:59:13.000000000 +0200
+++ sqlite-2.8.16/tool/lemon.c 2004-07-27 15:31:40.000000000 +0200
@@ -1272,15 +1272,15 @@
va_start(ap, format);
/* Prepare a prefix to be prepended to every output line */
if( lineno>0 ){
- sprintf(prefix,"%.*s:%d: ",PREFIXLIMIT-10,filename,lineno);
+ snprintf(prefix,sizeof prefix,"%.*s:%d: ",PREFIXLIMIT-10,filename,lineno);
}else{
- sprintf(prefix,"%.*s: ",PREFIXLIMIT-10,filename);
+ snprintf(prefix,sizeof prefix,"%.*s: ",PREFIXLIMIT-10,filename);
}
prefixsize = strlen(prefix);
availablewidth = LINEWIDTH - prefixsize;

/* Generate the error message */
- vsprintf(errmsg,format,ap);
+ vsnprintf(errmsg,sizeof errmsg,format,ap);
va_end(ap);
errmsgsize = strlen(errmsg);
/* Remove trailing '\n's from the error message. */
@@ -2675,7 +2675,7 @@
while( cfp ){
char buf[20];
if( cfp->dot==cfp->rp->nrhs ){
- sprintf(buf,"(%d)",cfp->rp->index);
+ snprintf(buf,sizeof buf,"(%d)",cfp->rp->index);
fprintf(fp," %5s ",buf);
}else{
fprintf(fp," ");
@@ -2721,7 +2721,7 @@
c = *cp;
*cp = 0;
path = (char *)malloc( strlen(argv0) + strlen(name) + 2 );
- if( path ) sprintf(path,"%s/%s",argv0,name);
+ if( path ) snprintf(path,sizeof path,"%s/%s",argv0,name);
*cp = c;
}else{
extern char *getenv();
@@ -2734,7 +2734,7 @@
if( cp==0 ) cp = &pathlist[strlen(pathlist)];
c = *cp;
*cp = 0;
- sprintf(path,"%s/%s",pathlist,name);
+ snprintf(path,sizeof path,"%s/%s",pathlist,name);
*cp = c;
if( c==0 ) pathlist = "";
else pathlist = &cp[1];
@@ -2814,14 +2814,16 @@

cp = strrchr(lemp->filename,'.');
if( cp ){
- sprintf(buf,"%.*s.lt",(int)(cp-lemp->filename),lemp->filename);
+ snprintf(buf,sizeof buf,"%.*s.lt",(int)(cp-lemp->filename),lemp->filename);
}else{
- sprintf(buf,"%s.lt",lemp->filename);
+ snprintf(buf,sizeof buf,"%s.lt",lemp->filename);
}
if( access(buf,004)==0 ){
tpltname = buf;
}else if( access(templatename,004)==0 ){
tpltname = templatename;
+ }else if( access("/usr/share/lemon/lempar.c",004)==0 ){
+ tpltname = "/usr/share/lemon/lempar.c";
}else{
tpltname = pathsearch(lemp->argv0,templatename,0);
}
@@ -2833,7 +2835,7 @@
}
in = fopen(tpltname,"r");
if( in==0 ){
- fprintf(stderr,"Can't open the template file \"%s\".\n",templatename);
+ fprintf(stderr,"Can't open the template file \"%s\".\n",tpltname);
lemp->errorcnt++;
return 0;
}
@@ -3447,7 +3449,7 @@
/* Generate a table containing the symbolic name of every symbol
*/
for(i=0; insymbol; i++){
- sprintf(line,"\"%s\",",lemp->symbols[i]->name);
+ snprintf(line,sizeof line,"\"%s\",",lemp->symbols[i]->name);
fprintf(out," %-15s",line);
if( (i&3)==3 ){ fprintf(out,"\n"); lineno++; }
}
@@ -3562,7 +3564,7 @@
in = file_open(lemp,".h","r");
if( in ){
for(i=1; interminal && fgets(line,LINESIZE,in); i++){
- sprintf(pattern,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i);
+ snprintf(pattern,sizeof pattern,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i);
if( strcmp(line,pattern) ) break;
}
fclose(in);