maint: changed make-rpm.sh to accept full command line to build package
[barry/progweb.git] / maintainer / release.sh
blobd8e7802ebdc71d9ee5b69f4a103f4b4d5f31903b
1 #!/bin/bash
3 if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" ] ; then
4 echo
5 echo "Usage: ./release.sh LOGICAL MAJOR MINOR commit [target]"
6 echo
7 echo "Creates the release tarball from git sources, tests the compile"
8 echo "on local machine, fedora4, fedora5, fedora6."
9 echo
10 echo "target is an optional filename containing binary package"
11 echo "build instructions. See barrychroots, barrylocal, and"
12 echo "barryremote for more information. The filename must have"
13 echo "the word 'root' in it if you wish it to run as root."
14 echo
15 echo "You can run this multiple times at the same time, for example"
16 echo "to build both remote and chroot scripts at once."
17 echo
18 echo "Note: You may wish to direct the output to a file, for"
19 echo " later examination."
20 echo
21 echo "Example: ./release.sh 0 17 0 master"
22 echo " ./release.sh 0 17 0 master barrychroots"
23 echo
24 exit 1
27 set -e
29 # Create the tarball
30 if [ -f build/barry-$1.$2.$3.tar.bz2 ] ; then
31 echo "Tarball already exists... not creating again."
32 sleep 2s
33 else
34 ./git-release-tar.sh $1 $2 $3 $4
37 if [ -n "$5" ] ; then
38 if echo "$5" | grep root > /dev/null ; then
39 # needs root
40 su - -c "export BARRYTARBALL=build/barry-$1.$2.$3.tar.bz2 && \
41 export BARRYTARBASE=barry-$1.$2.$3.tar.bz2 && \
42 export THEMODE=release && \
43 export CHOWNUSER=$(whoami) && \
44 cd $(pwd) && \
45 source $5"
46 else
47 export BARRYTARBALL=build/barry-$1.$2.$3.tar.bz2
48 export BARRYTARBASE=barry-$1.$2.$3.tar.bz2
49 export THEMODE=release
50 export CHOWNUSER="$(whoami)"
52 source $5
56 echo
57 echo "Current build directory:"
58 ls build
59 echo
60 echo "release.sh done"