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