#!/bin/bash
shopt -s extglob

source $PWD/.configure/base
source $PWD/.configure/color
source $PWD/.configure/messages
source $PWD/.configure/help
source $PWD/.configure/checks
source $PWD/.configure/substitute

case $1 in

	*mm | *maint* )

	shift

	case $1 in

		*prefix* )
			PREFIX=$(echo $1 | gawk -F \= '{ print $2 }')
		;;

		* )
			PREFIX=/usr
		;;
	esac

	maintainer_message

	copy_in_files
	substitute_values

	export PATH="$OLDPATH"

	end_message

	;;

	*help )

	display_help

	;;

	* )

	case $1 in

		*prefix* )
			PREFIX=$(echo $1 | gawk -F \= '{ print $2 }')
		;;

		* )
			PREFIX=/usr
		;;
	esac

	start_message

	check_apps 	APP 		Required 	Applications
	check_apps 	OPT_APP 	Optional 	Applications
	check_apps 	OPT_SBINAPP 	Optional 	Superuser-Applications
	#check_libs 	LIB 		Required 	Libraries
	check_pymods 	PYMOD 		Required 	Python-Modules

	copy_in_files
	substitute_values

	export PATH="$OLDPATH"

	end_message

	;;

esac

tput sgr0
