2001-09-28 21:47:14 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# This script is used to compile SQLite and all its documentation and
|
|
|
|
# ship everything up to the SQLite website. This script will only work
|
|
|
|
# on the system "zadok" at the Hwaci offices. But others might find
|
|
|
|
# the script useful as an example.
|
|
|
|
#
|
|
|
|
|
|
|
|
# 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`
|
|
|
|
|
|
|
|
# Start by building an sqlite shell for linux.
|
2001-09-28 21:47:14 +04:00
|
|
|
#
|
|
|
|
make clean
|
2004-06-16 07:02:00 +04:00
|
|
|
make sqlite3
|
|
|
|
strip sqlite3
|
|
|
|
mv sqlite3 sqlite3-$VERS.bin
|
|
|
|
gzip sqlite3-$VERS.bin
|
|
|
|
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
|
|
|
#
|
|
|
|
make target_source
|
|
|
|
cd tsrc
|
2004-06-18 19:13:48 +04:00
|
|
|
zip ../doc/sqlite-source-$VERSW.zip *
|
2004-08-28 20:19:00 +04:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Build the sqlite.so and tclsqlite.so shared libraries
|
|
|
|
# under Linux
|
|
|
|
#
|
|
|
|
. $srcdir/mkso.sh
|
|
|
|
cd tsrc
|
|
|
|
mv tclsqlite3.so tclsqlite-$VERS.so
|
2004-06-16 07:02:00 +04:00
|
|
|
gzip tclsqlite-$VERS.so
|
|
|
|
mv tclsqlite-$VERS.so.gz ../doc
|
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
|
|
|
|
mv sqlite-$VERS.so.gz ../doc
|
2001-09-28 21:47:14 +04:00
|
|
|
cd ..
|
|
|
|
|
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
|
2001-09-28 21:47:14 +04:00
|
|
|
cd tsrc
|
2004-07-22 22:44:23 +04:00
|
|
|
echo zip ../doc/tclsqlite-$VERSW.zip tclsqlite3.dll
|
2004-08-28 20:19:00 +04:00
|
|
|
zip ../doc/tclsqlite-$VERSW.zip tclsqlite3.dll
|
2004-07-22 22:44:23 +04:00
|
|
|
echo zip ../doc/sqlitedll-$VERSW.zip sqlite3.dll sqlite3.def
|
2004-08-28 20:19:00 +04:00
|
|
|
zip ../doc/sqlitedll-$VERSW.zip sqlite3.dll sqlite3.def
|
2001-09-28 21:47:14 +04:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Build the sqlite.exe executable for windows.
|
|
|
|
#
|
|
|
|
make target_source
|
|
|
|
cd tsrc
|
|
|
|
rm tclsqlite.c
|
2002-01-15 21:39:43 +03:00
|
|
|
OPTS='-DSTATIC_BUILD=1 -DNDEBUG=1'
|
2004-06-22 18:41:35 +04:00
|
|
|
i386-mingw32msvc-gcc -O2 $OPTS -I. -I$TCLDIR *.c -o sqlite3.exe
|
|
|
|
zip ../doc/sqlite-$VERSW.zip sqlite3.exe
|
2001-09-28 21:47:14 +04:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Construct a tarball of the source tree
|
|
|
|
#
|
|
|
|
ORIGIN=`pwd`
|
|
|
|
cd $srcdir
|
|
|
|
cd ..
|
2004-07-22 22:44:23 +04:00
|
|
|
EXCLUDE=`find sqlite -print | grep CVS | sed 's,^, --exclude ,'`
|
2004-06-16 07:02:00 +04:00
|
|
|
tar czf $ORIGIN/doc/sqlite-$VERS.tar.gz $EXCLUDE 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
|
2001-09-28 21:47:14 +04:00
|
|
|
make doc
|