2013-05-27 22:37:33 +04:00
|
|
|
#!/bin/sh
|
|
|
|
# This script is used to build the amalgamation autoconf package.
|
|
|
|
# It assumes the following:
|
|
|
|
#
|
|
|
|
# 1. The files "sqlite3.c", "sqlite3.h" and "sqlite3ext.h"
|
|
|
|
# are available in the current directory.
|
|
|
|
#
|
|
|
|
# 2. Variable $TOP is set to the full path of the root directory
|
|
|
|
# of the SQLite source tree.
|
|
|
|
#
|
|
|
|
# 3. There is nothing of value in the ./mkpkg_tmp_dir directory.
|
|
|
|
# This is important, as the script executes "rm -rf ./mkpkg_tmp_dir".
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
# Bail out of the script if any command returns a non-zero exit
|
|
|
|
# status. Or if the script tries to use an unset variable. These
|
|
|
|
# may fail for old /bin/sh interpreters.
|
|
|
|
#
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
|
|
|
|
TMPSPACE=./mkpkg_tmp_dir
|
|
|
|
VERSION=`cat $TOP/VERSION`
|
2016-02-10 01:39:39 +03:00
|
|
|
HASH=`sed 's/^\(..........\).*/\1/' $TOP/manifest.uuid`
|
2016-02-10 16:36:17 +03:00
|
|
|
DATETIME=`grep '^D' $TOP/manifest | sed -e 's/[^0-9]//g' -e 's/\(............\).*/\1/'`
|
2013-05-27 22:37:33 +04:00
|
|
|
|
2016-02-10 01:39:39 +03:00
|
|
|
# If this script is given an argument of --snapshot, then generate a
|
|
|
|
# snapshot tarball named for the current checkout SHA1 hash, rather than
|
|
|
|
# the version number.
|
|
|
|
#
|
|
|
|
if test "$#" -ge 1 -a x$1 != x--snapshot
|
|
|
|
then
|
|
|
|
# Set global variable $ARTIFACT to the "3xxyyzz" string incorporated
|
|
|
|
# into artifact filenames. And $VERSION2 to the "3.x.y[.z]" form.
|
|
|
|
xx=`echo $VERSION|sed 's/3\.\([0-9]*\)\..*/\1/'`
|
|
|
|
yy=`echo $VERSION|sed 's/3\.[^.]*\.\([0-9]*\).*/\1/'`
|
|
|
|
zz=0
|
|
|
|
set +e
|
|
|
|
zz=`echo $VERSION|sed 's/3\.[^.]*\.[^.]*\.\([0-9]*\).*/\1/'|grep -v '\.'`
|
|
|
|
set -e
|
2016-02-10 01:54:39 +03:00
|
|
|
TARBALLNAME=`printf "sqlite-autoconf-3%.2d%.2d%.2d" $xx $yy $zz`
|
2016-02-10 01:39:39 +03:00
|
|
|
else
|
2016-02-10 01:54:39 +03:00
|
|
|
TARBALLNAME=sqlite-snapshot-$DATETIME
|
2016-02-10 01:39:39 +03:00
|
|
|
fi
|
2013-08-23 16:04:52 +04:00
|
|
|
|
2013-05-27 22:37:33 +04:00
|
|
|
rm -rf $TMPSPACE
|
2016-01-23 23:09:30 +03:00
|
|
|
cp -R $TOP/autoconf $TMPSPACE
|
|
|
|
cp sqlite3.c $TMPSPACE
|
|
|
|
cp sqlite3.h $TMPSPACE
|
|
|
|
cp sqlite3ext.h $TMPSPACE
|
|
|
|
cp $TOP/sqlite3.1 $TMPSPACE
|
|
|
|
cp $TOP/sqlite3.pc.in $TMPSPACE
|
2017-10-12 17:13:20 +03:00
|
|
|
cp shell.c $TMPSPACE
|
2016-01-23 23:09:30 +03:00
|
|
|
cp $TOP/src/sqlite3.rc $TMPSPACE
|
2016-02-27 02:13:16 +03:00
|
|
|
cp $TOP/tool/Replace.cs $TMPSPACE
|
2013-05-27 22:37:33 +04:00
|
|
|
|
|
|
|
cat $TMPSPACE/configure.ac |
|
2015-12-15 22:32:12 +03:00
|
|
|
sed "s/--SQLITE-VERSION--/$VERSION/" > $TMPSPACE/tmp
|
2013-05-27 22:37:33 +04:00
|
|
|
mv $TMPSPACE/tmp $TMPSPACE/configure.ac
|
|
|
|
|
|
|
|
cd $TMPSPACE
|
2015-12-15 22:32:12 +03:00
|
|
|
autoreconf -i
|
|
|
|
#libtoolize
|
|
|
|
#aclocal
|
|
|
|
#autoconf
|
|
|
|
#automake --add-missing
|
2013-05-27 22:37:33 +04:00
|
|
|
|
|
|
|
mkdir -p tea/generic
|
|
|
|
echo "#ifdef USE_SYSTEM_SQLITE" > tea/generic/tclsqlite3.c
|
|
|
|
echo "# include <sqlite3.h>" >> tea/generic/tclsqlite3.c
|
|
|
|
echo "#else" >> tea/generic/tclsqlite3.c
|
2014-08-19 13:15:41 +04:00
|
|
|
echo "#include \"sqlite3.c\"" >> tea/generic/tclsqlite3.c
|
2013-05-27 22:37:33 +04:00
|
|
|
echo "#endif" >> tea/generic/tclsqlite3.c
|
|
|
|
cat $TOP/src/tclsqlite.c >> tea/generic/tclsqlite3.c
|
|
|
|
|
2015-01-15 18:47:06 +03:00
|
|
|
cat tea/configure.ac |
|
2013-05-27 22:37:33 +04:00
|
|
|
sed "s/AC_INIT(\[sqlite\], .*)/AC_INIT([sqlite], [$VERSION])/" > tmp
|
2015-01-15 18:47:06 +03:00
|
|
|
mv tmp tea/configure.ac
|
2013-05-27 22:37:33 +04:00
|
|
|
|
|
|
|
cd tea
|
|
|
|
autoconf
|
|
|
|
rm -rf autom4te.cache
|
|
|
|
|
|
|
|
cd ../
|
|
|
|
./configure && make dist
|
2013-08-23 16:04:52 +04:00
|
|
|
tar -xzf sqlite-$VERSION.tar.gz
|
2016-02-10 01:54:39 +03:00
|
|
|
mv sqlite-$VERSION $TARBALLNAME
|
|
|
|
tar -czf $TARBALLNAME.tar.gz $TARBALLNAME
|
|
|
|
mv $TARBALLNAME.tar.gz ..
|
2016-02-10 01:39:39 +03:00
|
|
|
cd ..
|
2016-02-10 01:54:39 +03:00
|
|
|
ls -l $TARBALLNAME.tar.gz
|