new easy GNOME2 CVS build script



hello gnomecommunity,

please allow me to share a new gnome 2 cvs buildscript to you. well you
may ask 'well why do we need another one ? we have v-b-s and jh scripts
already'. yes you are right but why not allowing a new one with the hope
to get more people on gnome 2 and help those who may have problems with
the other 2 scripts. now let me explain my script and point out some
advantages.

my script is:

- easy to understand. its really a one file simple bash script.
- is able to create tarballs and is automatically able to update the
  contents of these tarballs, so next time the script untars them, makes
  an update and tar the stuff up.
- support for people that dont run a distribution. so people with LFS or
  equal system can get another features that this script does to install
  missing stuff on your system.
- if a compile fails then the script doesnt simply abort without telling
  you what happened. no it spits out some helpfull information that i
  collected during my time using gnome 1 and now gnome 2 so these hints
  may help you to easy solve some situations.
- keep track of all new gnome components with support of branching. you
  simply add the branch you want to checkout in the corresponding module
  list and there you go.
- clean installation. an existing old installation wont get borked by
  adding more files and libraries. nope the old directory gets renamed
  cleanly and you install from scratch. if something really fails hard
  or you decide you dont want that then simply delete the new directory
  and restore the renamed one - done!

the script is well tested but it may always happen that something fails.
oki i spent a couple of time creating this one and i mainly did it for
my own pleasurement. if you gonna like it and find it usable then please
let me know. hope this work wasnt for the trash :-)

-- 
Name....: Ali Akcaagac
Status..: Student Of Computer & Economic Science
E-Mail..: mailto:ali akcaagac stud fh-wilhelmshaven de
WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa
#!/bin/sh
# Begin /tmp/dognome
#
# v0.0.3 - Ali Akcaagac <ali akcaagac stud fh-wilhelmshaven de>
#
#	this is another so called gnome buildscript. this time made by me with
#	following reasons, i needed a simple easy to use script. i know that
#	vicious made a nice one and jh did another fine. but i need more. i
#	usually keep my checkouts in a tarball and have them automatically be
#	updated each time i check the cvs. this script is easy to use, simple
#	to understand and fits exactly for people using a nondistribution like
#	system as i am doing. if you have some ideas, suggestions or want to
#	report bugs then please write to my mail above or check me up in the
#	gnome irc channel and talk to me. unfortunately you are on your own by
#	using this script. its mainly made for experienced people that usually
#	know what they are doing and why they are doing it. this script takes
#	a lot of care for errors that may happen and tells you how to solve
#	these issues with practical and simple methods. these may for sure
#	fail in certain situations but its at least worth a try. if you know
#	more solutions then feel free to contact me and report how you solved
#	them.
#
#	oGALAXYo
#

###############################################################################
#
#	status: no complications
#
#	please enter the prefix, sysconfdir and workdir (tempdir) here. if you
#	are galaxy :-) then you want to set GXYMODE to TRUE. only uppercase is
#	allowed (TRUE/FALSE). this will change some stuff, that i need for my
#	personal installation.
#
###############################################################################
PREFIXDIR=/usr/local
SYSCONFDIR=/usr/local/etc
TEMPDIR=/tmp/gnome

GXYMODE=TRUE
PREFIXDIR2=/usr/local2

###############################################################################
#
#	status: no complications
#
#	enter all modules you want to checkout to build a full gnome system.
#	make sure that all cvstags below are set too, they must be in sync.
#
###############################################################################
MODULES="esound
	 gtk-doc
	 glib
	 atk
	 pango
	 gtk+
	 gtk-engines
	 linc
	 libIDL
	 ORBit2
	 intltool
	 gnome-xml
	 gnome-common
	 gconf
	 bonobo-activation
	 libbonobo
	 gnome-mime-data
	 gnome-vfs
	 libxslt
	 libgnome
	 libart_lgpl
	 libglade
	 libgnomecanvas
	 libbonoboui
	 libgnomeui
	 libgnomeprint
	 libgnomeprintui
	 libwnck
	 libzvt
	 libcapplet
	 gnome-desktop
	 gnome-panel
	 gnome-session
	 profterm
	 gnome-utils
	 gail
	 gtkhtml2
	 gnome-control-center
	 librsvg
	 eel
	 nautilus
	 metacity
	 gdm2
	 glade
	 ggv
	 gnome-media
	 memprof"

