3 if [ -z "$1" -o -z "$2" ] ; then
5 echo "Usage: ./release.sh builddir target1 [target2...]"
7 echo "Builds release binaries using the tar release in builddir."
9 echo "target is a filename containing binary package"
10 echo "build instructions. See barrychroots, barrylocal, and"
11 echo "barryremote for more information. The filename must have"
12 echo "the word 'root' in it if you wish it to run as root."
14 echo "You can run this multiple times at the same time, for example"
15 echo "to build both remote and chroot scripts at once."
17 echo "Note: You may wish to direct the output to a file, for"
18 echo " later examination."
20 echo "Example: ./release.sh barrybuild barrychroots"
30 TARBALL
=$
(echo $BUILDDIR/barry-
*.
*.
*.
tar.bz2
)
31 BASENAME
=$
(basename $TARBALL)
33 # Make sure tarball exists
34 if [ -f $TARBALL ] ; then
35 echo "Tarball already exists... continuing..."
38 echo "Tarball does not exist, run release-tar.sh first."
44 # Build the binary packages by running the target script
45 if echo "$TARGETFILE" |
grep root
> /dev
/null
; then
47 su
- -c "export BARRYTARBALL=$TARBALL && \
48 export BARRYTARBASE=$BASENAME && \
49 export BARRYBUILDDIR=$BUILDDIR && \
50 export THEMODE=release && \
51 export CHOWNUSER=$(whoami) && \
55 export BARRYTARBALL
=$TARBALL
56 export BARRYTARBASE
=$BASENAME
57 export BARRYBUILDDIR
=$BUILDDIR
58 export THEMODE
=release
59 export CHOWNUSER
="$(whoami)"
69 echo "Current build directory:"
72 echo "release.sh done"