From fdfe257094bc809ca0855cb0d15d4c7f7dcfca32 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Fri, 22 Aug 2008 00:37:01 -0400 Subject: [PATCH] Initial commit of external build and maintenance scripts --- README | 11 +++++++++++ build-all.sh | 24 +++++++++++++++++++++++ configure-barry.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++ configure-barryall.sh | 16 ++++++++++++++++ configure-barrygui.sh | 13 +++++++++++++ configure-barryopensync.sh | 15 +++++++++++++++ debian-snap.sh | 10 ++++++++++ git-patch-cvs.sh | 21 ++++++++++++++++++++ git-push-all.sh | 36 ++++++++++++++++++++++++++++++++++ rpm-snap.sh | 10 ++++++++++ snapshot.sh | 24 +++++++++++++++++++++++ sync-cwd.sh | 20 +++++++++++++++++++ 12 files changed, 248 insertions(+) create mode 100644 README create mode 100755 build-all.sh create mode 100755 configure-barry.sh create mode 100755 configure-barryall.sh create mode 100755 configure-barrygui.sh create mode 100755 configure-barryopensync.sh create mode 100755 debian-snap.sh create mode 100755 git-patch-cvs.sh create mode 100755 git-push-all.sh create mode 100755 rpm-snap.sh create mode 100755 snapshot.sh create mode 100755 sync-cwd.sh diff --git a/README b/README new file mode 100644 index 00000000..7510a531 --- /dev/null +++ b/README @@ -0,0 +1,11 @@ +These scripts are external to the Barry project, and don't make +any sense except on my development machine. This is just a place +to store them, so they are somehow attached to Barry. + +Any general use scripts should be put in the maintainer/ directory, +or written as a test script. + +Chris Frey +cdfrey@foursquare.net +2008/08/21 + diff --git a/build-all.sh b/build-all.sh new file mode 100755 index 00000000..1e4ed637 --- /dev/null +++ b/build-all.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# meant to be run from inside a freshly checked out cvs workspace +# builds: library, gui, then plugin + +set -e + +SCRIPTDIR="$(dirname "$0")" + +./buildgen.sh +"$SCRIPTDIR"/configure-barry.sh +make +make install + +cd gui +../"$SCRIPTDIR"/configure-barrygui.sh +make +make install + +cd ../opensync-plugin +../"$SCRIPTDIR"/configure-barryopensync.sh +make +make install + diff --git a/configure-barry.sh b/configure-barry.sh new file mode 100755 index 00000000..f1c412af --- /dev/null +++ b/configure-barry.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +CHOICE="system" + +#export CXXFLAGS="-Wall -Werror -pedantic -O0 -g -pg" +export CXXFLAGS="-Wall -Werror -pedantic -O0 -g" +#export CXX="g++-3.3" +#export CXX="g++-3.4" +#export CXX="g++-4.1" +#export CXX="/home/cdfrey/software/gcc/rootdir-4.3.0/bin/g++" + +export CC="ccache gcc" +export CXX="ccache g++" + +#export BOOSTOPT="" +#export BOOSTOPT="--with-boost" +#export BOOSTOPT="--with-boost=/home/cdfrey/software/boost/rootdir-gcc-3.3" +export BOOSTOPT="--with-boost=/home/cdfrey/software/boost/rootdir-gcc-4.1" + +if [ -n "$1" ] ; then + CHOICE="$1" +fi + +if [ "$CHOICE" = "devel" ] ; then +echo "Configuring for: devel" +./configure \ + --prefix=/home/cdfrey/Contract/netdirect/syncberry/cvs/barry1/rootdir \ + --with-libusb=/home/cdfrey/Contract/netdirect/syncberry/cvs/external/rootdir/libusb \ + $BOOSTOPT +fi + + +if [ "$CHOICE" = "system" ] ; then +echo "Configuring for: system" +./configure \ + --prefix=/home/cdfrey/Contract/netdirect/syncberry/cvs/barry1/rootdir \ + $BOOSTOPT +fi + + +if [ "$CHOICE" = "stable" ] ; then +echo "Configuring for: stable" +./configure \ + --prefix=/home/cdfrey/Contract/netdirect/syncberry/cvs/barry1/rootdir \ + --with-libusb=/home/cdfrey/Contract/netdirect/syncberry/cvs/external/rootdir/libusb-stable \ + $BOOSTOPT +fi + diff --git a/configure-barryall.sh b/configure-barryall.sh new file mode 100755 index 00000000..1f924ae5 --- /dev/null +++ b/configure-barryall.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +CHOICE="system" + +export CC="ccache gcc" +export CXX="ccache g++" + +#export CXXFLAGS="-Wall -Werror -pedantic -O0 -g" +export CXXFLAGS="-Wall -Werror -O0 -g" +#export PKG_CONFIG_PATH=/home/cdfrey/Contract/netdirect/syncberry/cvs/barry1/rootdir/lib/pkgconfig:/home/cdfrey/software/opensync/0.22/rootdir/lib/pkgconfig + +./configure \ + --prefix=/home/cdfrey/Contract/netdirect/syncberry/cvs/barry1/rootdir \ + --enable-gui \ + --enable-opensync-plugin + diff --git a/configure-barrygui.sh b/configure-barrygui.sh new file mode 100755 index 00000000..24642bba --- /dev/null +++ b/configure-barrygui.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +export CC="ccache gcc" +export CXX="ccache g++" + +#export CXXFLAGS="-Wall -Werror -pedantic -O0 -g -pg" +export CXXFLAGS="-Wall -Werror -pedantic -O0 -g" +#export CXX="g++-3.3" +export PKG_CONFIG_PATH=/home/cdfrey/Contract/netdirect/syncberry/cvs/barry1/rootdir/lib/pkgconfig + +./configure \ + --prefix=/home/cdfrey/Contract/netdirect/syncberry/cvs/barry1/rootdir + diff --git a/configure-barryopensync.sh b/configure-barryopensync.sh new file mode 100755 index 00000000..7ab3127a --- /dev/null +++ b/configure-barryopensync.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +export CC="ccache gcc" +export CXX="ccache g++" + +#export CXXFLAGS="-Wall -Werror -pedantic -O0 -g" +#export CXXFLAGS="-Wall -Werror -O0 -g -pg" +export CXXFLAGS="-Wall -Werror -O0 -g" +#export CXX="g++-3.3" +#export PKG_CONFIG_PATH=/home/cdfrey/Contract/netdirect/syncberry/cvs/barry1/rootdir/lib/pkgconfig:/home/cdfrey/software/opensync/svn/rootdir/lib/pkgconfig +export PKG_CONFIG_PATH=/home/cdfrey/Contract/netdirect/syncberry/cvs/barry1/rootdir/lib/pkgconfig:/home/cdfrey/software/opensync/0.22/rootdir/lib/pkgconfig + +./configure \ + --prefix=/home/cdfrey/Contract/netdirect/syncberry/cvs/barry1/rootdir + diff --git a/debian-snap.sh b/debian-snap.sh new file mode 100755 index 00000000..a2939734 --- /dev/null +++ b/debian-snap.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Meant to be run from the root of a Barry source tree. + +sed "1 s/(.*)/($1.$2-cvs$(date '+%Y%m%d'))/" < debian/changelog > debian/changelog.2 +mv debian/changelog.2 debian/changelog + +echo "Updated debian/changelog to current date:" +head -n 1 < debian/changelog + diff --git a/git-patch-cvs.sh b/git-patch-cvs.sh new file mode 100755 index 00000000..074db95e --- /dev/null +++ b/git-patch-cvs.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then + echo "Apply unpushed changes from git to a CVS tree." + echo + echo "Usage: git-patch-cvs " + echo + echo "Example: assuming changes on master branch, with remote as" + echo " origin/master, patching cvs in ../barry3" + echo + echo " git-patch-cvs origin master ../barry3" + echo + echo "This script does NOT push changes to git remote." + echo + exit 1 +fi + +git-cherry "$1" "$2" | \ + sed -n 's/^+ //p' | \ + xargs -L 1 git-cvsexportcommit -cvp -w "$3" + diff --git a/git-push-all.sh b/git-push-all.sh new file mode 100755 index 00000000..608da686 --- /dev/null +++ b/git-push-all.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +PATCH_CVS="$(dirname "$0")/git-patch-cvs.sh" + +set -e + +$PATCH_CVS origin master ../barry3 +$PATCH_CVS origin master ../external/barry + +echo "Press enter when ready for git push..." +read + +# Note: This push only updates non-CVS branches, and master. +# To push other CVS branches, do it manually, with git-patch-cvs.sh + +git push --tags origin master i18n + + +echo "Press enter when ready for git push to repo.or.cz..." +read + +# +# Now update repo.or.cz. We can be more liberal here, since repo.or.cz +# _should_ contain everything that can be considered public. +# +# The idea is to put everything out there, in case someone wants +# to work on it, or send patches. +# +# "all" and "tags" have to be done separately for some reason +# +#git push --all repo.or.cz +#git push --tags repo.or.cz master i18n +git push repo.or.cz master i18n + +echo "================= NOTE: if you want to push a tag, do it manually!" + diff --git a/rpm-snap.sh b/rpm-snap.sh new file mode 100755 index 00000000..54609f60 --- /dev/null +++ b/rpm-snap.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Meant to be run from the root of a Barry source tree. + +sed "/^Release: / s/: .*$/: $1.$2-cvs$(date '+%Y%m%d')/" < rpm/barry.spec > rpm/barry.spec.2 +mv rpm/barry.spec.2 rpm/barry.spec + +echo "Updated rpm/barry.spec to current date:" +grep "^Release: " rpm/barry.spec + diff --git a/snapshot.sh b/snapshot.sh new file mode 100755 index 00000000..26b691bf --- /dev/null +++ b/snapshot.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# Meant to be run from within a git repository. + +set -e + +# Do a little dance to find the full path to debian-snap.sh +SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)" + +cd maintainer +./git-extract.sh $1 $2 $3 +(cd build/barry* && "$SCRIPTDIR/debian-snap.sh" $1 $2) +(cd build/barry* && "$SCRIPTDIR/rpm-snap.sh" $1 $2) +(cd build/barry* && ../../tar-prepare.sh) +(cd build && ../tar-create.sh $1 $2) + +echo +echo "***********************************************************" +echo " Remember to update the OBS RPM spec file with a new" +echo " Release date, as well as updating it with any changes" +echo " in the git tree since the last update." +echo "***********************************************************" +echo + diff --git a/sync-cwd.sh b/sync-cwd.sh new file mode 100755 index 00000000..3d21b6cd --- /dev/null +++ b/sync-cwd.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +if [ -z "$1" ] ; then + echo "Usage: Run from inside the directory you want to patch." + echo " Then do:" + echo + echo " sync-cwd.sh ../path/to/dir/with/changes" + echo + echo "Changes will be applied to your current working directory." + exit 1 +fi + +DIR="$1" +PATCH="../sync-cwd.patch" + +(cd "$DIR" && make clean) +diff -ruN --exclude=CVS --exclude=.git . "$DIR" > "$PATCH" +patch -p1 < "$PATCH" +rm "$PATCH" + -- 2.11.4.GIT