Modified build script

Biju Chacko biju_chacko at vsnl.net
Tue Mar 4 05:10:35 CET 2003


Benedikt:

Find attached patch to your build script. My changes and fixes are:

o Fixed a typo in 'sudo' checking

o Added continuation characters for multiline commands. They wouldn't
work for me otherwise.

o Added an option (-n) to skip download of source

o Added an option (-i) to ignore a comma delimited list of modules
during the build process.

Hope it's useful.

-- b

--
-----------------------------------------------------------------------
Biju 'botsie' Chacko                        biju_chacko at vsnl dot net
http://www.symonds.net/~botsie          Public Key available on request
-----------------------------------------------------------------------
-------------- next part --------------
--- installxfce.sh.orig	2003-03-04 09:24:08.000000000 +0530
+++ installxfce.sh	2003-03-03 14:58:22.000000000 +0530
@@ -31,6 +31,8 @@
 prefix="/usr/local"
 releasedir=""
 xinerama="disable"
+download="yes"
+ignore=""
 
 # examine build environment
 sysname=`uname -s | tr 'A-Z' 'a-z'`
@@ -39,7 +41,7 @@
 # print out usage information
 usage()
 {
-	echo "Usage: installxfce [-Xdgh] [-b <builddir>] [-p <prefix>]"
+	echo "Usage: installxfce [-Xdghsv] [-b <builddir>] [-p <prefix>]"
 	echo " The flags are:"
 	echo "  -X              Enable the use of Xinerama"
 	echo "  -b <builddir>   Build Xfce4 in directory <builddir>"
@@ -50,6 +52,8 @@
 	echo "  -r <releasedir> Build release in <releasedir>"
 	echo "  -s              Use sudo(8) to install"
 	echo "  -v              Show version information"
+	echo "  -n              Don't download source"
+	echo "  -i <modules>    Ignore modules in comma separated list"
 	echo
 	echo "Report bugs to benedikt.meurer at unix-ag.uni-siegen.de."
 	echo
@@ -103,7 +107,7 @@
 	fi
 }
 
-arguments=`getopt "Xb:dghp:r:sv" ${*}`
+arguments=`getopt "Xb:dghp:r:svni:" ${*}`
 if [ ${?} != 0 ]; then
 	usage >&2
 fi
@@ -132,12 +136,18 @@
 			releasedir=`echo ${2} | sed 's/\/*$//'`; shift;
 			;;
 		-s)
-			SUDO="sud"
+			SUDO="sudo"
 			check_sudo
 			;;
 		-v)
 			version
 			;;
+                -n)
+                        download="no"
+                        ;;
+		-i)
+			ignore=`echo ${2} | sed 's/,/ /g'`; shift
+			;;
 	esac
 	shift
 done
@@ -184,38 +194,50 @@
 # create ${builddir} if required
 [ ! -d ${builddir} ] && (mkdir -p ${builddir} || exit 1);
 
-echo
-echo "*************************************************************************"
-echo "* You will now be asked for a password to login to the CVS server, just *"
-echo "* press <ENTER>.                                                        *"
-echo "*************************************************************************"
-echo 
-
-cvs -d ${CVSROOT} login || error "Unable to login to the CVS server."
+if [ ${download} == "yes" ]; then
 
-cd ${builddir} || exit 1;
+        echo
+        echo "*************************************************************************"
+        echo "* You will now be asked for a password to login to the CVS server, just *"
+        echo "* press <ENTER>.                                                        *"
+        echo "*************************************************************************"
+        echo 
+
+        cvs -d ${CVSROOT} login || error "Unable to login to the CVS server."
+
+        cd ${builddir} || exit 1;
+
+        if [ -d xfce-devel ]; then
+                # seems it was already checked out, so simply update
+                echo
+                echo "*************************************************************************"
+                echo "* The Xfce4 distribution will now be updated from the CVS server, sit   *"
+                echo "* down and get you a cup of coffee, this will take some time.           *"
+                echo "*************************************************************************"
+                echo
+
+                cvs -Q -z7 -d ${CVSROOT} update -P xfce-devel ||
+                        error "Unable to update the Xfce4 distribution from the CVS server."
+        else
+                echo
+                echo "*************************************************************************"
+                echo "* The Xfce4 distribution will now be fetched from the CVS server, sit   *"
+                echo "* down and get you a cup of coffee, this will take some time.           *"
+                echo "*************************************************************************"
+                echo
+
+                cvs -Q -z7 -d ${CVSROOT} checkout -P xfce-devel ||
+                        error "Unable to fetch the Xfce4 distribution from the CVS server."
+        fi
 
