📄 publish.sh
字号:
#!/bin/sh## This script is used to compile SQLite and package everything up# so that it is ready to move to the SQLite website.## Set srcdir to the name of the directory that contains the publish.sh# script.#srcdir=`echo "$0" | sed 's%\(^.*\)/[^/][^/]*$%\1%'`# Get the makefile.#cp $srcdir/Makefile.linux-gcc ./Makefilechmod +x $srcdir/install-sh# Get the current version number - needed to help build filenames#VERS=`cat $srcdir/VERSION`VERSW=`sed 's/\./_/g' $srcdir/VERSION`echo "VERSIONS: $VERS $VERSW"# Start by building an sqlite shell for linux.#make cleanmake sqlite3.cCFLAGS="-Os -DSQLITE_ENABLE_FTS3=0 -DSQLITE_ENABLE_RTREE=0"CFLAGS="$CFLAGS -DSQLITE_THREADSAFE=0"echo '***** '"COMPILING sqlite3-$VERS.bin..."gcc $CFLAGS -Itsrc sqlite3.c tsrc/shell.c -o sqlite3 -ldlstrip sqlite3mv sqlite3 sqlite3-$VERS.bingzip sqlite3-$VERS.binchmod 644 sqlite3-$VERS.bin.gzmv sqlite3-$VERS.bin.gz doc# Build a source archive useful for windows.#make target_sourcecd tsrcecho '***** BUILDING preprocessed source archives'rm fts[12]* icu*rm -f ../doc/sqlite-source-$VERSW.zipzip ../doc/sqlite-source-$VERSW.zip *cd ..cp tsrc/sqlite3.h tsrc/sqlite3ext.h .pwdzip doc/sqlite-amalgamation-$VERSW.zip sqlite3.c sqlite3.h sqlite3ext.h# Build the sqlite.so and tclsqlite.so shared libraries# under Linux#TCLDIR=/home/drh/tcltk/846/linux/846linuxTCLSTUBLIB=$TCLDIR/libtclstub8.4g.aCFLAGS="-Os -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1"CFLAGS="$CFLAGS -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1"CFLAGS="$CFLAGS -DSQLITE_ENABLE_COLUMN_METADATA=1"echo '***** BUILDING shared libraries for linux'gcc $CFLAGS -shared tclsqlite3.c $TCLSTUBLIB -o tclsqlite3.so -lpthreadstrip tclsqlite3.sochmod 644 tclsqlite3.somv tclsqlite3.so tclsqlite-$VERS.sogzip tclsqlite-$VERS.somv tclsqlite-$VERS.so.gz docgcc $CFLAGS -shared sqlite3.c -o sqlite3.so -lpthreadstrip sqlite3.sochmod 644 sqlite3.somv sqlite3.so sqlite-$VERS.sogzip sqlite-$VERS.somv sqlite-$VERS.so.gz doc# Build the tclsqlite3.dll and sqlite3.dll shared libraries.#. $srcdir/mkdll.shecho '***** PACKAGING shared libraries for windows'echo zip doc/tclsqlite-$VERSW.zip tclsqlite3.dllzip doc/tclsqlite-$VERSW.zip tclsqlite3.dllecho zip doc/sqlitedll-$VERSW.zip sqlite3.dll sqlite3.defzip doc/sqlitedll-$VERSW.zip sqlite3.dll sqlite3.def# Build the sqlite.exe executable for windows.#OPTS='-DSTATIC_BUILD=1 -DNDEBUG=1 -DSQLITE_THREADSAFE=0'OPTS="$OPTS -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_RTREE=1"i386-mingw32msvc-gcc -Os $OPTS -Itsrc -I$TCLDIR sqlite3.c tsrc/shell.c \ -o sqlite3.exezip doc/sqlite-$VERSW.zip sqlite3.exe# Construct a tarball of the source tree#echo '***** BUILDING source archive'ORIGIN=`pwd`cd $srcdircd ..mv sqlite sqlite-$VERSEXCLUDE=`find sqlite-$VERS -print | egrep '(CVS|www/|art/|doc/|contrib/|_FOSSIL_|manifest)' | sed 's,^, --exclude ,'`echo "tar czf $ORIGIN/doc/sqlite-$VERS.tar.gz $EXCLUDE sqlite-$VERS"tar czf $ORIGIN/doc/sqlite-$VERS.tar.gz $EXCLUDE sqlite-$VERSmv sqlite-$VERS sqlitecd $ORIGIN## Build RPMS (binary) and Source RPM## Make sure we are properly setup to build RPMs#echo "%HOME %{expand:%%(cd; pwd)}" > $HOME/.rpmmacrosecho "%_topdir %{HOME}/rpm" >> $HOME/.rpmmacrosmkdir $HOME/rpmmkdir $HOME/rpm/BUILDmkdir $HOME/rpm/SOURCESmkdir $HOME/rpm/RPMSmkdir $HOME/rpm/SRPMSmkdir $HOME/rpm/SPECS# create the spec file from the templatesed s/SQLITE_VERSION/$VERS/g $srcdir/spec.template > $HOME/rpm/SPECS/sqlite.spec# copy the source tarball to the rpm directorycp doc/sqlite-$VERS.tar.gz $HOME/rpm/SOURCES/.# build all the rpmsrpm -ba $HOME/rpm/SPECS/sqlite.spec >& rpm-$vers.log# copy the RPMs into the build directory.mv $HOME/rpm/RPMS/i386/sqlite*-$vers*.rpm docmv $HOME/rpm/SRPMS/sqlite-$vers*.rpm doc# Build the website##cp $srcdir/../historical/* doc#make doc#cd doc#chmod 644 *.gz
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -