Mohammed Morsi
2009-Jun-01 16:39 UTC
[Ovirt-devel] [PATCH viewer] ovirt viewer autobuild.sh
--- autobuild.sh | 40 +++++++++++++++++++++++++++++++++++ autogen.sh | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 0 deletions(-) create mode 100755 autobuild.sh diff --git a/autobuild.sh b/autobuild.sh new file mode 100755 index 0000000..8a90a78 --- /dev/null +++ b/autobuild.sh @@ -0,0 +1,40 @@ +#!/bin/sh +#oVirt viewer autobuild script +# +# Copyright (C) 2008 Red Hat, Inc. +# +# 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 +# the Free Software Foundation; version 2 of the License. +# +# This program 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 this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +echo "Running oVirt viewer Autobuild" + +set -e +set -v + +test -f Makefile && make -k distclean || : + +./autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT +make + +if [ -f /usr/bin/rpmbuild ]; then + if [ -n "$AUTOBUILD_COUNTER" ]; then + EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER" + else + NOW=`date +"%s"` + EXTRA_RELEASE=".$USER$NOW" + fi + + rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ba ovirt-viewer.spec +fi diff --git a/autogen.sh b/autogen.sh index c7df22c..a731af4 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,3 +1,68 @@ #!/bin/sh +# Run this to generate configure and Makefile + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + autoreconf --force --install -I config -I m4 +THEDIR=`pwd` +( + cd $srcdir + die=0 + + (autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have autoconf installed." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/autoconf" + die=1 + } + + # Require libtool only if one of of LT_INIT, + # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac. + grep -E '^[[:blank:]]*(LT_INIT|A[CM]_PROG_LIBTOOL)' configure.ac >/dev/null \ + && { + (libtool --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have libtool installed." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/libtool" + die=1 + } + } + + (automake --version) < /dev/null > /dev/null 2>&1 || { + echo + die=1 + echo "You must have automake installed." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/automake" + } + + test $die = 1 && exit 1 + + test -f ovirt-viewer.spec || { + echo "You must run this script in the top-level directory" + exit 1 + } + + if test -z "$*"; then + echo "I am going to run ./configure with no arguments - if you wish " + echo "to pass any to it, please specify them on the $0 command line." + fi + + aclocal + + # Run autoheader only if needed + grep '^[[:blank:]]*AC_CONFIG_HEADERS' configure.ac >/dev/null && autoheader + + automake --add-missing + autoconf + ./configure "$@" +) + +if test "x$OBJ_DIR" != x; then + mkdir -p "$OBJ_DIR" + cd "$OBJ_DIR" +fi -- 1.6.0.6