📄 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%'`# Clear out the build directory "doc"##rm -rf doc#make doc# 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.#make cleanmake sqlitestrip sqlitemv sqlite sqlite-$VERS.binrm -f sqlite.bin.gzgzip sqlite-$VERS.binmv sqlite-$VERS.bin.gz doc# Build the tclsqlite.so shared library for import into tclsh or wish# under Linux#make target_sourcerm -f doc/sqlite-source-$VERSW.zipcd tsrczip ../doc/sqlite-source-$VERSW.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 tclsqlite-$VERS.sogzip tclsqlite-$VERS.somv tclsqlite-$VERS.so.gz ../docrm tclsqlite.cgcc -fPIC -DNDEBUG=1 -O2 -I. -shared *.c -o sqlite.sostrip sqlite.somv sqlite.so sqlite-$VERS.sogzip sqlite-$VERS.somv sqlite-$VERS.so.gz ../doccd ..# 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.dll#mv tclsqlite.dll ../tclsqlite-$VERSW.dllrm 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_finalizesqlite_resetsqlite_bindsqlite_last_statement_changessqlite_encode_binarysqlite_decode_binaryEND_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.dllzip ../doc/tclsqlite-$VERSW.zip tclsqlite.dllzip ../doc/sqlitedll-$VERSW.zip sqlite.dll sqlite.defcd ..# 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.exezip ../doc/sqlite-$VERSW.zip sqlite.execd ..# Construct a tarball of the source tree#ORIGIN=`pwd`cd $srcdircd ..mv sqlite_v2 sqlite-$VERSEXCLUDE=`find sqlite-$VERS -print | grep CVS | sed 's,^, --exclude ,'`tar czf $ORIGIN/doc/sqlite-$VERS.tar.gz $EXCLUDE sqlite-$VERSmv sqlite-$VERS sqlite_v2cd $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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -