aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--Checksums1
-rw-r--r--GNUmakefile33
-rw-r--r--README.md11
4 files changed, 50 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..08d6074
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+build
+libsqlite3.a
+sqlite-autoconf-3080900.tar.gz
+sqlite3
+sqlite3.h
diff --git a/Checksums b/Checksums
new file mode 100644
index 0000000..2ae55f8
--- /dev/null
+++ b/Checksums
@@ -0,0 +1 @@
+76ebb6392cd2289fbff903af7ff67f3e49bd01ff30544b8028ecededd60269a2 sqlite-autoconf-3080900.tar.gz
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..cb10c3f
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,33 @@
+# Download and build SQLite3 from source with the options we want.
+
+URL := http://sqlite.org/2015/sqlite-autoconf-3080900.tar.gz
+OPTIONS := --enable-static --disable-shared CFLAGS=-fPIC LDFLAGS=-fPIC
+
+TOP := $(shell pwd)
+TARBALL := ${TOP}/$(notdir ${URL})
+BUILD := ${TOP}/build
+OUTPUT := ${BUILD}/sqlite3.h ${BUILD}/.libs/libsqlite3.a ${BUILD}/sqlite3
+TARGETS := $(notdir ${OUTPUT})
+
+all: ${TARGETS}
+
+clean:
+ rm -rf ${BUILD} ${TARGETS}
+
+distclean: clean
+ rm -f ${TARBALL}
+
+${TARBALL}:
+ wget ${URL}
+
+${BUILD}/.build_done: ${TARBALL} GNUmakefile
+ sha256sum --check Checksums
+ rm -rf ${BUILD}
+ mkdir ${BUILD}
+ cd ${BUILD}; tar -xf ${TARBALL} --strip-components=1
+ cd ${BUILD}; ./configure ${OPTIONS}
+ cd ${BUILD}; make
+ ln -f ${OUTPUT} .
+ touch $@
+
+${TARGETS}: ${BUILD}/.build_done
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0205e5d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,11 @@
+SQLite3
+=======
+
+This is a trivial port of the SQLite3 database package to the Cryptech
+environment. At least for now, this just downloads the source
+package, checks that the SHA-256 digest of the source tarball matches
+a known value, and builds the package with the options we want.
+
+If we end up making heavier use of SQLite3 as the project progresses,
+we may need something more elaborate (eg, to enable SQLite3's "bare
+flash" driver), but this should suffice for the moment.