#!/bin/sh # Copyright (C) 2004 Simon Josefsson. # # This file is part of Autobuild. # # Autobuild is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # Autobuild is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Autobuild; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA. prog="`basename \"$0\"`" rcs_revision='$Revision: 1.8 $' rcs_version=`set - $rcs_revision; echo $2` program=`echo $0 | sed -e 's!.*/!!'` version="abbuild-sourceforge (autobuild) $rcs_version Copyright (C) 2004 Simon Josefsson There is NO warranty. You may redistribute this software under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING." usage="Usage: $prog [OPTION]... FILE HOST Build FILE on SourceForge compile farm host HOST. Options: -u, --username SourceForge SSH username. Defaults to \$USER. -v, --verbose Pass '-v' to ssh. -h, --help Display this help and exit successfully. --version Display version information and exit successfully. Environment variables: ABSFUSER SourceForge SSH username. Files: \$HOME/.ab-sf Shell script sourced, can be used to specify ABSFUSER. E.g., run 'echo ABSFUSER=joe > \$HOME/.ab-sf'. Simple example: $prog yourproject-4.2.tar.gz Report bugs to ." test -f $HOME/.ab-sf && . $HOME/.ab-sf while test $# -gt 0; do case $1 in -v) VERBOSE=-v;; -h) echo "$usage"; exit 0;; -u) shift; ABSFUSER=$1;; --username) shift; ABSFUSER=$1;; --help) echo "$usage"; exit 0;; --version) echo "$version"; exit 0;; -*) echo "$0: Unknown or ambiguous option \`$1'." >&2 echo "$0: Try \`--help' for more information." >&2 exit 1;; *) if test -z "$FILE"; then FILE=$1 elif test -z "$HOST"; then HOST=$1 else echo "$0: Extra non-option argument \`$1'." >&2 exit 1 fi;; esac shift done if test -z "$FILE" || test -z "$HOST"; then echo "$usage" exit 0 fi if test -z "$ABSFUSER"; then echo "Sourceforge SSH user name not specified, defaulting to $USER." echo "Use 'echo ABSFUSER=joe > $HOME/.ab-sf' to change." fi ABSFUSER=${ABSFUSER:-$USER} BASEFILE=`basename $FILE .tar.gz` BASEFILE=`basename $BASEFILE .tar.bz2` ssh $VERBOSE -l $ABSFUSER cf-shell.sf.net ssh $HOST "test -d /tmp/\$USER \|\| mkdir /tmp/\$USER \; cd /tmp/\$USER \&\& rm -rf /tmp/\$USER/$BASEFILE \&\& gzip -cd \~/$FILE \| tar xf - \; cd /tmp/\$USER/$BASEFILE \&\& ./configure --prefix=/tmp/\$USER \&\& make install check \; gcc --version \; make --version \; hostname \; set"