4 CHOWNUSER
="cdfrey:cdfrey"
7 if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then
9 echo "Usage: ./make-rpm.sh tarball chroot_target short_form"
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."
14 echo "short_form is the tag to rename the resulting DEB's with,"
15 echo "such as ubuntu710, etc."
17 echo "Available chroot targets:"
18 find $CHROOT -maxdepth 1 -type d
-print |
sed "s/^.*\// /"
24 TARNAME
=`basename "$TARPATH"`
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...
42 for f
in *_i386.deb
; do
43 mv "$f" "$(echo $f | sed "s
/_i386.deb$
/_
${TAG}_i386.deb
/")"
47 chown
-R $CHOWNUSER "build/$TARGET"