2001-09-28 21:47:14 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2007-11-23 18:12:44 +03:00
|
|
|
# This script is used to compile SQLite and package everything up
|
|
|
|
# so that it is ready to move to the SQLite website.
|
2001-09-28 21:47:14 +04:00
|
|
|
#
|
|
|
|
|
|
|
|
# Set srcdir to the name of the directory that contains the publish.sh
|
|
|
|
# script.
|
|
|
|
#
|
|
|
|
srcdir=`echo "$0" | sed 's%\(^.*\)/[^/][^/]*$%\1%'`
|
|
|
|
|
|
|
|
# Get the makefile.
|
|
|
|
#
|
2002-08-14 00:45:39 +04:00
|
|
|
cp $srcdir/Makefile.linux-gcc ./Makefile
|
2004-01-27 20:46:55 +03:00
|
|
|
chmod +x $srcdir/install-sh
|
2001-09-28 21:47:14 +04:00
|
|
|
|
2004-06-16 07:02:00 +04:00
|
|
|
# Get the current version number - needed to help build filenames
|
|
|
|
#
|
|
|
|
VERS=`cat $srcdir/VERSION`
|
|
|
|
VERSW=`sed 's/\./_/g' $srcdir/VERSION`
|
2007-04-02 19:04:34 +04:00
|
|
|
echo "VERSIONS: $VERS $VERSW"
|
2004-06-16 07:02:00 +04:00
|
|
|
|
|
|
|
# Start by building an sqlite shell for linux.
|
2001-09-28 21:47:14 +04:00
|
|
|
#
|
|
|
|
make clean
|
2007-04-02 19:04:34 +04:00
|
|
|
make sqlite3.c
|
2008-05-27 00:19:25 +04:00
|
|
|
CFLAGS="-Os -DSQLITE_ENABLE_FTS3=0 -DSQLITE_ENABLE_RTREE=0"
|
|
|
|
CFLAGS="$CFLAGS -DSQLITE_THREADSAFE=0"
|
2007-11-27 20:38:14 +03:00
|
|
|
echo '***** '"COMPILING sqlite3-$VERS.bin..."
|
2007-11-27 21:45:31 +03:00
|
|
|
gcc $CFLAGS -Itsrc sqlite3.c tsrc/shell.c -o sqlite3 -ldl
|
2004-06-16 07:02:00 +04:00
|
|
|
strip sqlite3
|
|
|
|
mv sqlite3 sqlite3-$VERS.bin
|
|
|
|
gzip sqlite3-$VERS.bin
|
2007-04-02 19:04:34 +04:00
|
|
|
chmod 644 sqlite3-$VERS.bin.gz
|
2004-06-16 07:02:00 +04:00
|
|
|
mv sqlite3-$VERS.bin.gz doc
|
2001-09-28 21:47:14 +04:00
|
|
|
|
2004-08-28 20:19:00 +04:00
|
|
|
# Build a source archive useful for windows.
|
2001-09-28 21:47:14 +04:00
|
|
|
#
|
2007-05-08 22:30:36 +04:00
|
|
|
make target_source
|
|
|
|
cd tsrc
|
2007-11-27 20:38:14 +03:00
|
|
|
echo '***** BUILDING preprocessed source archives'
|
2008-01-31 19:36:40 +03:00
|
|
|
rm fts[12]* icu*
|
2007-05-08 22:30:36 +04:00
|
|
|
rm -f ../doc/sqlite-source-$VERSW.zip
|
|
|
|
zip ../doc/sqlite-source-$VERSW.zip *
|
|
|
|
cd ..
|
2007-10-01 17:59:48 +04:00
|
|
|
cp tsrc/sqlite3.h tsrc/sqlite3ext.h .
|
2007-04-02 19:04:34 +04:00
|
|
|
pwd
|
2007-10-01 17:59:48 +04:00
|
|
|
zip doc/sqlite-amalgamation-$VERSW.zip sqlite3.c sqlite3.h sqlite3ext.h
|
2004-08-28 20:19:00 +04:00
|
|
|
|
|
|
|
# Build the sqlite.so and tclsqlite.so shared libraries
|
|
|
|
# under Linux
|
|
|
|
#
|
2007-04-02 19:04:34 +04:00
|
|
|
TCLDIR=/home/drh/tcltk/846/linux/846linux
|
|
|
|
TCLSTUBLIB=$TCLDIR/libtclstub8.4g.a
|
2008-05-27 00:19:25 +04:00
|
|
|
CFLAGS="-Os -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1"
|
|
|
|
CFLAGS="$CFLAGS -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1"
|
2007-11-27 20:38:14 +03:00
|
|
|
echo '***** BUILDING shared libraries for linux'
|
2007-12-10 20:55:16 +03:00
|
|
|
gcc $CFLAGS -shared tclsqlite3.c $TCLSTUBLIB -o tclsqlite3.so -lpthread
|
2007-04-02 19:04:34 +04:00
|
|
|
strip tclsqlite3.so
|
|
|
|
chmod 644 tclsqlite3.so
|
2004-08-28 20:19:00 +04:00
|
|
|
mv tclsqlite3.so tclsqlite-$VERS.so
|
2004-06-16 07:02:00 +04:00
|
|
|
gzip tclsqlite-$VERS.so
|
2007-04-02 19:04:34 +04:00
|
|
|
mv tclsqlite-$VERS.so.gz doc
|
2007-12-10 20:55:16 +03:00
|
|
|
gcc $CFLAGS -shared sqlite3.c -o sqlite3.so -lpthread
|
2007-04-02 19:04:34 +04:00
|
|
|
strip sqlite3.so
|
|
|
|
chmod 644 sqlite3.so
|
2004-08-28 20:19:00 +04:00
|
|
|
mv sqlite3.so sqlite-$VERS.so
|
2004-06-16 07:02:00 +04:00
|
|
|
gzip sqlite-$VERS.so
|
2007-04-02 19:04:34 +04:00
|
|
|
mv sqlite-$VERS.so.gz doc
|
|
|
|
|
2001-09-28 21:47:14 +04:00
|
|
|
|
2004-08-28 20:19:00 +04:00
|
|
|
# Build the tclsqlite3.dll and sqlite3.dll shared libraries.
|
2001-09-28 21:47:14 +04:00
|
|
|
#
|
2004-08-28 20:19:00 +04:00
|
|
|
. $srcdir/mkdll.sh
|
2007-11-27 20:38:14 +03:00
|
|
|
echo '***** PACKAGING shared libraries for windows'
|
2007-04-02 19:04:34 +04:00
|
|
|
echo zip doc/tclsqlite-$VERSW.zip tclsqlite3.dll
|
|
|
|
zip doc/tclsqlite-$VERSW.zip tclsqlite3.dll
|
|
|
|
echo zip doc/sqlitedll-$VERSW.zip sqlite3.dll sqlite3.def
|
|
|
|
zip doc/sqlitedll-$VERSW.zip sqlite3.dll sqlite3.def
|
2001-09-28 21:47:14 +04:00
|
|
|
|
|
|
|
# Build the sqlite.exe executable for windows.
|
|
|
|
#
|
2007-11-27 20:38:14 +03:00
|
|
|
OPTS='-DSTATIC_BUILD=1 -DNDEBUG=1 -DSQLITE_THREADSAFE=0'
|
2008-05-27 00:19:25 +04:00
|
|
|
OPTS="$OPTS -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_RTREE=1"
|
2007-05-08 22:30:36 +04:00
|
|
|
i386-mingw32msvc-gcc -Os $OPTS -Itsrc -I$TCLDIR sqlite3.c tsrc/shell.c \
|
2007-04-02 19:04:34 +04:00
|
|
|
-o sqlite3.exe
|
|
|
|
zip doc/sqlite-$VERSW.zip sqlite3.exe
|
2001-09-28 21:47:14 +04:00
|
|
|
|
|
|
|
# Construct a tarball of the source tree
|
|
|
|
#
|
2007-11-27 20:38:14 +03:00
|
|
|
echo '***** BUILDING source archive'
|
2001-09-28 21:47:14 +04:00
|
|
|
ORIGIN=`pwd`
|
|
|
|
cd $srcdir
|
|
|
|
cd ..
|
2005-02-15 19:15:09 +03:00
|
|
|
mv sqlite sqlite-$VERS
|
2007-11-27 20:38:14 +03:00
|
|
|
EXCLUDE=`find sqlite-$VERS -print | egrep (CVS|www/|art/|doc/|contrib/) | sed 's,^, --exclude ,'`
|
2005-02-15 19:15:09 +03:00
|
|
|
tar czf $ORIGIN/doc/sqlite-$VERS.tar.gz $EXCLUDE sqlite-$VERS
|
|
|
|
mv sqlite-$VERS sqlite
|
2001-09-28 21:47:14 +04:00
|
|
|
cd $ORIGIN
|
|
|
|
|
2002-03-29 04:29:53 +03:00
|
|
|
#
|
|
|
|
# Build RPMS (binary) and Source RPM
|
|
|
|
#
|
|
|
|
|
2002-03-29 21:16:04 +03:00
|
|
|
# Make sure we are properly setup to build RPMs
|
|
|
|
#
|
|
|
|
echo "%HOME %{expand:%%(cd; pwd)}" > $HOME/.rpmmacros
|
|
|
|
echo "%_topdir %{HOME}/rpm" >> $HOME/.rpmmacros
|
|
|
|
mkdir $HOME/rpm
|
|
|
|
mkdir $HOME/rpm/BUILD
|
|
|
|
mkdir $HOME/rpm/SOURCES
|
|
|
|
mkdir $HOME/rpm/RPMS
|
|
|
|
mkdir $HOME/rpm/SRPMS
|
|
|
|
mkdir $HOME/rpm/SPECS
|
2002-03-29 04:29:53 +03:00
|
|
|
|
|
|
|
# create the spec file from the template
|
2004-06-16 07:02:00 +04:00
|
|
|
sed s/SQLITE_VERSION/$VERS/g $srcdir/spec.template > $HOME/rpm/SPECS/sqlite.spec
|
2002-03-29 04:29:53 +03:00
|
|
|
|
|
|
|
# copy the source tarball to the rpm directory
|
2004-06-16 07:02:00 +04:00
|
|
|
cp doc/sqlite-$VERS.tar.gz $HOME/rpm/SOURCES/.
|
2002-03-29 04:29:53 +03:00
|
|
|
|
|
|
|
# build all the rpms
|
|
|
|
rpm -ba $HOME/rpm/SPECS/sqlite.spec >& rpm-$vers.log
|
|
|
|
|
2002-03-29 21:16:04 +03:00
|
|
|
# copy the RPMs into the build directory.
|
2004-06-16 07:02:00 +04:00
|
|
|
mv $HOME/rpm/RPMS/i386/sqlite*-$vers*.rpm doc
|
|
|
|
mv $HOME/rpm/SRPMS/sqlite-$vers*.rpm doc
|
2002-03-29 04:29:53 +03:00
|
|
|
|
2001-09-28 21:47:14 +04:00
|
|
|
# Build the website
|
|
|
|
#
|
2004-07-22 22:53:17 +04:00
|
|
|
#cp $srcdir/../historical/* doc
|
2007-11-23 18:12:44 +03:00
|
|
|
#make doc
|
|
|
|
#cd doc
|
|
|
|
#chmod 644 *.gz
|