Update from outdated sqlite 1.x version to latest sqlite 2.6.1 version Fix: Here's my patch. I'm also volunteering to be the new maintainer for this port. Btw. this is for me mainly a basis for the py-PySQLite port that I'll shortly be submitting. Well, with this patch the TCL interface is built, but not installed, yet. The reason is that I currently know zero about Tcl. How-To-Repeat: N/A
dwcjr# make package >> sqlite-2.6.1.tar.gz doesn't seem to exist in /usr/ports/distfiles/. >> Attempting to fetch from http://www.hwaci.com/sw/sqlite/. Receiving sqlite-2.6.1.tar.gz (820890 bytes): 100% 820890 bytes transferred in 5.6 seconds (143.57 kBps) ===> Extracting for sqlite-2.6.1 >> Checksum OK for sqlite-2.6.1.tar.gz. ===> sqlite-2.6.1 depends on executable: gmake - found ===> sqlite-2.6.1 depends on shared library: tcl83 - found ===> Patching for sqlite-2.6.1 ===> Applying FreeBSD patches for sqlite-2.6.1 1 out of 1 hunks failed--saving rejects to www/index.tcl.rej >> Patch patch-docs failed to apply cleanly. *** Error code 1 Also please don't erase the header in the Makefile which contains the version number and who created the port
State Changed From-To: open->feedback One of the patch files do not apply properly and port could possibly be updated further.
David, you were right that the port still had much room for improvement. Here's a much improved version (updated, bugfixes, newer sqlite, Tcl support). There's no overlap with the existing port, so I'm sending it as a shell archive. As for the naming, I named it sqlite2 this time, and not only so cvsup won't overwrite it again ;-) Seriously, I don't think anybody will want to use the 1.x version of SQLite, so I'd recommend you change the port name back to "sqlite" and replace the existing port with it. If you want to keep the 1.x port, then I have no idea wether both can be used in parallel. There doesn't seem to be a "conflicts" rule to add in the Makefile that forbids installing both, is there? I just assume that nobody installs both ports and still put the docs in .../sqlite. Again, IMO the best solution is to just replace the existing port. -- Gerhard # 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/sqlite2 # databases/sqlite2/files # databases/sqlite2/files/example.tcl # databases/sqlite2/files/patch-makefile # databases/sqlite2/files/pkgIndex.tcl # databases/sqlite2/Makefile # databases/sqlite2/distinfo # databases/sqlite2/pkg-comment # databases/sqlite2/pkg-descr # databases/sqlite2/pkg-plist # echo c - databases/sqlite2 mkdir -p databases/sqlite2 > /dev/null 2>&1 echo c - databases/sqlite2/files mkdir -p databases/sqlite2/files > /dev/null 2>&1 echo x - databases/sqlite2/files/example.tcl sed 's/^X//' >databases/sqlite2/files/example.tcl << 'END-of-databases/sqlite2/files/example.tcl' Xpackage require sqlite X Xif {$argc!=2} { X puts stderr "Usage: %s DATABASE SQL-STATEMENT" X exit 1 X} Xsqlite db [lindex $argv 0] Xdb eval [lindex $argv 1] x { X foreach v $x(*) { X puts "$v = $x($v)" X } X puts "" X} Xdb close END-of-databases/sqlite2/files/example.tcl echo x - databases/sqlite2/files/patch-makefile sed 's/^X//' >databases/sqlite2/files/patch-makefile << 'END-of-databases/sqlite2/files/patch-makefile' Xdiff -r -C 3 ../sqlite.orig/Makefile.in ./Makefile.in X*** ../sqlite.orig/Makefile.in Sat Aug 31 18:29:58 2002 X--- ./Makefile.in Mon Sep 2 00:51:27 2002 X*************** X*** 310,322 **** X mkdir -p doc X mv $(DOC) doc X X! install: sqlite libsqlite.la sqlite.h X $(INSTALL) -d $(exec_prefix)/lib X $(LIBTOOL) $(INSTALL) libsqlite.la $(exec_prefix)/lib X $(INSTALL) -d $(exec_prefix)/bin X $(LIBTOOL) $(INSTALL) sqlite $(exec_prefix)/bin X $(INSTALL) -d $(prefix)/include X $(INSTALL) -m 0644 sqlite.h $(prefix)/include X X clean: X rm -f *.lo *.la *.o sqlite libsqlite.la sqlite.h X--- 310,324 ---- X mkdir -p doc X mv $(DOC) doc X X! install: sqlite libsqlite.la sqlite.h libtclsqlite.la X $(INSTALL) -d $(exec_prefix)/lib X $(LIBTOOL) $(INSTALL) libsqlite.la $(exec_prefix)/lib X $(INSTALL) -d $(exec_prefix)/bin X $(LIBTOOL) $(INSTALL) sqlite $(exec_prefix)/bin X $(INSTALL) -d $(prefix)/include X $(INSTALL) -m 0644 sqlite.h $(prefix)/include X+ mkdir -p $(prefix)/lib/sqlite X+ $(LIBTOOL) $(INSTALL) libtclsqlite.la $(prefix)/lib/sqlite X X clean: X rm -f *.lo *.la *.o sqlite libsqlite.la sqlite.h END-of-databases/sqlite2/files/patch-makefile echo x - databases/sqlite2/files/pkgIndex.tcl sed 's/^X//' >databases/sqlite2/files/pkgIndex.tcl << 'END-of-databases/sqlite2/files/pkgIndex.tcl' Xpackage ifneeded sqlite 0.0 [list load [file join $dir libtclsqlite.so.0] sqlite] END-of-databases/sqlite2/files/pkgIndex.tcl echo x - databases/sqlite2/Makefile sed 's/^X//' >databases/sqlite2/Makefile << 'END-of-databases/sqlite2/Makefile' X# ex:ts=8 X# New ports collection makefile for: sqlite X# Date created: Feb 21, 2001 X# Whom: Ying-Chieh Liao <ijliao@FreeBSD.org> X# X# $FreeBSD: ports/databases/sqlite/Makefile,v 1.7 2001/12/02 18:19:09 steve Exp $ X# X XPORTNAME= sqlite2 XPORTVERSION= 2.7.1 XCATEGORIES= databases XMASTER_SITES= http://www.hwaci.com/sw/sqlite/ XDISTNAME= sqlite-${PORTVERSION} X XMAINTAINER= gerhard.haering@gmx.de X XLIB_DEPENDS= tcl${TCL_VER:S/.//}:${PORTSDIR}/lang/tcl${TCL_VER:S/.//} XBUILD_DEPENDS= X XUSE_GMAKE= YES XGNU_CONFIGURE= YES XUSE_REINPLACE= YES XCONFIGURE_ARGS= --prefix=${PREFIX} --with-hints=freebsd.hints X XWRKSRC= ${WRKDIR}/sqlite XMAKE_ARGS+= TCLSH=tclsh${TCL_VER} XMAKE_ENV+= TCL_VER=${TCL_VER} XTCL_VER?= 8.3 X XDOCFILES= arch.html arch.png c_interface.html changes.html \ X crosscompile.html download.html faq.html index.html \ X lang.html lemon.html mingw.html opcode.html report1.txt \ X speed.html sqlite.html tclsqlite.html vdbe.html X XDOCSDIR= ${PREFIX}/share/doc/sqlite X Xpost-patch: X ${REINPLACE_CMD} -e "s/tclsh \$$(TOP)/\$$(TCLSH) \$$(TOP)/g" ${WRKSRC}/Makefile.in X ${ECHO} "config_TARGET_TCL_INC=\"-I${PREFIX}/include/tcl${TCL_VER}\"" >${WRKSRC}/freebsd.hints X ${ECHO} "config_TARGET_TCL_LIBS=\"-L${PREFIX}/lib -ltcl${TCL_VER:S/.//}\"" >>${WRKSRC}/freebsd.hints X #${ECHO} "config_TARGET_CFLAGS=\"-DTHREADSAFE=1 -pthread\"" >>${WRKSRC}/freebsd.hints X Xpost-build: X # Build the docs X cd ${WRKSRC} && ${MAKE} ${MAKE_ARGS} doc X Xpost-install: X ${INSTALL_DATA} ${FILESDIR}/pkgIndex.tcl ${PREFIX}/lib/sqlite/ X.if !defined(NOPORTDOCS) X @${MKDIR} ${DOCSDIR} X @${INSTALL_DATA} ${FILESDIR}/example.tcl ${DOCSDIR} X.for file in ${DOCFILES} X @${INSTALL_DATA} ${WRKSRC}/doc//${file} ${DOCSDIR} X.endfor X.endif X X.include <bsd.port.mk> END-of-databases/sqlite2/Makefile echo x - databases/sqlite2/distinfo sed 's/^X//' >databases/sqlite2/distinfo << 'END-of-databases/sqlite2/distinfo' XMD5 (sqlite-2.7.1.tar.gz) = 4910d3603365ab042cf78a1ec6304bb6 END-of-databases/sqlite2/distinfo echo x - databases/sqlite2/pkg-comment sed 's/^X//' >databases/sqlite2/pkg-comment << 'END-of-databases/sqlite2/pkg-comment' XAn SQL database engine in a C library, including a Tcl wrapper END-of-databases/sqlite2/pkg-comment echo x - databases/sqlite2/pkg-descr sed 's/^X//' >databases/sqlite2/pkg-descr << 'END-of-databases/sqlite2/pkg-descr' XSQLite is an SQL database engine in a C library. Programs that link the SQLite Xlibrary can have SQL database access without running a separate RDBMS process. XThe distribution comes with a standalone command-line access program (sqlite) Xthat can be used to administer an SQLite database and which serves as an Xexample of how to use the SQLite library. X XWWW: http://www.hwaci.com/sw/sqlite/ END-of-databases/sqlite2/pkg-descr echo x - databases/sqlite2/pkg-plist sed 's/^X//' >databases/sqlite2/pkg-plist << 'END-of-databases/sqlite2/pkg-plist' Xbin/sqlite Xinclude/sqlite.h Xlib/libsqlite.a Xlib/libsqlite.la Xlib/libsqlite.so Xlib/libsqlite.so.0 Xlib/sqlite/libtclsqlite.so.0 Xlib/sqlite/libtclsqlite.so Xlib/sqlite/libtclsqlite.la Xlib/sqlite/libtclsqlite.a Xlib/sqlite/pkgIndex.tcl X@dirrm lib/sqlite X%%PORTDOCS%%share/doc/sqlite/arch.html X%%PORTDOCS%%share/doc/sqlite/arch.png X%%PORTDOCS%%share/doc/sqlite/c_interface.html X%%PORTDOCS%%share/doc/sqlite/changes.html X%%PORTDOCS%%share/doc/sqlite/crosscompile.html X%%PORTDOCS%%share/doc/sqlite/download.html X%%PORTDOCS%%share/doc/sqlite/faq.html X%%PORTDOCS%%share/doc/sqlite/index.html X%%PORTDOCS%%share/doc/sqlite/lang.html X%%PORTDOCS%%share/doc/sqlite/lemon.html X%%PORTDOCS%%share/doc/sqlite/mingw.html X%%PORTDOCS%%share/doc/sqlite/opcode.html X%%PORTDOCS%%share/doc/sqlite/report1.txt X%%PORTDOCS%%share/doc/sqlite/speed.html X%%PORTDOCS%%share/doc/sqlite/sqlite.html X%%PORTDOCS%%share/doc/sqlite/tclsqlite.html X%%PORTDOCS%%share/doc/sqlite/vdbe.html X%%PORTDOCS%%share/doc/sqlite/example.tcl X%%PORTDOCS%%@dirrm share/doc/sqlite END-of-databases/sqlite2/pkg-plist exit
Upon request, once again as a patch with the port name "sqlite". Please note that you'll still have to cvs remove the files in the files/ directory that are no longer needed. They can be found by grepping the patch below for "Only in ../sqlite.orig/files". -- Gerhard diff -r -C 3 ../sqlite.orig/Makefile ./Makefile *** ../sqlite.orig/Makefile Sun Dec 2 19:19:09 2001 --- ./Makefile Mon Sep 2 04:16:49 2002 *************** *** 7,65 **** # PORTNAME= sqlite ! PORTVERSION= 1.0.32 CATEGORIES= databases MASTER_SITES= http://www.hwaci.com/sw/sqlite/ ! MAINTAINER= ports@FreeBSD.org ! LIB_DEPENDS= gdbm.2:${PORTSDIR}/databases/gdbm \ ! tcl${TCL_VER:S/.//}:${PORTSDIR}/lang/tcl${TCL_VER:S/.//} ! BUILD_DEPENDS= lemon:${PORTSDIR}/devel/lemon ! MAKEFILE= ${FILESDIR}/Makefile.bsd ! MAKE_ARGS+= -j2 MAKE_ENV+= TCL_VER=${TCL_VER} TCL_VER?= 8.3 ! GDBM_TOOLS= gdbmdump gdbmstat ! ! post-build: test ! .for p in ${GDBM_TOOLS} ! cd ${WRKSRC}/tool && ${MAKE} CFLAGS="${CFLAGS} -I${PREFIX}/include" \ ! LDADD="-L${PREFIX}/lib -lgdbm" PROG=$p NOMAN=1 \ ! -f bsd.prog.mk ! .endfor ! cd ${WRKSRC} && ${MAKE} VPATH=${WRKSRC}/src \ ! CFLAGS="${CFLAGS} -I${WRKSRC} -I${WRKSRC}/src" \ ! LDADD="-L${WRKSRC} -lsqlite" PROG=sqlite SRCS=shell.c NOMAN=1 \ ! -f bsd.prog.mk ! .ifndef NOPORTDOCS ! cd ${WRKSRC}/www && ${SETENV} ${MAKE_ENV} \ ! ${MAKE} ${MAKE_ARGS} -f ${FILESDIR}/Makefile.docs ! .endif post-install: - .for p in ${GDBM_TOOLS} - cd ${WRKSRC}/tool && ${MAKE} BINDIR="${PREFIX}/bin" \ - PROG=$p NOMAN=1 -f bsd.prog.mk install - .endfor - cd ${WRKSRC} && ${MAKE} PROG=sqlite NOMAN=1 BINDIR="${PREFIX}/bin" \ - -f bsd.prog.mk install - ${MKDIR} ${PREFIX}/lib/sqlite ${INSTALL_DATA} ${FILESDIR}/pkgIndex.tcl ${PREFIX}/lib/sqlite/ ! .ifndef NOPORTDOCS ! ${MKDIR} ${PREFIX}/share/doc/sqlite ! ${INSTALL_DATA} ${WRKSRC}/www/*.html ${WRKSRC}/www/*.png \ ! ${PREFIX}/share/doc/sqlite .endif - - test: - # ------------------------------------------------------- - # Running the vendor's tests -- there should be 0 errors. - # ------------------------------------------------------- - cd ${WRKSRC} && ${PREFIX}/bin/tclsh${TCL_VER} ${WRKSRC}/test/all.test \ - ${WRKSRC}/libsqlite.so - # ------------------------------------------------------- .include <bsd.port.mk> --- 7,57 ---- # PORTNAME= sqlite ! PORTVERSION= 2.7.1 CATEGORIES= databases MASTER_SITES= http://www.hwaci.com/sw/sqlite/ + DISTNAME= sqlite-${PORTVERSION} ! MAINTAINER= gerhard.haering@gmx.de ! LIB_DEPENDS= tcl${TCL_VER:S/.//}:${PORTSDIR}/lang/tcl${TCL_VER:S/.//} ! BUILD_DEPENDS= ! USE_GMAKE= YES ! GNU_CONFIGURE= YES ! USE_REINPLACE= YES ! CONFIGURE_ARGS= --prefix=${PREFIX} --with-hints=freebsd.hints ! ! WRKSRC= ${WRKDIR}/sqlite ! MAKE_ARGS+= TCLSH=tclsh${TCL_VER} MAKE_ENV+= TCL_VER=${TCL_VER} TCL_VER?= 8.3 ! DOCFILES= arch.html arch.png c_interface.html changes.html \ ! crosscompile.html download.html faq.html index.html \ ! lang.html lemon.html mingw.html opcode.html report1.txt \ ! speed.html sqlite.html tclsqlite.html vdbe.html ! ! DOCSDIR= ${PREFIX}/share/doc/sqlite ! ! post-patch: ! ${REINPLACE_CMD} -e "s/tclsh \$$(TOP)/\$$(TCLSH) \$$(TOP)/g" ${WRKSRC}/Makefile.in ! ${ECHO} "config_TARGET_TCL_INC=\"-I${PREFIX}/include/tcl${TCL_VER}\"" >${WRKSRC}/freebsd.hints ! ${ECHO} "config_TARGET_TCL_LIBS=\"-L${PREFIX}/lib -ltcl${TCL_VER:S/.//}\"" >>${WRKSRC}/freebsd.hints ! #${ECHO} "config_TARGET_CFLAGS=\"-DTHREADSAFE=1 -pthread\"" >>${WRKSRC}/freebsd.hints ! ! post-build: ! # Build the docs ! cd ${WRKSRC} && ${MAKE} ${MAKE_ARGS} doc post-install: ${INSTALL_DATA} ${FILESDIR}/pkgIndex.tcl ${PREFIX}/lib/sqlite/ ! .if !defined(NOPORTDOCS) ! @${MKDIR} ${DOCSDIR} ! @${INSTALL_DATA} ${FILESDIR}/example.tcl ${DOCSDIR} ! .for file in ${DOCFILES} ! @${INSTALL_DATA} ${WRKSRC}/doc//${file} ${DOCSDIR} ! .endfor .endif .include <bsd.port.mk> diff -r -C 3 ../sqlite.orig/distinfo ./distinfo *** ../sqlite.orig/distinfo Sun Dec 2 19:19:09 2001 --- ./distinfo Sun Sep 1 18:21:10 2002 *************** *** 1 **** ! MD5 (sqlite-1.0.32.tar.gz) = 308be6d8b9e9514150ef4f89902b2fbc --- 1 ---- ! MD5 (sqlite-2.7.1.tar.gz) = 4910d3603365ab042cf78a1ec6304bb6 Only in ../sqlite.orig/files: Makefile.bsd Only in ../sqlite.orig/files: Makefile.docs Only in ./files: example.tcl Only in ../sqlite.orig/files: patch-docs Only in ./files: patch-makefile Only in ../sqlite.orig/files: patch-test diff -r -C 3 ../sqlite.orig/files/pkgIndex.tcl ./files/pkgIndex.tcl *** ../sqlite.orig/files/pkgIndex.tcl Tue Jun 12 01:32:07 2001 --- ./files/pkgIndex.tcl Mon Sep 2 01:11:29 2002 *************** *** 1 **** ! package ifneeded sqlite 1.0 [list load $dir/../libsqlite.so] --- 1 ---- ! package ifneeded sqlite 0.0 [list load [file join $dir libtclsqlite.so.0] sqlite] diff -r -C 3 ../sqlite.orig/pkg-comment ./pkg-comment *** ../sqlite.orig/pkg-comment Thu Feb 22 18:03:20 2001 --- ./pkg-comment Mon Sep 2 02:37:49 2002 *************** *** 1 **** ! SQL library that uses GDBM as its underlying file storage mechanism --- 1 ---- ! An SQL database engine in a C library, including a Tcl wrapper diff -r -C 3 ../sqlite.orig/pkg-descr ./pkg-descr *** ../sqlite.orig/pkg-descr Thu Feb 22 18:03:20 2001 --- ./pkg-descr Sun Sep 1 18:16:33 2002 *************** *** 1,8 **** ! SQLite is an SQL database library that uses GDBM as its underlying ! file storage mechanism. Programs that link 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. WWW: http://www.hwaci.com/sw/sqlite/ --- 1,7 ---- ! SQLite is an SQL database engine in a C library. Programs that link 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. WWW: http://www.hwaci.com/sw/sqlite/ diff -r -C 3 ../sqlite.orig/pkg-plist ./pkg-plist *** ../sqlite.orig/pkg-plist Fri Jul 6 10:14:45 2001 --- ./pkg-plist Mon Sep 2 01:32:53 2002 *************** *** 1,25 **** bin/sqlite ! bin/gdbmdump ! bin/gdbmstat lib/libsqlite.a ! lib/libsqlite_p.a lib/libsqlite.so ! lib/libsqlite.so.1.0 lib/sqlite/pkgIndex.tcl @dirrm lib/sqlite - include/sqlite.h %%PORTDOCS%%share/doc/sqlite/arch.html %%PORTDOCS%%share/doc/sqlite/arch.png %%PORTDOCS%%share/doc/sqlite/c_interface.html %%PORTDOCS%%share/doc/sqlite/changes.html %%PORTDOCS%%share/doc/sqlite/crosscompile.html ! %%PORTDOCS%%share/doc/sqlite/dynload.html ! %%PORTDOCS%%share/doc/sqlite/fileformat.html %%PORTDOCS%%share/doc/sqlite/index.html %%PORTDOCS%%share/doc/sqlite/lang.html %%PORTDOCS%%share/doc/sqlite/mingw.html %%PORTDOCS%%share/doc/sqlite/opcode.html %%PORTDOCS%%share/doc/sqlite/sqlite.html %%PORTDOCS%%share/doc/sqlite/tclsqlite.html %%PORTDOCS%%share/doc/sqlite/vdbe.html %%PORTDOCS%%@dirrm share/doc/sqlite --- 1,31 ---- bin/sqlite ! include/sqlite.h lib/libsqlite.a ! lib/libsqlite.la lib/libsqlite.so ! lib/libsqlite.so.0 ! lib/sqlite/libtclsqlite.so.0 ! lib/sqlite/libtclsqlite.so ! lib/sqlite/libtclsqlite.la ! lib/sqlite/libtclsqlite.a lib/sqlite/pkgIndex.tcl @dirrm lib/sqlite %%PORTDOCS%%share/doc/sqlite/arch.html %%PORTDOCS%%share/doc/sqlite/arch.png %%PORTDOCS%%share/doc/sqlite/c_interface.html %%PORTDOCS%%share/doc/sqlite/changes.html %%PORTDOCS%%share/doc/sqlite/crosscompile.html ! %%PORTDOCS%%share/doc/sqlite/download.html ! %%PORTDOCS%%share/doc/sqlite/faq.html %%PORTDOCS%%share/doc/sqlite/index.html %%PORTDOCS%%share/doc/sqlite/lang.html + %%PORTDOCS%%share/doc/sqlite/lemon.html %%PORTDOCS%%share/doc/sqlite/mingw.html %%PORTDOCS%%share/doc/sqlite/opcode.html + %%PORTDOCS%%share/doc/sqlite/report1.txt + %%PORTDOCS%%share/doc/sqlite/speed.html %%PORTDOCS%%share/doc/sqlite/sqlite.html %%PORTDOCS%%share/doc/sqlite/tclsqlite.html %%PORTDOCS%%share/doc/sqlite/vdbe.html + %%PORTDOCS%%share/doc/sqlite/example.tcl %%PORTDOCS%%@dirrm share/doc/sqlite
Small problem so far post-install: ${INSTALL_DATA} ${FILESDIR}/pkgIndex.tcl ${PREFIX}/lib/sqlite/ lib/sqlite isn't being created, atleast on my system. -- David W. Chapman Jr. dwcjr@inethouston.net Raintree Network Services, Inc. <www.inethouston.net> dwcjr@freebsd.org FreeBSD Committer <www.FreeBSD.org>
State Changed From-To: feedback->closed Committed, thanks!
* David W. Chapman Jr. <dwcjr@inethouston.net> [2002-09-01 21:40 -0500]: > Small problem so far > > post-install: > ${INSTALL_DATA} ${FILESDIR}/pkgIndex.tcl ${PREFIX}/lib/sqlite/ > > lib/sqlite isn't being created, atleast on my system. Strange. files/patch-makefile has a line: mkdir -p $(prefix)/lib/sqlite I confess this line could be moved into the ports Makefile for clarity. But it should still work, and does for me. -- Gerhard