All pastes #990243 Raw Edit

Stuff

public shellscript v1 · immutable
#990243 ·published 2008-04-20 01:45 UTC
rendered paste body
# Contributor: Fyda <solinde@gmail.com># This script compiles the cairo-dock plugins from SVN.# Cairo-dock can be found at:# http://developer.berlios.de/projects/cairo-dock/# Cairo-dock is released under the GPL.# You'll need at least the following to build this successfully:# libxxf86vm vte subversion autoconf automake intltool pkgconfig libtool perlxml# NOTE: This script sets /usr/local as the prefix (not /usr).# It also does a `sudo make install' for each item, so you might need to# stick around and type in the password when it brings up a prompt for that.# USAGE:-# Put this script in its own directory, eg. ~/cairo-dock# make it executable, and run it with: ./cairo_dock.sh# You can blacklist specific plug-ins here. Separate items with a space._blacklist="template xfce-integration"# Where should the files be installed to? (Don't change this unless you know# what you're doing.)_installprefix="/usr/local"# Where is the SVN repo located? (You shouldn't normally have to change this.)_svntrunk="http://svn.berlios.de/svnroot/repos/cairo-dock/trunk"# The directory name of cairo-dock itself_svncdock="cairo-dock"# And the directory name containing all the individual plugin subdirectories_svnplugs="plug-ins"### SCRIPT BEGINS BELOW #### Check if cairo-dock is the latest, if not, compile itif [ -d $_svncdock ] ; then	cd $_svncdock	svn update || return 1	echo "Cairo-Dock is up to date."else	svn checkout $_svntrunk/$_svncdock || return 1	cd $_svncdockfiecho "Cairo-Dock checkout complete."echo "Compiling $_svncdock..."echo "Executing autoreconf..."autoreconf -isvfif [ $? -ne 0 ]; then	echo "WARNING: $_svncdock failed during autoreconf!"else	echo "Performing configure for $_svncdock..."	CFLAGS="$CFLAGS -Wno-error" CXXFLAGS="$CXXFLAGS -Wno-error" ./configure --prefix=$_installprefix	if [ $? -ne 0 ]; then	echo "WARNING: $_svncdock did not pass pre-build checks! You might be missing some build dependencies."	else	echo "Making $_svncdock..."        make		if [ $? -ne 0 ]; then			echo "WARNING: $a failed to build!"		else			echo "Installing $_svncdock..."			sudo make install			if [ $? -ne 0 ]; then				echo "WARNING: Failed to install $_svncdock!"			else				echo "Successfully made and installed $_svncdock."			fi		fi	fificd ..# get directory listing, clean it up to remove the trailing slashes_itemstocompile="$(echo */ | sed s/\\///g)"# create lists of items that failed at 1) autoreconf, 2) configure, and 3) make_failedarc=""_failedconf=""_failedmake=""# and a list of successfully built items_successfulitems=""# apply the blacklist so we remove those plug-ins from the to-compile listif [ ! -z "$_blacklist" ] ; then  echo "** You have blacklisted the following plug-ins:"  echo "$_blacklist"  for a in $_blacklist ; do    _itemstocompile="$(echo $_itemstocompile | sed s/$a//)"  donefi  for a in $_itemstocompile ; do    echo "Doing autoreconf for $a..."    cd $a    autoreconf -isvf    if [ $? -ne 0 ]; then      _failedarc="$_failedarc $a"      echo "WARNING: $a failed during autoreconf!"    else      echo "Doing configure for $a..."      CFLAGS="$CFLAGS -Wno-error" CXXFLAGS="$CXXFLAGS -Wno-error" ./configure --prefix=$_installprefix      if [ $? -ne 0 ]; then        _failedconf="$_failedconf $a"        echo "WARNING: $a did not pass pre-build checks! You are probably missing some build dependencies."      else	echo "Making $a..."        make        if [ $? -ne 0 ]; then          _failedmake="$_failedmake $a"          echo "WARNING: $a failed to build!"        else	  echo "Doing make install for $a..."          sudo make install	  if [ $? -ne 0 ]; then	    echo "WARNING: Failed to install $a!"	  else             _successfulitems="$_successfulitems $a"            echo "Successfully made and installed $a."	  fi        fi      fi    fi    cd ..  doneif [ ! -z "$_failedarc" ]; then  echo "** The following plug-ins failed during autoreconf:"  echo "$_failedarc"fiif [ ! -z "$_failedconf" ]; then  echo "** The following plug-ins failed during configure (probably missing build dependencies):"  echo "$_failedconf"fiif [ ! -z "$_failedmake" ]; then  echo "** The following plug-ins failed to build:"  echo "$_failedmake"fiif [ ! -z "$_blacklist" ]; then  echo "** The following blacklisted plug-ins were not built:"  echo "$_blacklist"fiif [ ! -z "$_successfulitems" ]; then  echo "** The following plug-ins were successfully built:"  echo "$_successfulitems"fi