📄 publish.sh
字号:
#!/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.#cp $srcdir/Makefile.linux-gcc ./Makefile# Start building stuff.#make cleanmake sqlitestrip sqlitemv sqlite sqlite.binrm -f sqlite.bin.gzgzip sqlite.bin# Build the tclsqlite.so shared library for import into tclsh or wish# under Linux#make target_sourcerm sqlite_source.zipcd tsrczip ../sqlite_source.zip *rm shell.cTCLDIR=/home/drh/tcltk/8.2linuxTCLSTUBLIB=$TCLDIR/libtclstub8.2g.aOPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1'gcc -fPIC $OPTS -O2 -I. -I$TCLDIR -shared *.c $TCLSTUBLIB -o tclsqlite.sostrip tclsqlite.somv tclsqlite.so ..rm tclsqlite.cgcc -fPIC -DNDEBUG=1 -O2 -I. -shared *.c -o sqlite.sostrip sqlite.somv sqlite.so ..cd ..rm -f tclsqlite.so.gz sqlite.so.gzgzip tclsqlite.sogzip sqlite.so# Build the tclsqlite.dll shared library that can be imported into tclsh# or wish on windows.#make target_sourcecd tsrcrm shell.cTCLDIR=/home/drh/tcltk/8.2winTCLSTUBLIB=$TCLDIR/tclstub82.aPATH=$PATH:/opt/mingw/binOPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1 -DTHREADSAFE=1'CC="i386-mingw32msvc-gcc -O2 $OPTS -I. -I$TCLDIR"rm shell.cfor i in *.c; do CMD="$CC -c $i" echo $CMD $CMDdoneecho 'EXPORTS' >tclsqlite.defecho 'Tclsqlite_Init' >>tclsqlite.defecho 'Sqlite_Init' >>tclsqlite.defi386-mingw32msvc-dllwrap \ --def tclsqlite.def -v --export-all \ --driver-name i386-mingw32msvc-gcc \ --dlltool-name i386-mingw32msvc-dlltool \ --as i386-mingw32msvc-as \ --target i386-mingw32 \ -dllname tclsqlite.dll -lmsvcrt *.o $TCLSTUBLIBi386-mingw32msvc-strip tclsqlite.dllmv tclsqlite.dll ..rm tclsqlite.ocat >sqlite.def <<\END_OF_FILEEXPORTSsqlite_opensqlite_closesqlite_execsqlite_last_insert_rowidsqlite_error_stringsqlite_interruptsqlite_completesqlite_busy_handlersqlite_busy_timeoutsqlite_get_tablesqlite_free_tablesqlite_mprintfsqlite_vmprintfsqlite_exec_printfsqlite_exec_vprintfsqlite_get_table_printfsqlite_get_table_vprintfsqlite_freememsqlite_libversionsqlite_libencodingsqlite_changessqlite_create_functionsqlite_create_aggregatesqlite_function_typesqlite_user_datasqlite_aggregate_contextsqlite_aggregate_countsqlite_set_result_stringsqlite_set_result_intsqlite_set_result_doublesqlite_set_result_errorsqliteMallocsqliteFreesqliteReallocsqlite_set_authorizersqlite_tracesqlite_compilesqlite_stepsqlite_finalizeEND_OF_FILEi386-mingw32msvc-dllwrap \ --def sqlite.def -v --export-all \ --driver-name i386-mingw32msvc-gcc \ --dlltool-name i386-mingw32msvc-dlltool \ --as i386-mingw32msvc-as \ --target i386-mingw32 \ -dllname sqlite.dll -lmsvcrt *.oi386-mingw32msvc-strip sqlite.dllmv sqlite.dll sqlite.def ..cd ..rm -f tclsqlite.zip sqlitedll.zipzip tclsqlite.zip tclsqlite.dllzip sqlitedll.zip sqlite.dll sqlite.def# Build the sqlite.exe executable for windows.#make target_sourcecd tsrcrm tclsqlite.cOPTS='-DSTATIC_BUILD=1 -DNDEBUG=1'i386-mingw32msvc-gcc -O2 $OPTS -I. -I$TCLDIR *.c -o sqlite.exemv sqlite.exe ..cd ..rm -f sqlite.zipzip sqlite.zip sqlite.exe# Construct a tarball of the source tree#ORIGIN=`pwd`cd $srcdircd ..EXCLUDE=`find sqlite -print | grep CVS | sed 's,sqlite/, --exclude sqlite/,'`tar czf $ORIGIN/sqlite.tar.gz $EXCLUDE sqlitecd $ORIGINvers=`cat $srcdir/VERSION`rm -f sqlite-$vers.tar.gzln sqlite.tar.gz sqlite-$vers.tar.gz## 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 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.ln $HOME/rpm/RPMS/i386/sqlite*-$vers*.rpm .ln $HOME/rpm/SRPMS/sqlite-$vers*.rpm .# Build the website#cp $srcdir/../historical/* .rm -rf docmake docln sqlite.bin.gz sqlite.zip sqlite*.tar.gz tclsqlite.so.gz tclsqlite.zip docln sqlitedll.zip sqlite.so.gz sqlite_source.zip docln *.rpm doc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -