| 1 | #! /bin/bash |
| 2 | # |
| 3 | # This file is part of DisOrder |
| 4 | # Copyright (C) 2005-2008 Richard Kettlewell |
| 5 | # |
| 6 | # This program is free software: you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation, either version 3 of the License, or |
| 9 | # (at your option) any later version. |
| 10 | # |
| 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | # |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | # |
| 19 | |
| 20 | set -e |
| 21 | web=$HOME/public_html/web/disorder |
| 22 | |
| 23 | make |
| 24 | make distcheck |
| 25 | make dist-bzip2 |
| 26 | v=$(make echo-version) |
| 27 | d=$(make echo-distdir) |
| 28 | src=$d.tar.bz2 |
| 29 | |
| 30 | # Report and execute a command remotely |
| 31 | remote() { |
| 32 | local h=$1 |
| 33 | shift |
| 34 | echo "$h:" "$@" |
| 35 | ssh $h "$@" |
| 36 | } |
| 37 | |
| 38 | # Build .debs and copy to the right place |
| 39 | build() { |
| 40 | local h=$1 # build host |
| 41 | local f=$2 |
| 42 | local vs=$3 |
| 43 | local dist=$4 |
| 44 | |
| 45 | remote $h "mkdir -p _builds" |
| 46 | remote $h "rm -rf _builds/*.deb _builds/$d" |
| 47 | scp $src $h:_builds |
| 48 | remote $h "cd _builds && tar xfj $src" |
| 49 | if [ "$vs" != "" ]; then |
| 50 | remote $h "cd _builds/$d && scripts/setversion $v~$vs 'Backport to $vs' $dist" |
| 51 | fi |
| 52 | remote $h "cd _builds/$d && fakeroot debian/rules binary" |
| 53 | mkdir -p $web/$f |
| 54 | scp $h:_builds/*.deb $web/$f/. |
| 55 | } |
| 56 | |
| 57 | # Build various debs |
| 58 | |
| 59 | # Ubuntu dapper; binaries suit Debian etch too |
| 60 | build dekabrach etch etch oldstable |
| 61 | |
| 62 | # Debian lenny (32-bit) |
| 63 | build leucomorph lenny "" stable |
| 64 | |
| 65 | # Debian lenny (64-bit) |
| 66 | build araminta lenny "" stable |
| 67 | |
| 68 | # Update the web |
| 69 | cp $src $web |
| 70 | cd doc |
| 71 | for f in *.[1-9].html; do |
| 72 | echo $f |
| 73 | rm -f $web/$f |
| 74 | sed < $f > $web/$f 's/^@.*//' |
| 75 | done |
| 76 | cp plumbing.svg $web/. |
| 77 | if [ -f plumbing.png ]; then |
| 78 | cp plumbing.png $web/. |
| 79 | fi |
| 80 | |