Linux HOWTOs

About | Home | Search

HOWTO: sqlite
Description: Self-contained, embeddable, zero-configuration SQL database engine library
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# SQLite 3.26.0
# =============
# Slackware 13.37: sqlite 3.7.5
# Slackware 14.0: sqlite 3.7.13
# Slackware 14.1: sqlite 3.7.17
# Slackware 14.2: sqlite 3.13.0

# Prerequisites:
# Tcl (for the Tcl extension; see ./tea/)
# ncurses
# readline
# zlib
# pkg-config

# We use the autoconf amalgamation tarball here, bgut there are other
# options.  See the downloads page for other options.

# I use the /usr prefix here to match the Slackware package

# 3.26.0 release notes

# Get it
test -f installed/sqlite-autoconf-3260000.tar.gz &&
 mv installed/sqlite-autoconf-3260000.tar.gz .
test ! -f sqlite-autoconf-3260000.tar.gz &&

# Verify tarball w/ sha1sum:
echo "9af2df1a6da5db6e2ecf3f463625f16740e036\
e9  sqlite-autoconf-3260000.tar.gz" | sha1sum -c

# Extract it
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "sqlite-*" -exec rm -r {} \;
tar xzvf ~/sqlite-autoconf-3260000.tar.gz
cd sqlite-autoconf-3260000
test $UID = 0 && chown -R root:root .

# Read ./README.txt and ./INSTALL (generic autoconf)

# Create a build directory
mkdir bld
cd bld

# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
 ../configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man

# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
 ../configure --prefix=/usr --mandir=/usr/man

# Build it

# Become root to install it

# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg sqlite

# If you're sure there's not in use (at least check with lsof), zap old
# library files in case of issues
rm -f /usr/lib*/libsqlite3.* /usr/local/lib*/libsqlite3.*

# Install it
make install

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become yourself again

# Save the source for later
# Be careul here if you have other sqlite-* tarballs (e.g. sqlite-doc)
mkdir -p -m 0700 installed
rm -f installed/sqlite-*.tar.*
mv sqlite-autoconf-3260000.tar.gz installed/

# If you ever want to uninstall SQLite, this should do it:
for pfx in /usr /usr/local; do
  rm -f ${pfx}/bin/sqlite3 ${pfx}/include/sqlite3.h \
   ${pfx}/include/sqlite3ext.h ${pfx}/lib/libsqlite3.* \
find /usr/lib/tcl* -type d -name sqlite3 -exec rm -r {} \;
test -d /usr/lib64 &&
 find /usr/lib64/tcl* -type d -name sqlite3 -exec rm -r {} \;
find ~/src -maxdepth 1 -type d -name "sqlite-*" -exec rm -r {} \;
rm -f ~/installed/sqlite-*.tar.*

Back to the list

Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>