#! /bin/bash
#
# This file is part of rsbackup
-# Copyright (C) 2010, 2011 Richard Kettlewell
+# Copyright (C) 2010, 2011, 2013 Richard Kettlewell
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
"$@"
}
+hostname=$(uname -n)
+
# r HOST COMMAND...
#
# Echo a command then execute it remotely.
local host=$1
shift
echo "$host:" "$@" >&2
- ssh $host "$@"
+ case "$host" in
+ chroot:* )
+ (
+ cd
+ schroot -pc${host#chroot:} -- bash -c "$@"
+ )
+ ;;
+ * )
+ ssh $host "$@"
+ ;;
+ esac
}
# build HOST ARCH
echo
r $host "mkdir -p _builds"
r $host "cd _builds && rm -rf ${source} ${archive} ${debs}"
- s scp ${archive} $host:_builds/.
+ case "$host" in
+ chroot:* )
+ cp ${archive} $HOME/_builds/.
+ ;;
+ * )
+ s scp ${archive} $host:_builds/.
+ ;;
+ esac
r $host "cd _builds && tar xfz ${archive}"
r $host "cd _builds/${source} && debian/rules build"
r $host "cd _builds/${source} && fakeroot debian/rules binary"
for deb in $debs; do
- s scp $host:_builds/$deb .
- products="$products $deb"
+ case "$host" in
+ chroot:* )
+ cp $HOME/_builds/$deb products/
+ ;;
+ * )
+ s scp $host:_builds/$deb products/
+ ;;
+ esac
done
echo
echo "Built $debs"
echo
}
+rm -rf products
+mkdir products
+
# Build the source archive
s make -C doc html
s make distcheck
products="$archive"
# Build .deb files
-s build araminta amd64 # squeeze
-s build sandestin i386 # squeeze
+s build araminta amd64 # wheezy
+s build chroot:wheezy32 i386 # wheezy
-rm -rf products
-mkdir products
-cp doc/*.html doc/*.css ${products} products/.
+cp doc/*.html doc/*.css products/.
mv products//CHANGES.html products/rsbackup-CHANGES.html
-rm -f ${products}
ls -l products