| OLD | NEW |
| (Empty) |
| 1 #!/bin/sh | |
| 2 # | |
| 3 # This script is used to compile SQLite and package everything up | |
| 4 # so that it is ready to move to the SQLite website. | |
| 5 # | |
| 6 | |
| 7 # Set srcdir to the name of the directory that contains the publish.sh | |
| 8 # script. | |
| 9 # | |
| 10 srcdir=`echo "$0" | sed 's%\(^.*\)/[^/][^/]*$%\1%'` | |
| 11 | |
| 12 # Get the makefile. | |
| 13 # | |
| 14 cp $srcdir/Makefile.linux-gcc ./Makefile | |
| 15 chmod +x $srcdir/install-sh | |
| 16 | |
| 17 # Get the current version number - needed to help build filenames | |
| 18 # | |
| 19 VERS=`cat $srcdir/VERSION` | |
| 20 VERSW=`sed 's/\./_/g' $srcdir/VERSION` | |
| 21 echo "VERSIONS: $VERS $VERSW" | |
| 22 | |
| 23 # Start by building an sqlite shell for linux. | |
| 24 # | |
| 25 make clean | |
| 26 make sqlite3.c | |
| 27 CFLAGS="-Os -DSQLITE_ENABLE_FTS3=0 -DSQLITE_ENABLE_RTREE=0" | |
| 28 CFLAGS="$CFLAGS -DSQLITE_THREADSAFE=0" | |
| 29 echo '***** '"COMPILING sqlite3-$VERS.bin..." | |
| 30 gcc $CFLAGS -Itsrc sqlite3.c tsrc/shell.c -o sqlite3 -ldl | |
| 31 strip sqlite3 | |
| 32 mv sqlite3 sqlite3-$VERS.bin | |
| 33 gzip sqlite3-$VERS.bin | |
| 34 chmod 644 sqlite3-$VERS.bin.gz | |
| 35 mv sqlite3-$VERS.bin.gz doc | |
| 36 | |
| 37 # Build a source archive useful for windows. | |
| 38 # | |
| 39 make target_source | |
| 40 cd tsrc | |
| 41 echo '***** BUILDING preprocessed source archives' | |
| 42 rm fts[12]* icu* | |
| 43 rm -f ../doc/sqlite-source-$VERSW.zip | |
| 44 zip ../doc/sqlite-source-$VERSW.zip * | |
| 45 cd .. | |
| 46 cp tsrc/sqlite3.h tsrc/sqlite3ext.h . | |
| 47 pwd | |
| 48 zip doc/sqlite-amalgamation-$VERSW.zip sqlite3.c sqlite3.h sqlite3ext.h | |
| 49 | |
| 50 # Build the sqlite.so and tclsqlite.so shared libraries | |
| 51 # under Linux | |
| 52 # | |
| 53 TCLDIR=/home/drh/tcltk/846/linux/846linux | |
| 54 TCLSTUBLIB=$TCLDIR/libtclstub8.4g.a | |
| 55 CFLAGS="-Os -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1" | |
| 56 CFLAGS="$CFLAGS -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1" | |
| 57 CFLAGS="$CFLAGS -DSQLITE_ENABLE_COLUMN_METADATA=1" | |
| 58 echo '***** BUILDING shared libraries for linux' | |
| 59 gcc $CFLAGS -shared tclsqlite3.c $TCLSTUBLIB -o tclsqlite3.so -lpthread | |
| 60 strip tclsqlite3.so | |
| 61 chmod 644 tclsqlite3.so | |
| 62 mv tclsqlite3.so tclsqlite-$VERS.so | |
| 63 gzip tclsqlite-$VERS.so | |
| 64 mv tclsqlite-$VERS.so.gz doc | |
| 65 gcc $CFLAGS -shared sqlite3.c -o sqlite3.so -lpthread | |
| 66 strip sqlite3.so | |
| 67 chmod 644 sqlite3.so | |
| 68 mv sqlite3.so sqlite-$VERS.so | |
| 69 gzip sqlite-$VERS.so | |
| 70 mv sqlite-$VERS.so.gz doc | |
| 71 | |
| 72 | |
| 73 # Build the tclsqlite3.dll and sqlite3.dll shared libraries. | |
| 74 # | |
| 75 . $srcdir/mkdll.sh | |
| 76 echo '***** PACKAGING shared libraries for windows' | |
| 77 echo zip doc/tclsqlite-$VERSW.zip tclsqlite3.dll | |
| 78 zip doc/tclsqlite-$VERSW.zip tclsqlite3.dll | |
| 79 echo zip doc/sqlitedll-$VERSW.zip sqlite3.dll sqlite3.def | |
| 80 zip doc/sqlitedll-$VERSW.zip sqlite3.dll sqlite3.def | |
| 81 | |
| 82 # Build the sqlite.exe executable for windows. | |
| 83 # | |
| 84 OPTS='-DSTATIC_BUILD=1 -DNDEBUG=1 -DSQLITE_THREADSAFE=0' | |
| 85 OPTS="$OPTS -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_RTREE=1" | |
| 86 i386-mingw32msvc-gcc -Os $OPTS -Itsrc -I$TCLDIR sqlite3.c tsrc/shell.c \ | |
| 87 -o sqlite3.exe | |
| 88 zip doc/sqlite-$VERSW.zip sqlite3.exe | |
| 89 | |
| 90 # Construct a tarball of the source tree | |
| 91 # | |
| 92 echo '***** BUILDING source archive' | |
| 93 ORIGIN=`pwd` | |
| 94 cd $srcdir | |
| 95 cd .. | |
| 96 mv sqlite sqlite-$VERS | |
| 97 EXCLUDE=`find sqlite-$VERS -print | egrep '(www/|art/|doc/|contrib/|_FOSSIL_)' |
sed 's,^, --exclude ,'` | |
| 98 echo "tar czf $ORIGIN/doc/sqlite-$VERS.tar.gz $EXCLUDE sqlite-$VERS" | |
| 99 tar czf $ORIGIN/doc/sqlite-$VERS.tar.gz $EXCLUDE sqlite-$VERS | |
| 100 mv sqlite-$VERS sqlite | |
| 101 cd $ORIGIN | |
| 102 | |
| 103 # | |
| 104 # Build RPMS (binary) and Source RPM | |
| 105 # | |
| 106 | |
| 107 # Make sure we are properly setup to build RPMs | |
| 108 # | |
| 109 echo "%HOME %{expand:%%(cd; pwd)}" > $HOME/.rpmmacros | |
| 110 echo "%_topdir %{HOME}/rpm" >> $HOME/.rpmmacros | |
| 111 mkdir $HOME/rpm | |
| 112 mkdir $HOME/rpm/BUILD | |
| 113 mkdir $HOME/rpm/SOURCES | |
| 114 mkdir $HOME/rpm/RPMS | |
| 115 mkdir $HOME/rpm/SRPMS | |
| 116 mkdir $HOME/rpm/SPECS | |
| 117 | |
| 118 # create the spec file from the template | |
| 119 sed s/SQLITE_VERSION/$VERS/g $srcdir/spec.template > $HOME/rpm/SPECS/sqlite.spec | |
| 120 | |
| 121 # copy the source tarball to the rpm directory | |
| 122 cp doc/sqlite-$VERS.tar.gz $HOME/rpm/SOURCES/. | |
| 123 | |
| 124 # build all the rpms | |
| 125 rpm -ba $HOME/rpm/SPECS/sqlite.spec >& rpm-$vers.log | |
| 126 | |
| 127 # copy the RPMs into the build directory. | |
| 128 mv $HOME/rpm/RPMS/i386/sqlite*-$vers*.rpm doc | |
| 129 mv $HOME/rpm/SRPMS/sqlite-$vers*.rpm doc | |
| 130 | |
| 131 # Build the website | |
| 132 # | |
| 133 #cp $srcdir/../historical/* doc | |
| 134 #make doc | |
| 135 #cd doc | |
| 136 #chmod 644 *.gz | |
| OLD | NEW |