diff options
-rwxr-xr-x | dist.sh | 255 | ||||
-rw-r--r-- | doc/README | 36 | ||||
-rw-r--r-- | doc/README-WIN | 46 | ||||
-rwxr-xr-x | git/commit.sh | 20 | ||||
-rwxr-xr-x | git/diff.sh | 16 | ||||
-rw-r--r-- | git/modules | 1 | ||||
-rwxr-xr-x | git/push.sh | 15 | ||||
-rwxr-xr-x | git/stash-pop.sh | 15 | ||||
-rwxr-xr-x | git/stash.sh | 15 | ||||
-rwxr-xr-x | git/stat.sh | 15 | ||||
-rwxr-xr-x | git/tag.sh | 20 |
11 files changed, 454 insertions, 0 deletions
@@ -0,0 +1,255 @@ +#! /usr/bin/env bash + +# Create ODB source distributions +# +# -rebuild +# -complete package/build libcutl and the ODB compiler; implies -rebuild +# -test +# -odb +# +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +wd=`pwd` +out_root=/tmp +src_root=$HOME/work/odb +ver=`cat $src_root/odb/version` + +test=n +rebuild=n +complete=n +odb=$src_root/odb/odb/odb + +CXXFLAGS="-W -Wall -Wno-unknown-pragmas" + +while [ $# -gt 0 ]; do + case $1 in + -rebuild) + rebuild=y + shift + ;; + -complete) + rebuild=y + complete=y + shift + ;; + -test) + test=y + shift + ;; + -odb) + shift + odb=$1 + shift + ;; + *) + error "unknown option: $1" + exit 1 + ;; + esac +done + +# Clean everything up if we are rebuilding. +# +if [ $rebuild = y ]; then + rm -rf $out_root/libodb/* + rm -rf $out_root/libodb-mysql/* + rm -rf $out_root/libodb-tracer/* + rm -rf $out_root/libodb-boost/* + rm -rf $out_root/odb-tests/* + rm -rf $out_root/odb-examples/* + + if [ $complete = y ]; then + rm -rf $out_root/libcutl/* + rm -rf $out_root/odb/* + fi + + rm -rf $out_root/pack +fi + +mkdir -p $out_root/libodb +mkdir -p $out_root/libodb-mysql +mkdir -p $out_root/libodb-tracer +mkdir -p $out_root/libodb-boost +mkdir -p $out_root/odb-tests +mkdir -p $out_root/odb-examples + +if [ $complete = y ]; then + mkdir -p $out_root/libcutl + mkdir -p $out_root/odb +fi + +mkdir -p $out_root/pack + +# Build libcutl +# +if [ $complete = y ]; then + cd $src_root/../cutl + ./dist.sh $out_root/libcutl + cd $wd +fi + +# Build ODB compiler +# +if [ $complete = y ]; then + make -C $src_root/odb dist dist_prefix=$out_root/odb + + cd $out_root/odb + + ./bootstrap + ./configure --with-libcutl=../libcutl CXX=g++-4.5 CXXFLAGS="$CXXFLAGS" + + make -j 8 + make dist + + cd $wd + + cp $out_root/odb/odb-$ver.zip $out_root/pack/ + cp $out_root/odb/odb-$ver.tar.gz $out_root/pack/ + cp $out_root/odb/odb-$ver.tar.bz2 $out_root/pack/ + + odb=$out_root/odb/odb/odb +fi + +# Build libodb +# +make -C $src_root/libodb dist dist_prefix=$out_root/libodb + +cd $out_root/libodb + +if [ $rebuild = y ]; then + ./bootstrap + ./configure CXXFLAGS="$CXXFLAGS" +fi + +make -j 8 +make dist + +cd $wd + +cp $out_root/libodb/libodb-$ver.zip $out_root/pack/ +cp $out_root/libodb/libodb-$ver.tar.gz $out_root/pack/ +cp $out_root/libodb/libodb-$ver.tar.bz2 $out_root/pack/ + + +# Build libodb-mysql +# +make -C $src_root/libodb-mysql dist dist_prefix=$out_root/libodb-mysql + +cd $out_root/libodb-mysql + +if [ $rebuild = y ]; then + ./bootstrap + ./configure --with-libodb=../libodb CXXFLAGS="$CXXFLAGS" +fi + +make -j 8 +make dist + +cd $wd + +cp $out_root/libodb-mysql/libodb-mysql-$ver.zip $out_root/pack/ +cp $out_root/libodb-mysql/libodb-mysql-$ver.tar.gz $out_root/pack/ +cp $out_root/libodb-mysql/libodb-mysql-$ver.tar.bz2 $out_root/pack/ + +# Build libodb-tracer +# +make -C $src_root/libodb-tracer dist dist_prefix=$out_root/libodb-tracer + +cd $out_root/libodb-tracer + +if [ $rebuild = y ]; then + ./bootstrap + ./configure --with-libodb=../libodb CXXFLAGS="$CXXFLAGS" +fi + +make -j 8 +make dist + +cd $wd + +cp $out_root/libodb-tracer/libodb-tracer-$ver.zip $out_root/pack/ +cp $out_root/libodb-tracer/libodb-tracer-$ver.tar.gz $out_root/pack/ +cp $out_root/libodb-tracer/libodb-tracer-$ver.tar.bz2 $out_root/pack/ + +# Build libodb-boost +# +make -C $src_root/libodb-boost dist dist_prefix=$out_root/libodb-boost + +cd $out_root/libodb-boost + +if [ $rebuild = y ]; then + ./bootstrap + ./configure --with-libodb=../libodb CXXFLAGS="$CXXFLAGS" +fi + +make -j 8 +make dist + +cd $wd + +cp $out_root/libodb-boost/libodb-boost-$ver.zip $out_root/pack/ +cp $out_root/libodb-boost/libodb-boost-$ver.tar.gz $out_root/pack/ +cp $out_root/libodb-boost/libodb-boost-$ver.tar.bz2 $out_root/pack/ + +# Build odb-tests +# +make -C $src_root/tests dist dist_prefix=$out_root/odb-tests + +cd $out_root/odb-tests + +if [ $rebuild = y ]; then + ./bootstrap + ./configure \ +--with-database=mysql \ +--with-libodb=../libodb \ +--with-libodb-tracer=../libodb-tracer \ +--with-libodb-mysql=../libodb-mysql \ +CXXFLAGS="$CXXFLAGS" \ +ODB=$odb +fi + +if [ $test = y ]; then + make -j 8 check +fi + +make dist + +cd $wd + +cp $out_root/odb-tests/odb-tests-$ver.zip $out_root/pack/ +cp $out_root/odb-tests/odb-tests-$ver.tar.gz $out_root/pack/ +cp $out_root/odb-tests/odb-tests-$ver.tar.bz2 $out_root/pack/ + +# Build odb-examples +# +make -C $src_root/examples dist dist_prefix=$out_root/odb-examples + +cd $out_root/odb-examples + +if [ $rebuild = y ]; then + ./bootstrap + ./configure \ +--with-database=mysql \ +--with-libodb=../libodb \ +--with-libodb-mysql=../libodb-mysql \ +--with-libodb-boost=../libodb-boost \ +CXXFLAGS="$CXXFLAGS" \ +ODB=$odb +fi + +if [ $test = y ]; then + make -j 8 check +fi + +make dist + +cd $wd + +cp $out_root/odb-examples/odb-examples-$ver.zip $out_root/pack/ +cp $out_root/odb-examples/odb-examples-$ver.tar.gz $out_root/pack/ +cp $out_root/odb-examples/odb-examples-$ver.tar.bz2 $out_root/pack/ diff --git a/doc/README b/doc/README new file mode 100644 index 0000000..3cf3dd7 --- /dev/null +++ b/doc/README @@ -0,0 +1,36 @@ +ODB is an object-relational mapping (ORM) system for C++. It provides +tools, APIs, and library support that allow you to persist C++ objects +to a relational database (RDBMS) without having to deal with tables, +columns, or SQL and without manually writing any of the mapping code. +For more information see: + +http://www.codesynthesis.com/products/odb/ + +This package contains the pre-compiled binary distribution of the ODB +compiler. The top-level directory structure of this package is as +follows: + +bin/ ODB compiler binary +doc/ ODB system documentation +man/ man pages for the ODB compiler +<arch>-<os>/ GCC compiler binaries, see manifest inside for details + +To install this package simply unpack it into a directory of your choice, +for example /opt/. You can run the ODB compiler by either using the +absolute path, for example: + +/opt/odb-x.y.z-i686-linux-gnu/bin/odb --version + +Or you can add the bin/ directory to the PATH environment variable, for +example: + +export PATH=/opt/odb-x.y.z-i686-linux-gnu/bin:$PATH +odb --version + +Note also that while you can move the ODB compiler directory around, you +cannot move individual sub-directories or files inside it. For example, +copying or linking the ODB compiler executable to /usr/local/bin/ will +not work. + +Send questions, bug reports, or any other feedback to the +odb-users@codesynthesis.com mailing list. diff --git a/doc/README-WIN b/doc/README-WIN new file mode 100644 index 0000000..7db442d --- /dev/null +++ b/doc/README-WIN @@ -0,0 +1,46 @@ +ODB is an object-relational mapping (ORM) system for C++. It provides +tools, APIs, and library support that allow you to persist C++ objects +to a relational database (RDBMS) without having to deal with tables, +columns, or SQL and without manually writing any of the mapping code. +For more information see: + +http://www.codesynthesis.com/products/odb/ + +This package contains the pre-compiled binary distribution of the ODB +compiler for Windows. The top-level directory structure of this package +is as follows: + +bin/ ODB compiler binary +doc/ ODB system documentation +man/ man pages for the ODB compiler +mingw/ GCC compiler, MinGW, and MSYS binaries, see manifest + inside for details + +To install this package simply unpack it into a directory of your choice, +for example C:\tools. The ODB compiler binary will be in the bin\ +directory inside the package directory, for example +C:\tools\odb-x.y.z-i686-windows\bin\. You can run the ODB compiler by +either using the absolute path, for example: + + +C:\tools\odb-x.y.z-i686-windows\bin\odb --version + +Or you can add the bin\ directory to the Path environment variable. To +accomplish this, open Control Panel, then System, select the Advanced tab +and click on the Environment Variables button. If you have administrator +privileges, select the Path variable from the System variables list. +Otherwise, select (or create) the Path variable from the User variables +list. Click the Edit button and add the bin\ directory to the list. Click +Ok, then log off and log on again for the changes to take effect. Once this +is done, you should be able to run the ODB compiler by using just its name, +for example: + +odb --version + +Note also that while you can move the ODB compiler directory around, you +cannot move individual sub-directories or files inside it. For example, +copying the ODB compiler executable to +C:\Windows will not work. + +Send questions, bug reports, or any other feedback to the +odb-users@codesynthesis.com mailing list. diff --git a/git/commit.sh b/git/commit.sh new file mode 100755 index 0000000..5c143d4 --- /dev/null +++ b/git/commit.sh @@ -0,0 +1,20 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +if [ "$1" = "" ]; then +echo "missing commit message" 1>&2 +exit 1 +fi + +wd=`pwd` + +for i in $modules; do + cd $i 1>&2 + git add . + git ci -m "$1" + cd $wd +done diff --git a/git/diff.sh b/git/diff.sh new file mode 100755 index 0000000..19737e9 --- /dev/null +++ b/git/diff.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +wd=`pwd` + +for i in $modules; do + echo "diff $i" 1>&2 + cd $i + git --no-pager diff + git --no-pager diff --check + cd $wd +done diff --git a/git/modules b/git/modules new file mode 100644 index 0000000..6f0a4ac --- /dev/null +++ b/git/modules @@ -0,0 +1 @@ +modules="libodb libodb-mysql libodb-tracer libodb-boost odb examples tests etc" diff --git a/git/push.sh b/git/push.sh new file mode 100755 index 0000000..e37d351 --- /dev/null +++ b/git/push.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +wd=`pwd` + +for i in $modules; do + echo "push $i" 1>&2 + cd $i + git push --tags origin master + cd $wd +done diff --git a/git/stash-pop.sh b/git/stash-pop.sh new file mode 100755 index 0000000..be43664 --- /dev/null +++ b/git/stash-pop.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +wd=`pwd` + +for i in $modules; do + echo "stash pop $i" 1>&2 + cd $i + git stash pop + cd $wd +done diff --git a/git/stash.sh b/git/stash.sh new file mode 100755 index 0000000..afc2124 --- /dev/null +++ b/git/stash.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +wd=`pwd` + +for i in $modules; do + echo "stash $i" 1>&2 + cd $i + git stash + cd $wd +done diff --git a/git/stat.sh b/git/stat.sh new file mode 100755 index 0000000..8e90a27 --- /dev/null +++ b/git/stat.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +wd=`pwd` + +for i in $modules; do + echo "stat $i" 1>&2 + cd $i + git stat + cd $wd +done diff --git a/git/tag.sh b/git/tag.sh new file mode 100755 index 0000000..99ba938 --- /dev/null +++ b/git/tag.sh @@ -0,0 +1,20 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +wd=`pwd` + +if [ "$1" = "" ]; then + echo "missing version" 1>&2 + exit 1 +fi + +for i in $modules; do + echo "tag $i" 1>&2 + cd $i + git tag -a $1 -m "Tag version $1" + cd $wd +done |