-if [ -d xfce-devel ]; then
-	# seems it was already checked out, so simply update
-	echo
-	echo "*************************************************************************"
-	echo "* The Xfce4 distribution will now be updated from the CVS server, sit   *"
-	echo "* down and get you a cup of coffee, this will take some time.           *"
-	echo "*************************************************************************"
-	echo
-
-	cvs -Q -z3 -d ${CVSROOT} update -P xfce-devel ||
-		error "Unable to update the Xfce4 distribution from the CVS server."
 else
-	echo
-	echo "*************************************************************************"
-	echo "* The Xfce4 distribution will now be fetched from the CVS server, sit   *"
-	echo "* down and get you a cup of coffee, this will take some time.           *"
-	echo "*************************************************************************"
-	echo
+        echo
+        echo "*************************************************************************"
+        echo "* Skipping download of source                                           *"
+        echo "*************************************************************************"
+        echo 
+        cd ${builddir} || exit 1;
 
-	cvs -Q -z3 -d ${CVSROOT} checkout -P xfce-devel ||
-		error "Unable to fetch the Xfce4 distribution from the CVS server."
 fi
 
 cd xfce-devel || exit 1;
@@ -245,28 +267,53 @@
 export CFLAGS CPPFLAGS LDFLAGS
 
 for module in ${modules}; do
+        
+        # check if this module is in the ignore list.
+        # I'm sure there's a better way to do this ...
+        for ignore_module in ${ignore}; do
+            if [ ${module} == ${ignore_module} ]; then
+                skip="yes"
+                break
+            else
+                skip="no"
+            fi
+        done
+        if [ ${skip} == "yes" ]; then
+            
+            echo
+            echo "Skipping ${module} build ..."
+            echo
+            continue
+        fi
+        
 	module_name=`echo ${module} | sed 's/-/_/g'`
 	eval _confflags=\$${module_name}_confflags
 
-	(cd ${module}
-	 && (${MAKE} distclean > /dev/null 2> /dev/null || true)
-	 && libtoolize --force
+        echo
+        echo "Building ${module} ..."
+        echo
+
+	(cd ${module} \
+         && (${MAKE} distclean > /dev/null 2> /dev/null || true) \
+	 && libtoolize --force \
 	 && sh autogen.sh --prefix=${prefix} --${debug}-debug ${_confflags} \
-	    "${machine}--${sysname}"
-	 && rm -f libtool
-	 && ln -s ${LIBTOOL} libtool
-	 && ${MAKE} all
-	 && ${SUDO} ${MAKE} DESTDIR=${releasedir} install) ||
+	    "${machine}--${sysname}" \
+	 && rm -f libtool \
+	 && ln -s ${LIBTOOL} libtool \
+	 && ${MAKE} all \
+	 && ${SUDO} ${MAKE} DESTDIR=${releasedir} install) || \
 		error "Compilation of \"${module}\" failed."
 done
 
-cvs -d ${CVSROOT} logout
+if [ ${download} == "yes" ]; then
+        cvs -d ${CVSROOT} logout
+fi
 
 if [ ! -z "${releasedir}" ]; then
 	releasefile="xfce-cvs-${sysname}-${machine}.tar"
-	(cd ${releasedir}
-	 && tar cf "${releasedir}/${releasefile}" .
-	 && gzip --best "${releasedir}/${releasefile}") ||
+	(cd ${releasedir} \
+	 && tar cf "${releasedir}/${releasefile}" . \
+	 && gzip --best "${releasedir}/${releasefile}") || \
 		error "Unable to create release file"
 	echo "Release ready in ${releasedir}/${releasefile}.gz"
 fi


More information about the Xfce4-dev mailing list