All pastes #411361 Raw Edit

Stuff

public text v1 · immutable
#411361 ·published 2007-03-26 23:39 UTC
rendered paste body
#!/bin/bash


#############
# Functions #
#############
depend() {
# usage: depend pkgname filename pkg_dir
	if [ -e $3/$2 ]; then
		rm $3/$2
	fi
	echo "==> Downloading $1/$2"
	wget -c http://aur.archlinux.org/packages/$1/$1/$2
}


ORDER="imlib2-cvs edb-cvs eet-cvs imlib2_loaders-cvs evas-cvs embryo-cvs efreet-cvs ecore-cvs edje-cvs e-cvs etk-cvs epeg-cvs epsilon-cvs emotion-cvs ewl-cvs esmart-cvs eclair-cvs elicit-cvs entice-cvs entrance-cvs engrave-cvs evfs-cvs entropy-cvs ephoto-cvs examine-cvs exml-cvs e_modules-cvs"
src_dir="/usr/src"
e17_dir="$src_dir/e17"



####################################
# Verify permission to take action #
####################################
if [ -w $src_dir ]
then
	echo "Beginning to make e17, this may take some time"
else
	echo "You have insufficent privilges to run this command, please become root to run this"
	exit 1
fi



################################
# Enter into the e17 directory #
################################
mkdir -p $e17_dir
if [ ! -d $e17_dir ]
then
	rm $e17_dir &>/dev/null
	mkdir -p $e17_dir
fi
cd $e17_dir



for pkg_name in $ORDER; do

	pkg_dir="$e17_dir/$pkg_name"
	clear
	echo Package Order:
	echo $ORDER
	echo
	echo Building Package For $pkg_name



	####################################################
	# Enter into the directory for the current package #
	####################################################
	mkdir -p $pkg_dir 2>/dev/null
	if [ ! -d $pkg_dir ]; then
		rm $pkg_dir &>/dev/null
		mkdir -p $pkg_dir
	fi
	cd $pkg_dir



	########################################
	# Verify the existance of the PKGBUILD #
	# if it fails download it from the AUR #
	########################################
	depend $pkg_name PKGBUILD $pkg_dir



	########################
	# Special Dependancies #
	########################
	
	## Evas
	if [ $pkg_name = "evas-cvs" ]; then
		depend $pkg_name e17.profile $pkg_dir
		depend $pkg_name evas-cvs.install $pkg_dir
	fi


	## Eclair
	if [ $pkg_name = "eclair-cvs" ]; then
		depend $pkg_name eclair.desktop $pkg_dir
	fi


	## Entrance
	if [ $pkg_name = "entrance-cvs" ]; then
		depend $pkg_name entranced $pkg_dir
        fi


	## Elicit
	if [ $pkg_name = "elicit-cvs" ]; then
		depend $pkg_name elicit.desktop $pkg_dir
        fi


	## Entice
	if [ $pkg_name = "entice-cvs" ]; then
		depend $pkg_name entice.desktop $pkg_dir
        fi


	## Entropy
	if [ $pkg_name = "entropy-cvs" ]; then
		depend $pkg_name entropy.desktop $pkg_dir
        fi


	## Ephoto
	if [ $pkg_name = "ephoto-cvs" ]; then
		depend $pkg_name ephoto.desktop $pkg_dir
        fi

	######################
	# Remove stale files #
	######################
	rm -r *.pkg* pkg/ filelist &>/dev/null



	#################
	# Build Package #
	#################
	versionpkg -f -o="-scimj 2 --noconfirm --noprogressbar" &>/usr/src/e17/.error-log



	##############################################
	# On failure to build, prompt user to resume #
	##############################################
	if [ $? -eq 1 ]; then
                i=1;
		while [ $i -eq 1 ] ; do
			echo "Build of $pkg_name Fails, Continue? (N/y/e)"
			echo "e = print error code and ask again"
			read opt

			case "$opt" in
				y)
					echo "Continuing pkgbuild"
					i=0
				;;
				e)
					less /usr/src/e17/.error-log
				;;
				n)
					echo "Exiting..."
					exit 1
			esac
		done			
	else
		echo "Build of $pkg_name complete"
	fi 


	##############################
	# Return to the e17 root dir #
	##############################
	cd $e17_dir

done