###############################################################################
#
#	status: no complications
#
#	please enter the branch you want to checkout or head. the information
#	HEAD is required, make sure the amount of cvstags matches the amount of
#	modules you want to checkout.
#
###############################################################################
CVSTAG="HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD
	HEAD"

###############################################################################
#
#	status: no complications
#
#	i personally need these programs to. if you dont use GXYMODE then dont
#	care for this part. be sure to change version numbers below too.
#
###############################################################################
PROGRAMS="zlib-1.1.3
	  tiff-v3.5.7
	  libungif-4.1.0b1
	  libpng-1.2.1
	  jpeg-6b
	  popt-1.6
	  pkgconfig-0.8.0
	  audiofile-0.2.3"

###############################################################################
#
#	status: no complications
#
#	lets make sure we have the tempdir before we start the work.
#
###############################################################################
if [ ! -d $TEMPDIR ] ; then
	mkdir -p $TEMPDIR
fi

###############################################################################
#
#	status: no complications
#
#	ok this do loop will first check if you have the module checked out
#	previously and checks if it's packed as module.tar.bz2. if so then it
#	depacks that archive, updates it and creates a new package called
#	module.tar.bz2.
#
#	if you don't have checked out previously, this module will be checked
#	out and a package named module.tar.bz2 will be created.
#
#	make sure to place these module.tar.bz2 files in the tempdir shown
#	above, whenever running this script.
#
###############################################################################
if [ ! -f $TEMPDIR/buildprocess ] ; then
	COUNTER=0

	for MODULE in $MODULES ; do
		COUNTER2=0

		for TAG in $CVSTAG ; do
			if [ $COUNTER == $COUNTER2 ] ; then
				break
			fi

			let COUNTER2=COUNTER2+1
		done

		cd $TEMPDIR
		export CVSROOT=":pserver:anonymous anoncvs gnome org:/cvs/gnome"

		if [ -f $MODULE.tar.bz2 ] ; then
			echo -e "\\033[1;34mdepacking archive: \\033[1;36m$MODULE.tar.bz2\\033[0m"
			tar xfBPjv $MODULE.tar.bz2
			echo -e "\\033[1;34mupdating module: \\033[1;36m$MODULE \\033[1;34mtag: \\033[1;36m$TAG\\033[0m"

			if [ $TAG == "HEAD" ] ; then
				if ! cvs -z3 update -Pd $MODULE ; then
					echo -e "\\033[1;34mplease check if you have written the module and tag names correctly.\\033[0m"
					exit 1
				fi
			else
				if ! cvs -z3 update -Pdr $TAG $MODULE ; then
					echo -e "\\033[1;34mplease check if you have written the module and tag names correctly.\\033[0m"
					exit 1
				fi
			fi
		else
			echo -e "\\033[1;34mgetting module: \\033[1;36m$MODULE \\033[1;34mtag: \\033[1;36m$TAG\\033[0m"

			if [ $TAG == "HEAD" ] ; then
				if ! cvs -z3 checkout $MODULE ; then
					echo -e "\\033[1;34mplease check if you have written the module and tag names correctly.\\033[0m"
					exit 1
				fi
			else
				if ! cvs -z3 checkout -r $TAG $MODULE ; then
					echo -e "\\033[1;34mplease check if you have written the module and tag names correctly.\\033[0m"
					exit 1
				fi
			fi
		fi

		echo -e "\\033[1;34mcreating archive: \\033[1;36m$MODULE.tar.bz2\\033[0m"
		tar cfBPjv $MODULE.tar.bz2 $MODULE

		let COUNTER=COUNTER+1
	done
fi

###############################################################################
#
#	status: no complications
#
#	make sign that we are in buildingprocess now, so if something fails we
#	don't re-checkout or re-update again, we then can keep going on doing
#	the buildstuff.
#
###############################################################################
echo "buildprocess" > $TEMPDIR/buildprocess

###############################################################################
#
#	status: no complications
#
#	check if we did a backup before if so then skip this, otherwise backup
#	old directory and create a completely new directory with complete dir
#	hierarchy.
#
###############################################################################
if [ $GXYMODE == "TRUE" ] ; then
	if [ ! -d $PREFIXDIR2 ] ; then
		mv $PREFIXDIR $PREFIXDIR2

		mkdir $PREFIXDIR
		cd $PREFIXDIR
		mkdir bin etc include lib sbin share src tmp var
		ln -s share/man man
		ln -s share/doc doc
		ln -s share/info info
		cd $PREFIXDIR/share
		mkdir dict doc info locale man nls misc terminfo zoneinfo
		cd $PREFIXDIR/share/man
		mkdir man1 man2 man3 man4 man5 man6 man7 man8 man9 mann

		cd $PREFIXDIR/share
		ln -s ../../share/aclocal aclocal
		ln -s ../../share/sgml sgml
	fi
