nsbin/old/update-git+cogito.sh

60 lines
1.5 KiB
Bash
Raw Normal View History

2005-11-09 12:00:18 +00:00
#!/bin/sh
# Nico Schottelius
# Date: Mit Nov 9 12:57:04 CET 2005
2005-11-10 11:55:32 +00:00
# Last Modified: Thu Nov 10 12:53:00 CET 2005
2005-11-09 12:00:18 +00:00
#
# Install latest git and cogito to $INSTALL_PREFIX/$name and
# link the binaries to $BINDIR
# Needs git and cogito to work!
# And:
# - libexpat-dev
# - libcurl3-dev
# - libssl-dev
# - libz-dev
2005-11-09 12:00:18 +00:00
BASE_GET=http://www.kernel.org/pub/scm/
PROJECTS="git/git.git cogito/cogito.git"
BUILDDIR=/home/user/nico/build
2005-11-09 12:00:18 +00:00
INSTALL_PREFIX=/usr/packages
BINDIR=/usr/local/bin
2005-11-10 11:55:32 +00:00
error_in()
{
echo "[failed] $1"
echo "Exiting now."
exit 1
}
2005-11-09 12:00:18 +00:00
for project in $PROJECTS; do
realname=$(echo $project | sed -e 's,.*/,,' -e 's/\.git$//')
echo "Working on $realname (in $BUILDDIR/$realname) ... "
if [ ! -d "$BUILDDIR/$realname" ]; then
echo "Cloning $realname"
cg-clone "${BASE_GET}${project}" "$BUILDDIR/$realname"
else
echo "Updating $realname from \"origin\""
2005-11-10 11:55:32 +00:00
cd "$BUILDDIR/$realname" || error_in "$BUILDDIR/$realname"
2005-11-09 12:00:18 +00:00
cg-update origin
fi
if [ $? -ne 0 ]; then
2005-12-07 20:22:56 +00:00
echo "Pull or clone failed, ABORTING."
exit 23
fi
2005-11-09 12:00:18 +00:00
cd "$BUILDDIR/$realname"
version=$(cg-object-id)
echo "Installing $realname (Version: $version)"
DDIR=$INSTALL_PREFIX/$realname-$version
2005-11-10 11:55:32 +00:00
make clean || error_in "Cleaning $realname"
make "prefix=$DDIR" all || error_in "Building $realname"
make "prefix=$DDIR" install || error_in "Installing $realname"
2005-11-09 12:00:18 +00:00
echo "Linking files to $BINDIR ..."
for file in "$DDIR/bin/"*; do
2005-11-10 11:55:32 +00:00
ln -sf $file "$BINDIR" || error_in "Linking $file"
2005-11-09 12:00:18 +00:00
done
done