Split GetStatus JVM command.
[barry/progweb.git] / maintainer / make-deb.sh
blobf0653c9c43eaee632623c4a7f5fa00ea49bb2b33
1 #!/bin/sh
3 CHROOT="/var/chroot"
4 CHOWNUSER="cdfrey:cdfrey"
5 CHROOTUSER="cdfrey"
7 if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then
8 echo
9 echo "Usage: ./make-rpm.sh tarball chroot_target short_form"
10 echo
11 echo "Copies the tarball to the chroot target's /home/$CHROOTUSER/binarybuild dir,"
12 echo "then enters the chroot system and runs the build."
13 echo
14 echo "short_form is the tag to rename the resulting DEB's with,"
15 echo "such as ubuntu710, etc."
16 echo
17 echo "Available chroot targets:"
18 find $CHROOT -maxdepth 1 -type d -print | sed "s/^.*\// /"
19 echo
20 exit 1
23 TARPATH="$1"
24 TARNAME=`basename "$TARPATH"`
25 TARGET="$2"
26 TAG="$3"
28 set -e
30 cp "$TARPATH" "$CHROOT/$TARGET/home/$CHROOTUSER"
32 chroot "$CHROOT/$TARGET" su - "$CHROOTUSER" -c /bin/sh -lc "rm -rf binarybuild && mkdir binarybuild && cd binarybuild && tar xjvf ../$TARNAME && cd * && fakeroot -- debian/rules binary"
34 mkdir -p "build/$TARGET"
35 cp "$CHROOT/$TARGET/home/$CHROOTUSER/binarybuild/"*.deb "build/$TARGET"
36 rm "$CHROOT/$TARGET/home/$CHROOTUSER/$TARNAME"
38 # We do this manually in a for loop, since the rename command is
39 # not the same across various linux distros...
41 cd "build/$TARGET"
42 for f in *_i386.deb ; do
43 mv "$f" "$(echo $f | sed "s/_i386.deb$/_${TAG}_i386.deb/")"
44 done
47 chown -R $CHOWNUSER "build/$TARGET"