fi

###############################################################################
#
#	status: no complications
#
#	oki since i dont use any of these so called distributions. i need to
#	install some other stuff to. oki i could have them installed once and
#	forever into another dir but well maybe i gonna change this one one day
#	but its for sure not today.
#
###############################################################################
if [ $GXYMODE == "TRUE" ] ; then
	for PROGRAM in $PROGRAMS ; do
		if [ -d $TEMPDIR/$PROGRAM-installed-gxy ] ; then
			echo -e "\\033[1;34mskipping program: \\033[1;36m$PROGRAM\\033[0m"
		else
			if ! cd $TEMPDIR/$PROGRAM ; then
				echo -e "\\033[1;34msorry, program: \\033[1;36m$PROGRAM \\033[1;34mmissing. please check.\\033[0m"
				exit 1
			else
				echo -e "\\033[1;34mbuilding program: \\033[1;36m$PROGRAM\\033[0m"
				if [ $PROGRAM == "zlib-1.1.3" ] ; then
					if ! ./configure --prefix=$PREFIXDIR --sysconfdir=$SYSCONFDIR --shared ; then
						echo -e "\\033[1;34mproblems happened.\\033[0m"
						exit 1
					fi
				fi

				if [ $PROGRAM == "tiff-v3.5.7" ] ; then
					if ! ./configure --prefix=$PREFIXDIR --noninteractive ; then
						echo -e "\\033[1;34mproblems happened.\\033[0m"
						exit 1
					fi
				fi

				if [ $PROGRAM == "libungif-4.1.0b1" ] ; then
					if ! ./configure --prefix=$PREFIXDIR --sysconfdir=$SYSCONFDIR ; then
						echo -e "\\033[1;34mproblems happened.\\033[0m"
						exit 1
					fi

					sed "s/#define HAVE_VARARGS_H 1//g" config.h > config.h.tmp
					mv config.h.tmp config.h
				fi

				if [ $PROGRAM == "libpng-1.2.1" ] ; then
					if ! make -f scripts/makefile.linux ; then
						echo -e "\\033[1;34mmake failed.\\033[0m"
						echo
						echo -e "\\033[1;34mother issues: ctrl-c was pressed, or missing libraries. check config.log.\\033[0m"
						exit 1
					fi

					if ! make -f scripts/makefile.linux install ; then
						echo -e "\\033[1;34minstall failed.\\033[0m"
						exit 1
					fi
				fi

				if [ $PROGRAM == "jpeg-6b" ] ; then
					if ! ./configure --prefix=$PREFIXDIR --sysconfdir=$SYSCONFDIR --enable-shared --enable-static ; then
						echo -e "\\033[1;34mproblems happened.\\033[0m"
						exit 1
					fi
				fi

				if [ $PROGRAM == "popt-1.6" ] ; then
					if ! ./configure --prefix=$PREFIXDIR --sysconfdir=$SYSCONFDIR ; then
						echo -e "\\033[1;34mproblems happened.\\033[0m"
						exit 1
					fi

					sed "s/#include <math.h>/#include <math.h>\n#include <values.h>/g" popt.c > popt.c.tmp
					mv popt.c.tmp popt.c
				fi

				if [ $PROGRAM == "pkgconfig-0.8.0" ] ; then
					if ! ./configure --prefix=$PREFIXDIR --sysconfdir=$SYSCONFDIR ; then
						echo -e "\\033[1;34mproblems happened.\\033[0m"
						exit 1
					fi
				fi

				if [ $PROGRAM == "audiofile-0.2.3" ] ; then
					if ! ./configure --prefix=$PREFIXDIR --sysconfdir=$SYSCONFDIR ; then
						echo -e "\\033[1;34mproblems happened.\\033[0m"
						exit 1
					fi
				fi

				if [ $PROGRAM != "libpng-1.2.1" ] ; then
					if ! make ; then
						echo -e "\\033[1;34mmake failed.\\033[0m"
						echo
						echo -e "\\033[1;34mother issues: ctrl-c was pressed, or missing libraries. check config.log.\\033[0m"
						exit 1
					fi

					if ! make install ; then
						echo -e "\\033[1;34minstall failed.\\033[0m"
						exit 1
					fi
				fi

				ldconfig
				mv -f $TEMPDIR/$PROGRAM $TEMPDIR/$PROGRAM-installed-gxy
			fi
		fi
	done
fi

###############################################################################
#
#	status: no complications
#
#	oki now let's build and install the newly downloaded packages. if there
#	breaks something, then you get an erroroutput with some basic steps to
#	solve these issues. if something fails, then you can change into the
#	problematic directory of the package and solve issues. then you simply
#	restart this script. no need to change something here.
#
###############################################################################
for MODULE in $MODULES ; do
	if [ -d $TEMPDIR/$MODULE-installed-gxy ] ; then
		echo -e "\\033[1;34mskipping module: \\033[1;36m$MODULE\\033[0m"
	else
		if ! cd $TEMPDIR/$MODULE ; then
			echo -e "\\033[1;34msorry, module: \\033[1;36m$MODULE \\033[1;34mmissing. please check.\\033[0m"
			exit 1
		else
			if [ $GXYMODE == "TRUE" ] && [ $MODULE == "gdm2" ] ; then
				echo -e "\\033[1;34mentering special galaxy mode for module: \\033[1;36m$MODULE\\033[0m"
				SYSCONFBAK=$SYSCONFDIR
				SYSCONFDIR=/etc
			fi

			echo -e "\\033[1;34mbuilding module: \\033[1;36m$MODULE\\033[0m"
			if [ ! -f $TEMPDIR/$MODULE/configure ] ; then
				if ! ./autogen.sh --prefix=$PREFIXDIR --sysconfdir=$SYSCONFDIR --disable-more-warnings ; then
					echo -e "\\033[1;34mcan't create config files. please make sure you have recent autoconf, automake,\\033[0m"
					echo -e "\\033[1;34mgettext and libtool packages installed on your system.\\033[0m"
					echo
					echo -e "\\033[1;34mforce: if all fails, create this component manually by enforcing exactly these\\033[0m"
					echo -e "\\033[1;34mcommands. './autogen.sh', 'libtoolize -f', 'automake -a', 'autoconf'. for new\\033[0m"
					echo -e "\\033[1;34mconfigure.in files, there is versioncheck that checks for a special version.\\033[0m"
					echo -e "\\033[1;34mtry editing that file and change the version then rerun this script.\\033[0m"
					exit 1
				fi
			else
				if ! ./configure --prefix=$PREFIXDIR --sysconfdir=$SYSCONFDIR --disable-more-warnings ; then
					echo -e "\\033[1;34mstill problems with automake and autoconf. bugreport.\\033[0m"
					exit 1
				fi
			fi

			if [ $GXYMODE == "TRUE" ] && [ $MODULE == "gdm2" ] ; then
				echo -e "\\033[1;34mentering special galaxy mode for module: \\033[1;36m$MODULE\\033[0m"
				SYSCONFDIR=$SYSCONFBAK
			fi

			if ! make ; then
				echo -e "\\033[1;34mmake failed. this could happen with different issues. please check if includes\\033[0m"
				echo -e "\\033[1;34mare set correctly. some newer CVS packages put their includes in newly subdirs\\033[0m"
				echo -e "\\033[1;34mto allow gnome 1.4 and 2.0 paralellbuilds. some older packs can't find these\\033[0m"
				echo -e "\\033[1;34mincludes because of broken configure.in files. you should tweak your include\\033[0m"
				echo -e "\\033[1;34mpath a bit to make them accessible again. usually link the include subdirs to\\033[0m"
				echo -e "\\033[1;34mthe include rootdir.\\033[0m"
				echo
				echo -e "\\033[1;34mother issues: ctrl-c was pressed, or missing libraries. check config.log.\\033[0m"
				exit 1
			fi

			if ! make install ; then
				echo -e "\\033[1;34mpossible issue. missing docbook. please install docbook support or consult the\\033[0m"
				echo -e "\\033[1;34mprogrammer of this package and tell him about this.\\033[0m"
				exit 1
			fi

			ldconfig
			mv -f $TEMPDIR/$MODULE $TEMPDIR/$MODULE-installed-gxy
		fi
	fi
done

exit 0
# End /tmp/dognome


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]