#!/usr/bin/bash
# Almohazzem 1.3.2
# Under Waqf License 
# By Mosaab Alzoubi (moceap@hotmail.com - facebook.com/moceap)
# Almasa Project
# 1434-7-15
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Pre-program---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
DATEofRelease_ar="الأحد الخامس عشر من شهر رجب سنة أربع وثلاثين وأربعمئة وألف" #Generated by hijri terminal 3.1
DATEofRelease_en="Wed 1434-7-15"
mo_arg="$@"
mo_1="$1"
mo_2="$2"
mo_3="$3"
mo_4="$4"
mo_ver="1.3.2"
mo_maindir="$HOME/.almohazzem"
mo_icon=/usr/share/pixmaps/almohazzem.png
mo_image=/usr/share/pixmaps/almohazzem2.png
tmp="$mo_maindir"/tmp
cache="$mo_maindir"/cache
uns="$mo_maindir"/Uninstalls
runs="$tmp/runs"
svs="$tmp/svs"
logs="$mo_maindir/logs"
#---Super-user-detect---
if [ "$mo_1" = "--sudo" ]
	then
		if [ "$mo_2" = "enable" ]
			then
				touch "$mo_maindir/sudo"
		elif [ "$mo_2" = "disable" ]
			then if [ -e "$mo_maindir/sudo" ] ; then
				rm "$mo_maindir/sudo" ; fi
		else echo "No thing to do."
		fi
		exit
fi
if [ "`whoami`" = "root" ] 
	then
		sucom=""
	else
	if ! [ -e "$mo_maindir/sudo" ]
		then
			sucom="su -c"
		else
			sucom="sudo"
	fi
fi
#---Main-folders-files-detect---
if ! [ -e "$mo_maindir" ]
	then
		mkdir "$mo_maindir"
fi
if ! [ -e "$tmp" ]
	then
		mkdir "$tmp"
fi
if ! [ -e "$logs" ]
	then
		mkdir "$logs"
fi
if ! [ -e "$runs" ]
	then
		mkdir "$runs"
fi
if ! [ -e "$svs" ]
	then
		mkdir "$svs"
fi
if ! [ -e "$uns" ]
	then
		mkdir "$uns"
fi
if ! [ -e "$cache" ]
	then
		mkdir "$cache"
fi
if ! [ -e "$mo_maindir/language" ]
	then
		touch "$mo_maindir/language"
fi
if [ -e /usr/almasa/reqs/gtkdialog ]
	then
		mo_gtkdialog=/usr/almasa/reqs/gtkdialog
	else
		mo_gtkdialog=gtkdialog
fi
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Include-Rpm-Ls-Function---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
rpmls()
{
arg="$@"
if [ "$arg" = "--help" ]
	then echo "Rpm ls 0.1 is a tool that list files with method compatible with rpm spec rules .
1434-6-21 
Almasa Project (c) Waqf license"
	exit
fi
if ! [ "$arg" ]
	then arg=.
fi
lnk="`readlink -f "$arg"`"
find "$lnk" | while read link
do 
	if [ -d "$link" ]
		then if ! [ "$(ls -A "$link")" ]
			then rpmlnk="`echo $link | sed "s:$lnk::g"`"
			echo '"'$rpmlnk'"'
		fi
	fi
	if [ -f "$link" ]
		then rpmlnk="`echo $link | sed "s:$lnk::g"`"
		echo '"'$rpmlnk'"'
	fi
done
}
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Terminal-arg-options---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
if [ "$mo_arg" = "--version" ]
	then
		echo "$mo_ver"
		exit
fi
if ! [ "$mo_arg" ]
	then
		mo_arg="--help"
fi
if [ "$mo_arg" = "--help" ]
	then
		echo "Almohazzem "$mo_ver" Powerful Linux Packaging SDK

--gui to run Almohazzem in GUI mode .
	Some of options in GUI mode is ( new , icon )
	--gui Options :
	(new) to direct reaching to new project window .
	(icon) to direct reaching to new Icon Generator Application .
	(desktop) to direct reaching to new Desktop entries Generator Application .
--sudo to use sudo instead of su in terminal .
	options ( enable , disable )
--rpmls ( --rpmls --help for more information) .
--convert to convert between rpm , deb , tgz , lsb , pkg . 
	like almohazzem --convert deb sample.rpm /path/to/target (or none)
--install ( direct - force )
	like almohazzem --install direct sample.deb
--un-install for Uninstall packages which Un-formal installed by Almohazzem
	like almohazzem --un-install first_1-1_i386.deb-20130509104528
  Note: That first_1-1_i386.deb has been forced ( or sync ) installed on 
	Redhat-based system and 20130509104528 its Almohazzem ID .
	also you can run (almohazzem --un-install list) to list un-formal
	installed item .

--help for help
--language for change Almohazzem GUI language
--version for show version of Almohazzem"
		exit
fi
if [ "$mo_1" = "--rpmls" ]
	then
		lsvar="`echo "$mo_arg" | sed "s/--rpmls //g" | sed "s/--rpmls//g"`"
		rpmls "$lsvar"
		exit
fi
if [ "$mo_1" = "--convert" ]
	then
		sou="`readlink -f "$mo_3"`"
		if [ "$mo_2" = deb ]
			then
				sec="-dwkc"
		elif [ "$mo_2" = rpm ]
			then
				sec="-rwkc"
		elif [ "$mo_2" = tgz ]
			then
				sec="-twkc"
		elif [ "$mo_2" = lsb ]
			then
				sec="-lwkc"
		elif [ "$mo_2" = pkg ]
			then
				sec="-pwkc"
		fi
		if [ "$mo_4" ]
			then
				cd "$mo_4"
				fakeroot almohawell $sec "$sou"
			else
				fakeroot almohawell $sec "$mo_3"
		fi
		exit
fi
if [ "$mo_1" = "--install" ]
	then
		sou="`readlink -f "$mo_3"`"
		nme="`basename "$sou"`"
		typ="`echo "$sou" | tail -c 4`"
		if ! [ -e "$sou" ]
			then
				echo "No entry or entry not found"
				exit
		fi
		if [ "$mo_2" = direct ]
			then 
				if [ "$typ" = rpm ]
					then
						$sucom "rpm -Uvh "$sou""
				elif [ "$typ" = deb ]
					then
						$sucom dpkg -i "$sou"
				else
					echo "Only rpm and deb supported by --install direct option"
				fi
		fi
		if [ "$mo_2" = force ]
			then
				id=$(date +%Y%m%d%H%M%S)
				mkdir "$tmp/$id"
				if [ "$typ" = rpm ]
					then
						cp "$sou" "$tmp/$id"
						cd "$tmp/$id"
						rpm2cpio "$nme" | cpio -idm
						rm "$nme"
				elif [ "$typ" = deb ]
					then
						dpkg -x "$sou" "$tmp/$id"
						for stat in debian DEBIAN Debian
							do
								rm -rf "$tmp/$id/$stat"
							done
				else
					echo "Only rpm and deb supported by --install force option"
				fi	
				if [ "$mo_4" = OK ]
					then 
						ok=OK
					else
						read -p "Be Sure You Want That , You Want To Copy Package Contains To Root System DIR
This Is Danger If You Are Un-Expert .
Type (OK) if You Are Agree , no warranty for program actions , Enter to cancel " ok
				fi
				if [ "$ok" = "OK" ]
					then
						echo "#! /bin/bash" > "$uns/$nme-$id"
						echo "#! /bin/bash" > "$tmp/z$id"
						rpmls "$tmp/$id" > "$tmp/y$id"
						cat "$tmp/y$id" | while read str
						do
							sts="`echo $str | sed 's:"::g'`"
							if [ -f "$tmp/$id$sts" ]
								then
									echo "rm -rf "'"'$sts'"'"" >> "$uns/$nme-$id"
								else
									echo "rm "'"'$sts'"'"" >> "$uns/$nme-$id"
							fi
						done
						chmod +x "$uns/$nme-$id"
						cat "$tmp/y$id" | while read str
						do
							sts="`echo $str | sed 's:"::g'`"
							echo "chmod -R a+rX "'"'$sts'"'"" >> "$tmp/z$id"
						done
						chmod +x "$tmp/z$id"
						$sucom "cp -r "$tmp/$id/*" / ; "$tmp/z$id" "
				fi
				rm -rf "$tmp/$id"
				rm "$tmp/y$id"	
				rm "$tmp/z$id"	
		fi
		exit
fi
if [ "$mo_1" = "--un-install" ]
	then
		if [ "$mo_2" = list ]
			then
				ls "$uns"
				exit
		fi
		if ! [ "$mo_2" ]
			then
				echo "No thing to do ."
				exit
		fi
		unn="`echo "$mo_arg" | sed "s:--un-install::g"`"
		for una in $unn
			do
				if ! [ -e "$uns/$una" ]
					then 
						echo "No $una installed"
					else
						$sucom "$uns/$una"
						rm "$uns/$una"
				fi
			done
		exit
fi
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Language-Select---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
lang_dir="/usr/almasa/languages/almohazzem"
sys_lang=$(echo $LANG | cut -c 1,2)
detect_language()
{
if [ "$T_lang_select" = "" ]
	then T_lang_select="اختر اللغة -- Select Language"
fi
lang_list="$(ls "$lang_dir")"
if ! [ -e "$tmp/langtmp" ] ; then
mkdir "$tmp/langtmp" ; fi
lnames()
{
for lang in $lang_list
do
langname=$(cat $lang_dir/$lang | grep AlmasaLanguageSystem_Name | sed s/AlmasaLanguageSystem_Name=//g)
touch "$tmp/langtmp/$langname"
echo $lang > "$tmp/langtmp/$langname"
echo '				<item>'"$langname"'</item>'
done
}
echo '<window title="'$T_lang_select'" image-name="'$mo_icon'" window_position="1">
	<vbox>
		<frame "'$T_lang_select'">
			<comboboxtext>
				<variable>langselected</variable>
'"$(lnames)"'
			</comboboxtext>
		</frame>
		<hbox>
			<button ok>
				<action>cat '"$tmp/langtmp/"'$langselected > '"$mo_maindir/language"'</action>
				<action>exit:Quit</action>
			</button>
			<button cancel></button>
		</hbox>
	</vbox>
</window>
' > "$tmp"/language_temp
"$mo_gtkdialog" --file="$tmp"/language_temp > /dev/null &
mo_language=$(cat "$mo_maindir/language")
}
mo_language=$(cat "$mo_maindir/language")
if [ "$mo_language" = "" ]
	then
		mo_language=$sys_lang
		if [ "$mo_language" = "" ] 
			then
				detect_language
		fi
fi
if [ "$mo_arg" = "--language" ]
	then
		source "$lang_dir/$mo_language"
		detect_language
		exit
fi
if [ ! -e "$lang_dir/$mo_language" ]
	then detect_language
fi
source "$lang_dir/$mo_language"
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Conditional-Starts---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
if [ "$mo_1" = "--openmode" ]
	then Openmode="true"
	source "$tmp/opend/core"
	if [ "$projecttype" = "true" ]
		then
		SOurCeoN="true"
	fi
fi
if [ "$mo_2" = "source" ]
	then
		SOurCeoN="true"
fi
if [ "$SOurCeoN" = "true" ]
	then
		SSS="true"
		echo '<sensitive>false</sensitive>' > "$tmp/dialogsource3"
		echo "$TloG" > "$logs"/tmp
		echo '<vbox><frame '$SofS'>
		<text use-markup="true">
			<label>"<span><b>'"$SintrO"'</b></span>"</label>
		</text></frame>		
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$FolDeR"'</b></span>"</label>
				</text>
				<entry fs-title="'$FolDeR'" fs-action="folder">
					<variable>AlmohazzemIDV46</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV46" ] ; then echo "<default>$SV46</default>" ; fi ; fi`"'
				</entry>
				<button>
					<input file stock="gtk-open"></input>
					<action>fileselect:AlmohazzemIDV46</action>
	<action>echo "cd "$AlmohazzemIDV46" ; ./configure --prefix=/usr" > "'$tmp'"/AlmohazzemIDV47</action>
	<action>echo "cd "$AlmohazzemIDV46" ; make" > "'$tmp'"/AlmohazzemIDV48</action>
	<action>echo "cd "$AlmohazzemIDV46" ; make install DESTDIR="'$cache'/AlmohazzemID"" > "'$tmp'"/AlmohazzemIDV49</action>
	<action>if [ -e "'$cache'/AlmohazzemID" ] ; then rm -rf "'$cache'/AlmohazzemID" ; fi</action>
	<action>mkdir "'$cache'/AlmohazzemID"</action>
					<action>refresh:AlmohazzemIDV47</action>
					<action>refresh:AlmohazzemIDV48</action>
					<action>refresh:AlmohazzemIDV49</action>
				</button>
			</hbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$ConfComm"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV47</variable>
				<sensitive>false</sensitive>
				<input file>"'$tmp'/AlmohazzemIDV47"</input>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV47" ] ; then echo "<default>$SV47</default>" ; fi ; fi`"'
				</entry><button><label>"'$SSdo'"</label>
<action>echo "$AlmohazzemIDV47" > "'$tmp'/ConFcoM"</action>
<action>bash "'$tmp'/ConFcoM" > "'$logs'"/AlmohazzemID-Configure</action>
					<action>cp "'$logs'/AlmohazzemID-Configure" "'$logs'/tmp"</action>
					<action>refresh:SLOG</action>
				</button>
				<button><label>"'$SSedIt'"</label>
					<action>enable:AlmohazzemIDV47</action>
				</button>
			</hbox>
			<checkbox><label>"'$sDoNe'"</label><default>false</default>
			<action>if true enable:BuTTM</action><action>if false disable:BuTTM</action></checkbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$MakeComm"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV48</variable>
				<sensitive>false</sensitive>
				<input file>"'$tmp'/AlmohazzemIDV48"</input>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV48" ] ; then echo "<default>$SV48</default>" ; fi ; fi`"'
				</entry><button><label>"'$SSdo'"</label>
<action>echo "$AlmohazzemIDV48" > "'$tmp'/MakEcoM"</action>
<action>bash "'$tmp'/MakEcoM" > "'$logs'"/AlmohazzemID-Make</action>
					<action>cp "'$logs'/AlmohazzemID-Make" "'$logs'/tmp"</action>
					<action>refresh:SLOG</action>
				<sensitive>false</sensitive><variable>BuTTM</variable></button>
				<button><label>"'$SSedIt'"</label>
					<action>enable:AlmohazzemIDV48</action>
				</button>	
			</hbox>
			<checkbox><label>"'$sDoNe'"</label><default>false</default>
			<action>if true enable:BuTTM2</action><action>if false disable:BuTTM2</action></checkbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$SetMCOmm"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV49</variable>
				<sensitive>false</sensitive>
				<input file>"'$tmp'/AlmohazzemIDV49"</input>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV49" ] ; then echo "<default>$SV49</default>" ; fi ; fi`"'
				</entry><button><label>"'$SSdo'"</label>
<action>echo "$AlmohazzemIDV49" > "'$tmp'/MakE2coM"</action>
<action>bash "'$tmp'/MakE2coM" > "'$logs'"/AlmohazzemID-MakeInstall</action>
					<action>cp "'$logs'/AlmohazzemID-MakeInstall" "'$logs'/tmp"</action>
					<action>refresh:SLOG</action><action>enable:StArT2</action>
				<sensitive>false</sensitive><variable>BuTTM2</variable></button>
			</hbox>
		<edit><input file>"'$logs'/tmp"</input>
		<variable>SLOG</variable></edit>
		</vbox>' > "$tmp/dialogsource1"
		echo '<default>'$cache'/AlmohazzemID</default><sensitive>false</sensitive>
			</entry><button><sensitive>false</sensitive>' > "$tmp/dialogsource2"
	else
		SSS="false"
		for no in 1 3
		do
		if [ -e "$tmp/dialogsource$no" ]
			then
				rm "$tmp/dialogsource$no"
		fi
		touch "$tmp/dialogsource$no"
		done
		echo '</entry><button>' > "$tmp/dialogsource2"
fi
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#******************************---ALMOHAZZEM-CORE---******************************
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
CORE()
{
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Vars---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
buildroot="`echo "$@"| awk -F"¶¶¶" '{print $33}'`"
AID="`echo "$@"| awk -F"¶¶¶" '{print $34}'`"
summary="`echo "$@"| awk -F"¶¶¶" '{print $2}'`"
name="`echo "$@"| awk -F"¶¶¶" '{print $3}'`"
ver="`echo "$@"| awk -F"¶¶¶" '{print $4}'`"
release="`echo "$@"| awk -F"¶¶¶" '{print $5}'`"
license="`echo "$@"| awk -F"¶¶¶" '{print $6}'`"
group="`echo "$@"| awk -F"¶¶¶" '{print $7}'`"
url="`echo "$@"| awk -F"¶¶¶" '{print $8}'`"
vendor="`echo "$@"| awk -F"¶¶¶" '{print $9}'`"
prebuildroot="`echo "$@"| awk -F"¶¶¶" '{print $10}'`"
outputdir="`echo "$@"| awk -F"¶¶¶" '{print $11}'`"
maintainer="`echo "$@"| awk -F"¶¶¶" '{print $12}'`"
email="`echo "$@"| awk -F"¶¶¶" '{print $13}'`"
spec_gen="`echo "$@"| awk -F"¶¶¶" '{print $14}'`"
polds="`echo "$@"| awk -F"¶¶¶" '{print $15}'`"
prequires="`echo "$@"| awk -F"¶¶¶" '{print $16}'`"
prpmprovides="`echo "$@"| awk -F"¶¶¶" '{print $17}'`"
prpmconflicts="`echo "$@"| awk -F"¶¶¶" '{print $18}'`"
olds="`echo "$polds¶¶¶" | sed "s:, ¶¶¶::g" | sed "s:¶¶¶::g"`"
requires="`echo "$prequires¶¶¶" | sed "s:, ¶¶¶::g" | sed "s:¶¶¶::g"`"
rpmprovides="`echo "$prpmprovides¶¶¶" | sed "s:, ¶¶¶::g" | sed "s:¶¶¶::g"`"
rpmconflicts="`echo "$prpmconflicts¶¶¶" | sed "s:, ¶¶¶::g" | sed "s:¶¶¶::g"`"
rpmauto="`echo "$@"| awk -F"¶¶¶" '{print $19}'`"
srpm="`echo "$@"| awk -F"¶¶¶" '{print $20}'`"
ads="`echo "$@"| awk -F"¶¶¶" '{print $21}'`"
control_gen="`echo "$@"| awk -F"¶¶¶" '{print $22}'`"
preplaces="`echo "$@"| awk -F"¶¶¶" '{print $23}'`"
pdepends="`echo "$@"| awk -F"¶¶¶" '{print $24}'`"
pdebprovides="`echo "$@"| awk -F"¶¶¶" '{print $25}'`"
pdebconflicts="`echo "$@"| awk -F"¶¶¶" '{print $26}'`"
replaces="`echo "$preplaces¶¶¶" | sed "s:, ¶¶¶::g" | sed "s:¶¶¶::g"`"
depends="`echo "$pdepends¶¶¶" | sed "s:, ¶¶¶::g" | sed "s:¶¶¶::g"`"
debprovides="`echo "$pdebprovides¶¶¶" | sed "s:, ¶¶¶::g" | sed "s:¶¶¶::g"`"
debconflicts="`echo "$pdebconflicts¶¶¶" | sed "s:, ¶¶¶::g" | sed "s:¶¶¶::g"`"
priority="`echo "$@"| awk -F"¶¶¶" '{print $27}'`"
debauto="`echo "$@"| awk -F"¶¶¶" '{print $28}'`"
arch="`echo "$@"| awk -F"¶¶¶" '{print $29}'`"
dist="`echo "$@"| awk -F"¶¶¶" '{print $32}'`"
buildrpm="`echo "$@"| awk -F"¶¶¶" '{print $35}'`"
builddeb="`echo "$@"| awk -F"¶¶¶" '{print $36}'`"
buildtgz="`echo "$@"| awk -F"¶¶¶" '{print $37}'`"
oarch="`echo "$@"| awk -F"¶¶¶" '{print $38}'`"
ifdes="`echo "$@"| awk -F"¶¶¶" '{print $39}'`"
ifpin="`echo "$@"| awk -F"¶¶¶" '{print $40}'`"
ifpon="`echo "$@"| awk -F"¶¶¶" '{print $41}'`"
ifpun="`echo "$@"| awk -F"¶¶¶" '{print $42}'`"
ifpwn="`echo "$@"| awk -F"¶¶¶" '{print $43}'`"
rarch="`echo "$@"| awk -F"¶¶¶" '{print $30}'`"
darch="`echo "$@"| awk -F"¶¶¶" '{print $31}'`"
ptype="`echo "$@"| awk -F"¶¶¶" '{print $44}'`"
psave="`echo "$@"| awk -F"¶¶¶" '{print $45}'`"
SofS="`echo "$@"| awk -F"¶¶¶" '{print $46}'`"
ConCom="`echo "$@"| awk -F"¶¶¶" '{print $47}'`"
MaKePre="`echo "$@"| awk -F"¶¶¶" '{print $48}'`"
MaKePost="`echo "$@"| awk -F"¶¶¶" '{print $49}'`"
#---IF-TRUE---
if [ "$oarch" = "false" ]
	then
if [ "$arch" = 32 ] ; then rpmarch=i686
elif [ "$arch" = 64 ] ; then rpmarch=x86_64
elif [ "$arch" = no ] ; then rpmarch=noarch
fi
if [ "$arch" = 32 ] ; then debarch=i386
elif [ "$arch" = 64 ] ; then debarch=amd64
elif [ "$arch" = no ] ; then debarch=all
fi
	else
rpmarch="$rarch"
debarch="$darch"
fi
if [ "$buildrpm" = "true" ] ; then
	if ! [ $rpmarch ]
		then BERROR="true"
		echo rpmarch
	fi
fi
if [ "$buildtgz" = "true" ] ; then
	if ! [ $rpmarch ]
		then BERROR="true"
		echo tgzarch
	fi
fi
if [ "$builddeb" = "true" ] ; then
	if ! [ $debarch ]
		then BERROR="true"
		echo debarch
	fi
fi
if ! [ "$name" ] ; then BERROR="true" ; echo name ; fi
if ! [ "$summary" ] ; then BERROR="true" ; echo summary ; fi
if ! [ "$ver" ] ; then BERROR="true" ; echo ver ; fi
if ! [ "$release" ] ; then BERROR="true" ; echo release ; fi
if ! [ "$license" ] ; then BERROR="true" ; echo license ; fi
if ! [ "$group" ] ; then BERROR="true" ; echo group ; fi
if ! [ "$maintainer" ] ; then BERROR="true" ; echo maintainer ; fi
if ! [ "$email" ] ; then BERROR="true" ; echo email ; fi
if ! [ "$AID" ] ; then BERROR="true" ; echo AID ; fi
if ! [ "$prebuildroot" ] ; then BERROR="true" ; echo prebuildroot ; fi
if ! [ "$outputdir" ] ; then BERROR="true" ; echo outputdir ; fi
if ! [ "$buildroot" ] ; then BERROR="true" ; echo buildroot ; fi
if [ "$BERROR" = "true" ]
	then echo "$T_pri"
	exit
fi
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Saving---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
if [ "$psave" = "true" ] ; then
mkdir "$svs/$AID"
echo '#! /usr/bin/almohazzem
almohazzemver="'$mo_ver'"
projecttype="'$ptype'"
#vars
SV2="'$summary'"
SV3="'$name'"
SV4="'$ver'"
SV5="'$release'"
SV6="'$license'"
SV7="'$group'"
SV8="'$url'"
SV9="'$vendor'"
SV10="'$prebuildroot'"
SV11="'$outputdir'"
SV12="'$maintainer'"
SV13="'$email'"
SV14="'$spec_gen'"
SV15="'$polds'"
SV16="'$prequires'"
SV17="'$prpmprovides'"
SV18="'$prpmconflicts'"
SV19="'$rpmauto'"
SV20="'$srpm'"
SV21="'$ads'"
SV22="'$control_gen'"
SV23="'$preplaces'"
SV24="'$pdepends'"
SV25="'$pdebprovides'"
SV26="'$pdebconflicts'"
SV27="'$priority'"
SV28="'$debauto'"
SV29="'$arch'"
SV30="'$rarch'"
SV31="'$darch'"
SV32="'$dist'"
SV33="'$buildroot'"
SV34="'$AID'"
SV35="'$buildrpm'"
SV36="'$builddeb'"
SV37="'$buildtgz'"
SV38="'$oarch'"
SV39="'$ifdes'"
SV40="'$ifpin'"
SV41="'$ifpon'"
SV42="'$ifpun'"
SV43="'$ifpwn'"
SV45="'$psave'"
SV46="'$SofS'"
SV47="'$ConCom'"
SV48="'$MaKePre'"
SV49="'$MaKePost'"
' > "$svs/$AID/core"
chmod +x "$svs/$AID/core"
mkdir -p "$svs/$AID/$AID/other"
cp -r "$tmp/other/$AID/"* "$svs/$AID/$AID/other"
cd "$svs/$AID"
tar cvf - . > "$name-$AID".almohazzem
mv "$name-$AID".almohazzem "$outputdir"
fi
#-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Functions---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
if [ "$ifdes" = "false" ] ; then rm "$tmp/other/$AID/description" ; fi
if [ "$ifpin" = "false" ] ; then rm "$tmp/other/$AID/pre-install" ; fi
if [ "$ifpon" = "false" ] ; then rm "$tmp/other/$AID/post-install" ; fi
if [ "$ifpun" = "false" ] ; then rm "$tmp/other/$AID/pre-uninstall" ; fi
if [ "$ifpwn" = "false" ] ; then rm "$tmp/other/$AID/post-uninstall" ; fi
if [ "$(ls -A "$prebuildroot/")" ] ; then
cp -r "$prebuildroot/"* "$buildroot"
fi
#---Spec-generator---
specgen()
{
ifEmpty="`almohazzem --rpmls "$buildroot"`"
preDay=$(date +"%u")
if [ "$preDay" = "1" ] ; then Mday="Mon" ; fi
if [ "$preDay" = "2" ] ; then Mday="Tue" ; fi
if [ "$preDay" = "3" ] ; then Mday="Wed" ; fi
if [ "$preDay" = "4" ] ; then Mday="Thu" ; fi
if [ "$preDay" = "5" ] ; then Mday="Fri" ; fi
if [ "$preDay" = "6" ] ; then Mday="Sat" ; fi
if [ "$preDay" = "7" ] ; then Mday="Sun" ; fi
preMonth=$(date +"%m")
if [ "$preMonth" = "01" ] ; then MMonth="Jan" ; fi
if [ "$preMonth" = "02" ] ; then MMonth="Feb" ; fi
if [ "$preMonth" = "03" ] ; then MMonth="Mar" ; fi
if [ "$preMonth" = "04" ] ; then MMonth="Apr" ; fi
if [ "$preMonth" = "05" ] ; then MMonth="May" ; fi
if [ "$preMonth" = "06" ] ; then MMonth="Jun" ; fi
if [ "$preMonth" = "07" ] ; then MMonth="Jul" ; fi
if [ "$preMonth" = "08" ] ; then MMonth="Aug" ; fi
if [ "$preMonth" = "09" ] ; then MMonth="Sep" ; fi
if [ "$preMonth" = "10" ] ; then MMonth="Oct" ; fi
if [ "$preMonth" = "11" ] ; then MMonth="Nov" ; fi
if [ "$preMonth" = "12" ] ; then MMonth="Dec" ; fi
dateCon=$(date +"%d %Y")
mo_date="$Mday $MMonth $dateCon"
echo "Summary: $summary"
echo "Name: $name"
echo "Version: $ver"
echo "Release: $release`if [ "$dist" = "true" ] ; then echo '%{dist}';fi`"
echo "License: $license"
echo "Group: $group"
echo "BuildArchitectures: $rpmarch"
if [ "$url" ] ; then echo "URL: $url" ; fi
if [ "$rpmprovides" ] ; then echo "Provides: $rpmprovides" ; fi
if [ "$olds" ] ; then echo "Obsoletes: $olds" ; fi
if [ "$rpmconflicts" ] ; then echo "Conflicts: $rpmconflicts" ; fi
if [ "$vendor" ] ; then echo "Vendor: $vendor" ; fi
if [ "$requires" ] ; then echo "Requires: $requires" ; fi
if [ "$rpmauto" = "false" ] ; then echo "AutoReqProv: no" ; fi
echo "Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)"
echo "%description"
if [ -e "$tmp/other/$AID/description" ] ; then cat "$tmp/other/$AID/description" ; fi
echo "
##"
if [ "$ads" = "true" ] ; then echo "packed by Almohazzem $mo_ver (Powerful packaging SDK)" ; fi
echo "
##"
echo "%prep"
echo "
##"
echo "%pre"
if [ -e "$tmp/other/$AID/pre-install" ] ; then cat "$tmp/other/$AID/pre-install" ; fi
echo "
##"
echo "%post"
if [ -e "$tmp/other/$AID/post-install" ] ; then cat "$tmp/other/$AID/post-install" ; fi
echo "
##"
echo "%preun"
if [ -e "$tmp/other/$AID/pre-uninstall" ] ; then cat "$tmp/other/$AID/pre-uninstall" ; fi
echo "
##"
echo "%postun"
if [ -e "$tmp/other/$AID/post-uninstall" ] ; then cat "$tmp/other/$AID/post-uninstall" ; fi
echo "
##"
echo "%files"
if ! [ "$ifEmpty" = '""' ] ; then
almohazzem --rpmls "$buildroot"
fi
echo "%defattr(-,root,root)"
echo "%clean"
echo "cd %{_topdir}/RPMS/$rpmarch"
echo 'mv %{name}-%{version}-%{release}* "'$outputdir'"'
echo "cd %{_topdir}/SRPMS"
#--SRPM-not-supported-in-this-version
echo "rm %{name}-%{version}-%{release}*"
echo "%changelog"
echo "* $mo_date by "$maintainer" <$email>"
echo "- packed by Almohazzem $mo_ver (Powerful packaging SDK)"
}
specgen > "$tmp/$name-$ver-$release.spec"
#---rpm-build---
if [ "$buildrpm" = "true" ] ; then
rpmbuild --buildroot="$buildroot" -ba "$tmp/$name-$ver-$release.spec"
if [ "$spec_gen" = "true" ] ; then cp "$tmp/$name-$ver-$release.spec" "$outputdir/$name-$ver-$release.spec" ; fi
fi
#---Control-generator---
mkdir "$buildroot/DEBIAN"
echo "Copyright: $license" > "$buildroot/DEBIAN/copyright"
size=$(du -ks "$buildroot" | cut -f 1)
debdes()
{
if [ -e "$tmp/other/$AID/description" ] ; then
cat "$tmp/other/$AID/description" | while read line
	do
		if [ "$line" ] 
			then echo " ""$line"
			else echo " ."
		fi
	done
fi
echo " ."
if [ "$ads" = "true" ] ; then echo " packed by Almohazzem $mo_ver (Powerful packaging SDK)" ; fi
}
debfoldergen()
{
echo "Package: $name"
echo "Version: $ver-$release"
echo "Architecture: $debarch"
echo "Maintainer: $maintainer <$email>"
if [ "$url" ] ; then echo "Homepage: $url" ; fi
if [ "$debprovides" ] ; then echo "Provides: $debprovides" ; fi
if [ "$debconflicts" ] ; then echo "Conflicts: $debconflicts" ; fi
if [ "$replaces" ] ; then echo "Replaces: $replaces" ; fi
echo "Section: $group"
echo "Priority: $priority"
echo "Installed-Size: $size"
if [ "$depends" ] ; then echo "Depends: $depends" ; fi
echo "Description: $summary"
debdes
}
debfoldergen > "$buildroot/DEBIAN/control"
#---scripts---
if [ -e "$tmp/other/$AID/pre-install" ] ; then echo "#! /bin/bash" > "$buildroot/DEBIAN/preinst"
					cat "$tmp/other/$AID/pre-install" >> "$buildroot/DEBIAN/preinst"
chmod +x "$buildroot/DEBIAN/preinst" ; fi
if [ -e "$tmp/other/$AID/post-install" ] ; then echo "#! /bin/bash" > "$buildroot/DEBIAN/postinst"
					cat "$tmp/other/$AID/post-install" >> "$buildroot/DEBIAN/postinst"
chmod +x "$buildroot/DEBIAN/postinst" ; fi
if [ -e "$tmp/other/$AID/pre-uninstall" ] ; then echo "#! /bin/bash" > "$buildroot/DEBIAN/prerm"
					cat "$tmp/other/$AID/pre-uninstall" >> "$buildroot/DEBIAN/prerm"
chmod +x "$buildroot/DEBIAN/prerm" ; fi
if [ -e "$tmp/other/$AID/post-uninstall" ] ; then echo "#! /bin/bash" > "$buildroot/DEBIAN/postrm"
					cat "$tmp/other/$AID/post-uninstall" >> "$buildroot/DEBIAN/postrm"
chmod +x "$buildroot/DEBIAN/postrm" ; fi
#---deb-build---
chmod -R 755 "$buildroot/DEBIAN"
debname=""$name"_"$ver"-"$release"_"$debarch""
if [ "$builddeb" = "true" ] ; then
fakeroot dpkg -b "$buildroot" "$outputdir/$debname.deb"
if [ "$control_gen" = "true" ] ; then cp -r "$buildroot/DEBIAN" "$outputdir" ; mv "$outputdir/DEBIAN" "$outputdir/DEBIAN-$AID" ; fi
fi
rm -rf "$buildroot/DEBIAN"
#---tgz-build---
mkdir "$buildroot/install"
if [ -e "$tmp/other/$AID/description" ] ; then cat "$tmp/other/$AID/description" > "$buildroot/install/slack-desc" ; fi
if [ -e "$tmp/other/$AID/pre-install" ] ; then echo "#! /bin/bash" > "$buildroot/install/predoinst.sh"
					cat "$tmp/other/$AID/pre-install" >> "$buildroot/install/predoinst.sh" 
chmod +x "$buildroot/install/predoinst.sh" ; fi
if [ -e "$tmp/other/$AID/post-install" ] ; then echo "#! /bin/bash" > "$buildroot/install/doinst.sh"
					cat "$tmp/other/$AID/post-install" >> "$buildroot/install/doinst.sh"
chmod +x "$buildroot/install/doinst.sh" ; fi
if [ -e "$tmp/other/$AID/pre-uninstall" ] ; then echo "#! /bin/bash" > "$buildroot/install/predelete.sh"
					cat "$tmp/other/$AID/pre-uninstall" >> "$buildroot/install/predelete.sh"
chmod +x "$buildroot/install/predelete.sh" ; fi
if [ -e "$tmp/other/$AID/post-uninstall" ] ; then echo "#! /bin/bash" > "$buildroot/install/delete.sh"
					cat "$tmp/other/$AID/post-uninstall" >> "$buildroot/install/delete.sh"
chmod +x "$buildroot/install/delete.sh" ; fi
if ! [ "$rpmarch" ] ; then 
tGzarch="noarch"
else
tGzarch="$rpmarch"
fi
if [ "$buildtgz" = "true" ] ; then
cd "$runs"/"$AID"
tar cvf - . | gzip -9c > "$outputdir/$name-$ver-$tGzarch-$release.tgz"
fi
rm -rf "$buildroot/install"
}
if [ $mo_1 = --core ]
	then
		CORE "$mo_arg"
		exit
fi
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#******************************---END---OF---CORE---******************************
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Situations-Dialogs---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
echo '<window title="'$T_error'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<vbox>
			<text use-markup="true">
				<label>"<span><b>'"$T_OIE"'</b></span>"</label>
			</text>
	<hbox>
		<button>
			<input file stock="gtk-ok"></input>
			<label>'"$T_ok"'</label>
			<action>exit:Quit</action>
		</button>
	</hbox>
	<variable>error_OIE</variable>
	</vbox>
</window>' > "$tmp"/error_OIE
echo '<window title="'$T_error'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<vbox>
			<text use-markup="true">
				<label>"<span><b>'"$T_error_doc"'</b></span>"</label>
			</text>
	<hbox>
		<button>
			<input file stock="gtk-ok"></input>
			<label>'"$T_ok"'</label>
			<action>exit:Quit</action>
		</button>
	</hbox>
	<variable>error_doc</variable>
	</vbox>
</window>' > "$tmp"/error_doc
echo '<window title="'$T_error'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<vbox>
			<text use-markup="true">
				<label>"<span><b>'"$T_error_icon"'</b></span>"</label>
			</text>
	<hbox>
		<button>
			<input file stock="gtk-ok"></input>
			<label>'"$T_ok"'</label>
			<action>exit:Quit</action>
		</button>
	</hbox>
	<variable>error_icon</variable>
	</vbox>
</window>' > "$tmp"/error_icon
echo '<window title="'$T_error'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<vbox>
			<text use-markup="true">
				<label>"<span><b>'"$T_error_open"'</b></span>"</label>
			</text>
	<hbox>
		<button>
			<input file stock="gtk-ok"></input>
			<label>'"$T_ok"'</label>
			<action>exit:Quit</action>
		</button>
	</hbox>
	<variable>error_icon</variable>
	</vbox>
</window>' > "$tmp"/error_open
echo '<window title="'$Ttitle'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<vbox>
			<text use-markup="true">
				<label>"<span><b>'"$T_old"'</b></span>"</label>
			</text>
	<hbox>
		<button>
			<input file stock="gtk-ok"></input>
			<label>'"$T_ok"'</label>
			<action>exit:Quit</action>
		</button>
	</hbox>
	<variable>error_icon</variable>
	</vbox>
</window>' > "$tmp"/old
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---OPERATIONS---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
OpErAtIoN()
{
ifinstall="`echo "$@"| awk -F"¶¶¶" '{print $2}'`"
ifconvert="`echo "$@"| awk -F"¶¶¶" '{print $3}'`"
ifsextract="`echo "$@"| awk -F"¶¶¶" '{print $4}'`"
ifextract="`echo "$@"| awk -F"¶¶¶" '{print $5}'`"
ifnormal="`echo "$@"| awk -F"¶¶¶" '{print $6}'`"
ifforce="`echo "$@"| awk -F"¶¶¶" '{print $7}'`"
converttype="`echo "$@"| awk -F"¶¶¶" '{print $8}'`"
sourcepackage="`echo "$@"| awk -F"¶¶¶" '{print $9}'`"
targetDIR="`echo "$@"| awk -F"¶¶¶" '{print $10}'`"
Ptyp="`echo "$sourcepackage" | tail -c 4`"
Pnme="`basename "$sourcepackage"`"
if ! [ "$Ptyp" = "rpm" ] ; then
if ! [ "$Ptyp" = "deb" ] ; then echo "Only RPM and DEB supported in this version"
exit ; fi ; fi
if [ "$ifinstall" = "true" ] ; then
if [ "$ifnormal" = "true" ] ; then almasa-root almohazzem --install direct "$sourcepackage"
elif [ "$ifforce" = "true" ] ; then almasa-root almohazzem --install force "$sourcepackage" OK
fi ; fi
if [ "$ifconvert" = "true" ] ; then almohazzem --convert $converttype "$sourcepackage" "$targetDIR" ; fi
if [ "$ifextract" = "true" ] ; then
if [ "$Ptyp" = rpm ] ; then
cp "$sourcepackage" "$targetDIR"
cd "$targetDIR"
rpm2cpio "$Pnme" | cpio -idm
rm "$Pnme"
elif [ "$Ptyp" = deb ] ; then
dpkg -x "$sourcepackage" "$targetDIR"
for stat in debian DEBIAN Debian
do
rm -rf "$targetDIR/$stat"
done
fi ; fi
}
if [ $mo_1 = --operation ]
	then
		OpErAtIoN "$mo_arg" > "$tmp"/operation-log
		exit
fi
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---PROJECTING---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
archls()
{
for AAA in "$N_32" "$N_64" "$N_noarch"
	do
		echo '		<item>'"$AAA"'</item>'
	done
}
export projectX='<window title="'$T_projectx'AlmohazzemID" image-name="'$mo_icon'" window_position="1">
<AlmohaZZeM-NoteBok>
'"$(cat "$tmp/dialogsource1")"'
		<vbox><frame>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_name"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV3</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV3" ] ; then echo "<default>$SV3</default>" ; fi ; fi`"'</entry>
			</hbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_summary"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV2</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV2" ] ; then echo "<default>$SV2</default>" ; fi ; fi`"'</entry>
			</hbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_ver"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV4</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV4" ] ; then echo "<default>$SV4</default>" ; fi ; fi`"'</entry>
			</hbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_release"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV5</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV5" ] ; then echo "<default>$SV5</default>" ; fi ; fi`"'</entry>
			</hbox>
			<hbox homogeneous="true" space-expand="true" space-fill="true">
				<text use-markup="true">
					<label>"<span><b>'"$N_arch"'</b></span>"</label>
				</text>
				<comboboxtext>
				<variable>preAlmohazzemIDV29</variable>
	'"$(archls)"'
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV29" ] ; then if [ "$SV29" = "32" ] ; then echo "<default>$N_32</default>" ; elif [ "$SV29" = "64" ] ; then echo "<default>$N_64</default>" ; elif [ "$SV29" = "no" ] ; then echo "<default>$N_noarch</default>" ; fi ;fi ; else echo "<default>$N_noarch</default>" ; fi`"'
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV38" = "true" ] ; then echo "<sensitive>false</sensitive>" ; elif [ "$SV38" = "false" ] ; then echo "<sensitive>true</sensitive>"; fi ; else echo "<sensitive>true</sensitive>" ; fi`"'
				</comboboxtext>
				<checkbox>
					<label>'"$N_otherarch"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV38" ] ; then echo "<default>$SV38</default>" ; fi ; else echo "<default>false</default>"; fi`"'
					<action>if true enable:AlmohazzemIDV30</action>
					<action>if false disable:AlmohazzemIDV30</action>
					<action>if true enable:AlmohazzemIDV31</action>
					<action>if false disable:AlmohazzemIDV31</action>
					<action>if true disable:preAlmohazzemIDV29</action>
					<action>if false enable:preAlmohazzemIDV29</action>
					<variable>AlmohazzemIDV38</variable>
				</checkbox>
			</hbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_license"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV6</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV6" ] ; then echo "<default>$SV6</default>" ; fi ; fi`"'</entry>
			</hbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_group"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV7</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV7" ] ; then echo "<default>$SV7</default>" ; fi ; fi`"'</entry>
			</hbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_maintainer"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV12</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV12" ] ; then echo "<default>$SV12</default>" ; fi ; fi`"'</entry>
			</hbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_email"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV13</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV13" ] ; then echo "<default>$SV13</default>" ; fi ; fi`"'</entry>
			</hbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_buildroot"'</b></span>"</label>
				</text>
				<entry fs-title="'$N_buildroot'" fs-action="folder">
					<variable>AlmohazzemIDV10</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV10" ] ; then echo "<default>$SV10</default>" ; fi ; fi`"'
'"$(cat "$tmp/dialogsource2")"'
					<input file stock="gtk-open"></input>
					<action>fileselect:AlmohazzemIDV10</action>
				</button>
			</hbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_outputdir"'</b></span>"</label>
				</text>
				<entry fs-title="'$N_outputdir'" fs-action="folder">
					<variable>AlmohazzemIDV11</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV11" ] ; then echo "<default>$SV11</default>" ; fi ; fi`"'</entry>
				<button>
					<input file stock="gtk-open"></input>
					<action>fileselect:AlmohazzemIDV11</action>
				</button>
			</hbox>
		</frame></vbox>
		<vbox><frame>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_url"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV8</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV8" ] ; then echo "<default>$SV8</default>" ; fi ; fi`"'</entry>
			</hbox>
				<checkbox>
					<variable>AlmohazzemIDV21</variable>
					<label>'"$N_ADS"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV21" ] ; then echo "<default>$SV21</default>" ; fi ; else echo "<default>true</default>" ; fi`"'
				</checkbox>
<hbox space-expand="true" space-fill="true" ><notebook  space-fill="true" tab-labels="'$NN_des'|'$NN_preins'|'$NN_postins'|'$NN_preremov'|'$NN_postremov'">
			<vbox>
				<checkbox>
					<variable>AlmohazzemIDV39</variable>
					<label>'"$N_des"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV39" ] ; then echo "<default>$SV39</default>" ; fi ; else echo "<default>true</default>"; fi`"'
					<action>if true enable:AlmohazzemIDdes</action>
					<action>if false disable:AlmohazzemIDdes</action>
				</checkbox>
				<edit><output file>"'$tmp'/other/AlmohazzemID/description"</output>
				<variable>AlmohazzemIDdes</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV39" = "true" ] ; then echo "<sensitive>true</sensitive>" ; elif [ "$SV39" = "false" ] ; then echo "<sensitive>false</sensitive>"; fi ; else echo "<sensitive>true</sensitive>" ; fi`"'
'"`if [ "$Openmode" = "true" ] ; then echo "<input file>"$tmp/other/AlmohazzemID/description"</input>" ; fi`"'</edit>
			</vbox>
			<vbox>
				<checkbox>
					<variable>AlmohazzemIDV40</variable>
					<label>'"$N_preins"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV40" ] ; then echo "<default>$SV40</default>" ; fi ; else echo "<default>false</default>"; fi`"'
					<action>if true enable:AlmohazzemIDpin</action>
					<action>if false disable:AlmohazzemIDpin</action>
				</checkbox>
				<edit><output file>"'$tmp'/other/AlmohazzemID/pre-install"</output>
				<variable>AlmohazzemIDpin</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV40" = "true" ] ; then echo "<sensitive>true</sensitive>" ; elif [ "$SV40" = "false" ] ; then echo "<sensitive>false</sensitive>"; fi ; else echo "<sensitive>false</sensitive>" ; fi`"'
'"`if [ "$Openmode" = "true" ] ; then echo "<input file>"$tmp/other/AlmohazzemID/pre-install"</input>" ; fi`"'</edit>
			</vbox>
			<vbox>
				<checkbox>
					<variable>AlmohazzemIDV41</variable>
					<label>'"$N_postins"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV41" ] ; then echo "<default>$SV41</default>" ; fi ; else echo "<default>false</default>"; fi`"'
					<action>if true enable:AlmohazzemIDpon</action>
					<action>if false disable:AlmohazzemIDpon</action>
				</checkbox>
				<edit><output file>"'$tmp'/other/AlmohazzemID/post-install"</output>
				<variable>AlmohazzemIDpon</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV41" = "true" ] ; then echo "<sensitive>true</sensitive>" ; elif [ "$SV41" = "false" ] ; then echo "<sensitive>false</sensitive>"; fi ; else echo "<sensitive>false</sensitive>" ; fi`"'
'"`if [ "$Openmode" = "true" ] ; then echo "<input file>"$tmp/other/AlmohazzemID/post-install"</input>" ; fi`"'</edit>
			</vbox>
			<vbox>
				<checkbox>
					<variable>AlmohazzemIDV42</variable>
					<label>'"$N_preremov"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV42" ] ; then echo "<default>$SV42</default>" ; fi ; else echo "<default>false</default>"; fi`"'
					<action>if true enable:AlmohazzemIDpun</action>
					<action>if false disable:AlmohazzemIDpun</action>
				</checkbox>
				<edit><output file>"'$tmp'/other/AlmohazzemID/pre-uninstall"</output>
				<variable>AlmohazzemIDpun</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV42" = "true" ] ; then echo "<sensitive>true</sensitive>" ; elif [ "$SV42" = "false" ] ; then echo "<sensitive>false</sensitive>"; fi ; else echo "<sensitive>false</sensitive>" ; fi`"'
'"`if [ "$Openmode" = "true" ] ; then echo "<input file>"$tmp/other/AlmohazzemID/pre-uninstall"</input>" ; fi`"'</edit>
			</vbox>
			<vbox>
				<checkbox>
					<variable>AlmohazzemIDV43</variable>
					<label>'"$N_postremov"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV43" ] ; then echo "<default>$SV43</default>" ; fi ; else echo "<default>false</default>"; fi`"'
					<action>if true enable:AlmohazzemIDpwn</action>
					<action>if false disable:AlmohazzemIDpwn</action>
				</checkbox>
				<edit><output file>"'$tmp'/other/AlmohazzemID/post-uninstall"</output>
				<variable>AlmohazzemIDpwn</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV43" = "true" ] ; then echo "<sensitive>true</sensitive>" ; elif [ "$SV43" = "false" ] ; then echo "<sensitive>false</sensitive>"; fi ; else echo "<sensitive>false</sensitive>" ; fi`"'
'"`if [ "$Openmode" = "true" ] ; then echo "<input file>"$tmp/other/AlmohazzemID/post-uninstall"</input>" ; fi`"'</edit>
			</vbox>
		</notebook></hbox>
		</frame></vbox>
		<vbox><frame>
				<checkbox>
					<variable>AlmohazzemIDV35</variable>
					<label>'"$NN_rpm"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV35" ] ; then echo "<default>$SV35</default>" ; fi ; else echo "<default>true</default>"; fi`"'
					<action>if true enable:AlmohazzemIDV14</action>
					<action>if false disable:AlmohazzemIDV14</action>
				</checkbox>
				<checkbox>
					<variable>AlmohazzemIDV14</variable>
					<label>'"$N_spec"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV14" ] ; then echo "<default>$SV14</default>" ; fi ; else echo "<default>false</default>"; fi`"'
				</checkbox>
				<checkbox>
					<variable>AlmohazzemIDV32</variable>
					<label>'"$N_releaseDname"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV32" ] ; then echo "<default>$SV32</default>" ; fi ; else echo "<default>false</default>"; fi`"'
				</checkbox>
				<checkbox>
					<variable>AlmohazzemIDV19</variable>
					<label>'"$N_autoR"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV19" ] ; then echo "<default>$SV19</default>" ; fi ; else echo "<default>true</default>"; fi`"'
				</checkbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_vendor"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV9</variable>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV9" ] ; then echo "<default>$SV9</default>" ; fi ; fi`"'</entry>
			</hbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_arch"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV30</variable>
				<sensitive>false</sensitive>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV30" ] ; then echo "<default>$SV30</default>" ; fi ; fi`"'</entry>
			</hbox>
				<checkbox>
					<label>"'$NMAN'"</label>
					<default>false</default>
					<action>if true enable:AlmohazzemIDV15</action>
					<action>if false disable:AlmohazzemIDV15</action>
					<action>if true enable:AlmohazzemIDV17</action>
					<action>if false disable:AlmohazzemIDV17</action>
					<action>if true enable:AlmohazzemIDV16</action>
					<action>if false disable:AlmohazzemIDV16</action>
					<action>if true enable:AlmohazzemIDV18</action>
					<action>if false disable:AlmohazzemIDV18</action>
				</checkbox>
				<text><label>"'$N_requires'"</label></text>
			<hbox>
				<entry><variable>nreq</variable></entry>
				<button>
					<label>'$NADD'</label>
		<action>if [ "$nreq" ] ; then echo "$AlmohazzemIDV16""$nreq, " > '"$tmp"'/AlmohazzemIDreq ; fi</action>
					<action>refresh:AlmohazzemIDV16</action>
				</button>
				<button>
					<label>'$NCLEAR'</label>
					<action>echo > '"$tmp"'/AlmohazzemIDreq</action>
					<action>refresh:AlmohazzemIDV16</action>
				</button>
				<entry><variable>AlmohazzemIDV16</variable>
				<sensitive>false</sensitive>
				<input>if [ -e "'$tmp'/AlmohazzemIDreq" ] ; then cat "'$tmp'/AlmohazzemIDreq" ; fi</input>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV16" ] ; then echo "<default>$SV16</default>" ; fi ; fi`"'</entry>
			</hbox>
				<text><label>"'$N_olds'"</label></text>
			<hbox>
				<entry><variable>nold</variable></entry>
				<button>
					<label>'$NADD'</label>
		<action>if [ "$nold" ] ; then echo "$AlmohazzemIDV15""$nold, " > '"$tmp"'/AlmohazzemIDold ; fi</action>
					<action>refresh:AlmohazzemIDV15</action>
				</button>
				<button>
					<label>'$NCLEAR'</label>
					<action>echo > '"$tmp"'/AlmohazzemIDold</action>
					<action>refresh:AlmohazzemIDV15</action>
				</button>
				<entry><variable>AlmohazzemIDV15</variable>
				<sensitive>false</sensitive>
				<input>if [ -e "'$tmp'/AlmohazzemIDold" ] ; then cat "'$tmp'/AlmohazzemIDold" ; fi</input>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV15" ] ; then echo "<default>$SV15</default>" ; fi ; fi`"'</entry>
			</hbox>
				<text><label>"'$N_provides'"</label></text>
			<hbox>
				<entry><variable>npro</variable></entry>
				<button>
					<label>'$NADD'</label>
		<action>if [ "$npro" ] ; then echo "$AlmohazzemIDV17""$npro, " > '"$tmp"'/AlmohazzemIDrpr ; fi</action>
					<action>refresh:AlmohazzemIDV17</action>
				</button>
				<button>
					<label>'$NCLEAR'</label>
					<action>echo > '"$tmp"'/AlmohazzemIDrpr</action>
					<action>refresh:AlmohazzemIDV17</action>
				</button>
				<entry><variable>AlmohazzemIDV17</variable>
				<sensitive>false</sensitive>
				<input>if [ -e "'$tmp'/AlmohazzemIDrpr" ] ; then cat "'$tmp'/AlmohazzemIDrpr" ; fi</input>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV17" ] ; then echo "<default>$SV17</default>" ; fi ; fi`"'</entry>
			</hbox>
				<text><label>"'$N_conflicts'"</label></text>
			<hbox>
				<entry><variable>ncon</variable></entry>
				<button>
					<label>'$NADD'</label>
		<action>if [ "$ncon" ] ; then echo "$AlmohazzemIDV18""$ncon, " > '"$tmp"'/AlmohazzemIDrco ; fi</action>
					<action>refresh:AlmohazzemIDV18</action>
				</button>
				<button>
					<label>'$NCLEAR'</label>
					<action>echo > '"$tmp"'/AlmohazzemIDrco</action>
					<action>refresh:AlmohazzemIDV18</action>
				</button>
				<entry><variable>AlmohazzemIDV18</variable>
				<sensitive>false</sensitive>
				<input>if [ -e "'$tmp'/AlmohazzemIDrco" ] ; then cat "'$tmp'/AlmohazzemIDrco" ; fi</input>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV18" ] ; then echo "<default>$SV18</default>" ; fi ; fi`"'</entry>
			</hbox>
		</frame></vbox>
		<vbox><frame>
				<checkbox>
					<variable>AlmohazzemIDV36</variable>
					<label>'"$NN_deb"'</label>
					<action>if true enable:AlmohazzemIDV22</action>
					<action>if false disable:AlmohazzemIDV22</action>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV36" ] ; then echo "<default>$SV36</default>" ; fi ; else echo "<default>true</default>"; fi`"'
				</checkbox>
				<checkbox>
					<variable>AlmohazzemIDV22</variable>
					<label>'"$N_DEBIAN"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV22" ] ; then echo "<default>$SV22</default>" ; fi ; else echo "<default>false</default>"; fi`"'
				</checkbox>
			<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$N_arch"'</b></span>"</label>
				</text>
				<entry><variable>AlmohazzemIDV31</variable>
				<sensitive>false</sensitive>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV31" ] ; then echo "<default>$SV31</default>" ; fi ; fi`"'</entry>
				<text use-markup="true">
					<label>"<span><b>'"$N_priority"'</b></span>"</label>
				</text>
				<comboboxtext>
				<variable>preAlmohazzemIDV27</variable>
					<item>"'$P_required'"</item>
					<item>"'$P_important'"</item>
					<item>"'$P_standard'"</item>
					<item>"'$P_optional'"</item>
					<item>"'$P_extra'"</item>
'"`if [ "$Openmode" = "true" ] ; then
	if [ "$SV27" = "required" ] ; then echo "<default>$P_required</default>"
	elif [ "$SV27" = "important" ] ; then echo "<default>$P_important</default>"
	elif [ "$SV27" = "standard" ] ; then echo "<default>$P_standard</default>"
	elif [ "$SV27" = "optional" ] ; then echo "<default>$P_optional</default>"
	elif [ "$SV27" = "extra" ] ; then echo "<default>$P_extra</default>"
	fi
	else echo "<default>$P_standard</default>"
fi`"'
<action>if [ "$preAlmohazzemIDV27" = "'$P_required'" ]; then echo required ; elif [ "$preAlmohazzemIDV27" = "'$P_important'" ]; then echo important ; elif [ "$preAlmohazzemIDV27" = "'$P_standard'" ]; then echo standard ; elif [ "$preAlmohazzemIDV27" = "'$P_optional'" ]; then echo optional; elif [ "$preAlmohazzemIDV27" = "'$P_extra'" ]; then echo extra ; fi > "'$tmp'/AlmohazzemIDV27"</action>
				</comboboxtext>
			</hbox>
				<checkbox>
					<label>"'$NMAN'"</label>
					<default>false</default>
					<action>if true enable:AlmohazzemIDV23</action>
					<action>if false disable:AlmohazzemIDV23</action>
					<action>if true enable:AlmohazzemIDV24</action>
					<action>if false disable:AlmohazzemIDV24</action>
					<action>if true enable:AlmohazzemIDV25</action>
					<action>if false disable:AlmohazzemIDV25</action>
					<action>if true enable:AlmohazzemIDV26</action>
					<action>if false disable:AlmohazzemIDV26</action>
				</checkbox>
				<text><label>"'$N_requires'"</label></text>
			<hbox>
				<entry><variable>dnreq</variable></entry>
				<button>
					<label>'$NADD'</label>
		<action>if [ "$dnreq" ] ; then echo "$AlmohazzemIDV24""$dnreq, " > '"$tmp"'/AlmohazzemIDdreq ; fi</action>
					<action>refresh:AlmohazzemIDV24</action>
				</button>
				<button>
					<label>'$NCLEAR'</label>
					<action>echo > '"$tmp"'/AlmohazzemIDdreq</action>
					<action>refresh:AlmohazzemIDV24</action>
				</button>
				<entry><variable>AlmohazzemIDV24</variable>
				<sensitive>false</sensitive>
				<input>if [ -e "'$tmp'/AlmohazzemIDdreq" ] ; then cat "'$tmp'/AlmohazzemIDdreq" ; fi</input>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV24" ] ; then echo "<default>$SV24</default>" ; fi ; fi`"'</entry>
			</hbox>
				<text><label>"'$N_olds'"</label></text>
			<hbox>
				<entry><variable>dnold</variable></entry>
				<button>
					<label>'$NADD'</label>
		<action>if [ "$dnold" ] ; then echo "$AlmohazzemIDV23""$dnold, " > '"$tmp"'/AlmohazzemIDdold ; fi</action>
					<action>refresh:AlmohazzemIDV23</action>
				</button>
				<button>
					<label>'$NCLEAR'</label>
					<action>echo > '"$tmp"'/AlmohazzemIDdold</action>
					<action>refresh:AlmohazzemIDV23</action>
				</button>
				<entry><variable>AlmohazzemIDV23</variable>
				<sensitive>false</sensitive>
				<input>if [ -e "'$tmp'/AlmohazzemIDdold" ] ; then cat "'$tmp'/AlmohazzemIDdold" ; fi</input>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV23" ] ; then echo "<default>$SV23</default>" ; fi ; fi`"'</entry>
			</hbox>
				<text><label>"'$N_provides'"</label></text>
			<hbox>
				<entry><variable>dnpro</variable></entry>
				<button>
					<label>'$NADD'</label>
		<action>if [ "$dnpro" ] ; then echo "$AlmohazzemIDV25""$dnpro, " > '"$tmp"'/AlmohazzemIDdrpr ; fi</action>
					<action>refresh:AlmohazzemIDV25</action>
				</button>
				<button>
					<label>'$NCLEAR'</label>
					<action>echo > '"$tmp"'/AlmohazzemIDdrpr</action>
					<action>refresh:AlmohazzemIDV25</action>
				</button>
				<entry><variable>AlmohazzemIDV25</variable>
				<sensitive>false</sensitive>
				<input>if [ -e "'$tmp'/AlmohazzemIDdrpr" ] ; then cat "'$tmp'/AlmohazzemIDdrpr" ; fi</input>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV25" ] ; then echo "<default>$SV25</default>" ; fi ; fi`"'</entry>
			</hbox>
				<text><label>"'$N_conflicts'"</label></text>
			<hbox>
				<entry><variable>dncon</variable></entry>
				<button>
					<label>'$NADD'</label>
		<action>if [ "$dncon" ] ; then echo "$AlmohazzemIDV26""$dncon, " > '"$tmp"'/AlmohazzemIDdrco ; fi</action>
					<action>refresh:AlmohazzemIDV26</action>
				</button>
				<button>
					<label>'$NCLEAR'</label>
					<action>echo > '"$tmp"'/AlmohazzemIDdrco</action>
					<action>refresh:AlmohazzemIDV26</action>
				</button>
				<entry><variable>AlmohazzemIDV26</variable>
				<sensitive>false</sensitive>
				<input>if [ -e "'$tmp'/AlmohazzemIDdrco" ] ; then cat "'$tmp'/AlmohazzemIDdrco" ; fi</input>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV26" ] ; then echo "<default>$SV26</default>" ; fi ; fi`"'</entry>
			</hbox>
		</frame></vbox>
		<vbox><frame>
				<checkbox>
					<variable>AlmohazzemIDV37</variable>
					<label>'"$NN_tgz"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV37" ] ; then echo "<default>$SV37</default>" ; fi ; else echo "<default>true</default>"; fi`"'
				</checkbox>
				<checkbox>
					<variable>AlmohazzemIDV45</variable>
					<label>'"$NSAVE"'</label>
'"`if [ "$Openmode" = "true" ] ; then if [ "$SV45" ] ; then echo "<default>$SV45</default>" ; fi ; else echo "<default>false</default>"; fi`"'
				</checkbox>
<button><label>"'$START'"</label><variable>StArT2</variable>
'"$(cat "$tmp/dialogsource3")"'
					<action>save:AlmohazzemIDdes</action>
					<action>save:AlmohazzemIDpin</action>
					<action>save:AlmohazzemIDpon</action>
					<action>save:AlmohazzemIDpun</action>
					<action>save:AlmohazzemIDpwn</action>
<action>AlmohazzemIDV34=AlmohazzemID;AlmohazzemIDV33="'$runs'/AlmohazzemID";if ! [ -e "'$tmp'/AlmohazzemIDV27" ] ; then AlmohazzemIDV27=standard ; else AlmohazzemIDV27=$(cat "'$tmp'/AlmohazzemIDV27") ; fi ; if [ "$preAlmohazzemIDV29" = "'$N_32'" ] ; then AlmohazzemIDV29=32 ; elif [ "$preAlmohazzemIDV29" = "'$N_64'" ] ; then AlmohazzemIDV29=64 ; elif [ "$preAlmohazzemIDV29" = "'$N_noarch'" ] ; then AlmohazzemIDV29=no ; fi ; almohazzem --core ¶¶¶$AlmohazzemIDV2¶¶¶$AlmohazzemIDV3¶¶¶$AlmohazzemIDV4¶¶¶$AlmohazzemIDV5¶¶¶$AlmohazzemIDV6¶¶¶$AlmohazzemIDV7¶¶¶$AlmohazzemIDV8¶¶¶$AlmohazzemIDV9¶¶¶$AlmohazzemIDV10¶¶¶$AlmohazzemIDV11¶¶¶$AlmohazzemIDV12¶¶¶$AlmohazzemIDV13¶¶¶$AlmohazzemIDV14¶¶¶$AlmohazzemIDV15¶¶¶$AlmohazzemIDV16¶¶¶$AlmohazzemIDV17¶¶¶$AlmohazzemIDV18¶¶¶$AlmohazzemIDV19¶¶¶$AlmohazzemIDV20¶¶¶$AlmohazzemIDV21¶¶¶$AlmohazzemIDV22¶¶¶$AlmohazzemIDV23¶¶¶$AlmohazzemIDV24¶¶¶$AlmohazzemIDV25¶¶¶$AlmohazzemIDV26¶¶¶$AlmohazzemIDV27¶¶¶$AlmohazzemIDV28¶¶¶$AlmohazzemIDV29¶¶¶$AlmohazzemIDV30¶¶¶$AlmohazzemIDV31¶¶¶$AlmohazzemIDV32¶¶¶$AlmohazzemIDV33¶¶¶$AlmohazzemIDV34¶¶¶$AlmohazzemIDV35¶¶¶$AlmohazzemIDV36¶¶¶$AlmohazzemIDV37¶¶¶$AlmohazzemIDV38¶¶¶$AlmohazzemIDV39¶¶¶$AlmohazzemIDV40¶¶¶$AlmohazzemIDV41¶¶¶$AlmohazzemIDV42¶¶¶$AlmohazzemIDV43¶¶¶'$SSS'¶¶¶$AlmohazzemIDV45¶¶¶$AlmohazzemIDV46¶¶¶$AlmohazzemIDV47¶¶¶$AlmohazzemIDV48¶¶¶$AlmohazzemIDV49 | tee "'$logs'/AlmohazzemID-log"</action>
<action>refresh:LOG</action></button>
		<edit><input file>"'$logs'/AlmohazzemID-log"</input>
		<variable>LOG</variable></edit>
		<button><label>"'$Nsavelog'"</label>
			<action>if [ -e "'$logs'/AlmohazzemID-log" ] ; then cp "'$logs'/AlmohazzemID-log" "$AlmohazzemIDV11" ; fi</action>
		</button>
		</frame></vbox>
	</notebook>
</window>'
echo "#! /bin/bash" > "$tmp"/projectx
echo 'AID=$1' >> "$tmp"/projectx
echo 'Atype=$2' >> "$tmp"/projectx
export noteSource='<notebook tab-labels="'$WSOURce'|'$I_general'|'$I_optional'|'$I_rpm'|'$I_deb'|'$I_end'">'
export noteFolder='<notebook tab-labels="'$I_general'|'$I_optional'|'$I_rpm'|'$I_deb'|'$I_end'">'
export noteX='<AlmohaZZeM-NoteBok>'
echo '
if [ "$Atype" = "folder" ] ; then
echo "$projectX" | sed "s:$noteX:$noteFolder:g" | sed "s:AlmohazzemID:$AID:g" > "'$tmp'"/projectX
elif [ "$Atype" = "source" ] ; then
echo "$projectX" | sed "s:$noteX:$noteSource:g" | sed "s:AlmohazzemID:$AID:g" > "'$tmp'"/projectX
fi
' >> "$tmp"/projectx
echo ''$mo_gtkdialog' --file "'$tmp'/projectX" > /dev/null &' >> "$tmp"/projectx
chmod +x "$tmp"/projectx
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Desktop-Entries-Generator---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
catls()
{
for category in Education X-Islamic-Software X-Quran Utility Settings Game AudioVideo System Graphics Office Network Development
do
echo "<item>$category</item>"
done
}
echo '<window title="'$t_DeSk'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<vbox>
	<notebook tab-labels="'$DD_GENERATR'|'$DD_SAVE'">
<vbox>
<frame>
	<hbox><text><label>"'$D_name'"</label></text><entry><variable>DNAME</variable></entry>
	<text><label>"'$D_comments'"</label></text><entry><variable>DCOMM</variable></entry></hbox>
	<hbox><text><label>"'$D_iCon'"</label></text><entry><variable>DICON</variable></entry>
	<text><label>"'$D_EXe'"</label></text><entry><variable>DEXE</variable></entry></hbox>
			<hbox><text><label>"'$D_catogries'"</label></text>
				<comboboxtext>
				<variable>preDCAT</variable>
				'$(catls)'
				</comboboxtext>
				<button>
					<label>'$NADD'</label>
		<action>if [ "$preDCAT" ] ; then echo "$DCAT""$preDCAT;" > '"$tmp"'/CAT ; fi</action>
					<action>refresh:DCAT</action>
				</button>
				<button>
					<label>'$NCLEAR'</label>
					<action>echo > '"$tmp"'/CAT</action>
					<action>refresh:DCAT</action>
				</button>
				<entry><variable>DCAT</variable>
				<sensitive>false</sensitive>
				<input>if [ -e "'$tmp'/CAT" ] ; then cat "'$tmp'/CAT" ; fi</input></entry>
			</hbox>
				<text><label>"'$D_MIME'"</label></text>
			<hbox>
				<entry><variable>preDMIME</variable></entry>
				<button>
					<label>'$NADD'</label>
		<action>if [ "$preDMIME" ] ; then echo "$DMIME""$preDMIME;" > '"$tmp"'/MIME ; fi</action>
					<action>refresh:DMIME</action>
				</button>
				<button>
					<label>'$NCLEAR'</label>
					<action>echo > '"$tmp"'/MIME</action>
					<action>refresh:DMIME</action>
				</button>
				<entry><variable>DMIME</variable>
				<sensitive>false</sensitive>
				<input>if [ -e "'$tmp'/MIME" ] ; then cat "'$tmp'/MIME" ; fi</input></entry>
			</hbox>
<checkbox><label>"'$D_terminal'"</label><default>false</default><variable>DTERM</variable></checkbox>
<button><input file stock="gtk-find"></input><label>"'$D_Check'"</label>
<action>disable:FR1</action>
<action>enable:FR2</action><action>enable:FR3</action>
<action>echo "[Desktop Entry]" > "'$tmp'/EntrY"</action>
<action>echo "Type=Application" >> "'$tmp'/EntrY"</action>
<action>if [ "$DCAT" ] ; then echo "Categories=$DCAT" >> "'$tmp'/EntrY" ; fi</action>
<action>if [ "$DMIME" ] ; then echo "MimeType=$DMIME" >> "'$tmp'/EntrY" ; fi</action>
<action>if [ "$DEXE" ] ; then echo "Exec=$DEXE" >> "'$tmp'/EntrY" ; fi</action>
<action>if [ "$DICON" ] ; then echo "Icon=$DICON" >> "'$tmp'/EntrY" ; fi</action>
<action>if [ "$DTERM" ] ; then echo "Terminal=$DTERM" >> "'$tmp'/EntrY" ; fi</action>
<action>if [ "$DNAME" ] ; then echo "Name=$DNAME" >> "'$tmp'/EntrY" ; fi</action>
<action>if [ "$DNAME" ] ; then echo "GenericName=$DNAME" >> "'$tmp'/EntrY" ; fi</action>
<action>if [ "$DCOMM" ] ; then echo "Comment=$DCOMM" >> "'$tmp'/EntrY" ; fi</action>
<action>refresh:DED</action>
</button>
<variable>FR1</variable>
</frame>
<frame '$D_Lang'>
	<hbox><text><label>"'$d_langID'"</label></text><entry><variable>LanId</variable></entry></hbox>
	<hbox><text><label>"'$D_name'"</label></text><entry><variable>lDNAME</variable></entry>
	<text><label>"'$D_comments'"</label></text><entry><variable>lDCOMM</variable></entry>
	<button>
	<label>'$NADD'</label>
	<action>if [ "$LanId" ] ; then if [ "$lDNAME" ] ; then echo "Name[$LanId]=$lDNAME" >> "'$tmp'/EntrY" ; fi ; if [ "$lDNAME" ] ; then echo "GenericName[$LanId]=$lDNAME" >> "'$tmp'/EntrY" ; fi ; if [ "$lDCOMM" ] ; then echo "Comment[$LanId]=$lDCOMM" >> "'$tmp'/EntrY" ; fi ; fi</action>
	<action>refresh:DED</action>
	</button>
</hbox>
<edit><input file>"'$tmp'/EntrY"</input><sensitive>false</sensitive>
<variable>DED</variable><output file>"'$tmp'/EntrY"</output></edit>
				<checkbox>
					<label>"'$NMAN'"</label>
					<default>false</default>
					<action>if true enable:DED</action>
					<action>if false disable:DED</action>
				</checkbox>
<sensitive>false</sensitive><variable>FR2</variable>
</frame>
</vbox>
			<vbox><frame>
				<checkbox>
					<label>'"$D_inject"'</label>
					<variable>DINJ</variable>
					<default>true</default>
					<action>if true enable:Dmainruns</action>
					<action>if false disable:Dmainruns</action>
				</checkbox>
				<tree auto-sort="true" sort-column="0">
					<label>'$TOPEND'</label>
					<variable>Dmainruns</variable>
					<input>ls '"$runs"'</input>
				</tree>
				<checkbox>
					<label>'"$T_Dfolder"'</label>
					<variable>Dchiconfolder</variable>
					<default>false</default>
					<action>if true enable:Dtarget</action>
					<action>if false disable:Dtarget</action>
					<action>if true enable:BUTT2</action>
					<action>if false disable:BUTT2</action>
				</checkbox>
				<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$TT_select"'</b></span>"</label>
				</text>
				<entry fs-title="'$TT_select'" fs-action="folder">
					<variable>Dtarget</variable>
					<sensitive>false</sensitive>
				</entry>
				<button>
					<input file stock="gtk-open"></input>
					<action>fileselect:Dtarget</action>
					<sensitive>false</sensitive>
					<variable>BUTT2</variable>
				</button>
				</hbox>
				<hbox><text use-markup="true">
					<label>"<span><b>'"$FNAME"'</b></span>"</label>
				</text><entry><variable>DFn</variable></entry><button><label>"'$START'"</label>
<action>if [ "$DINJ" = "true" ] ; then if [ "$Dmainruns" ] ; then if ! [ -e "'$runs'/$Dmainruns/usr/share/applications" ] ; then mkdir -p "'$runs'/$Dmainruns/usr/share/applications" ; fi ; if [ "$DFn" ] ; then cp "'$tmp/EntrY'" "'$runs'/$Dmainruns/usr/share/applications" ; mv "'$runs'/$Dmainruns/usr/share/applications/EntrY" "'$runs'/$Dmainruns/usr/share/applications/$DFn.desktop" ; chmod +x "'$runs'/$Dmainruns/usr/share/applications/$DFn.desktop" ; fi ; fi ; fi </action>
<action>if [ "$Dchiconfolder" = "true" ] ; then if [ -e "$Dtarget" ] ; then if [ "$DFn" ] ; then cp "'$tmp/EntrY'" "$Dtarget" ; mv "$Dtarget"/EntrY "$Dtarget"/$DFn.desktop ; chmod +x "$Dtarget/$DFn.desktop" ; fi ; fi ; fi</action>
		<action>exit:Quit</action>
</button></hbox>
<sensitive>false</sensitive><variable>FR3</variable>
			</frame></vbox>
</notebook></vbox>
</window>' > "$tmp"/desktop
if [ "$mo_1" = "--gui" ]
	then
	if [ "$mo_2" = "desktop" ]
	then
if [ -e "$tmp"/CAT ] ; then rm "$tmp"/CAT ; fi
if [ -e "$tmp"/EntrY ] ; then rm "$tmp"/EntrY ; fi
if [ -e "$tmp"/MIME ] ; then rm "$tmp"/MIME ; fi
touch "$tmp"/EntrY
"$mo_gtkdialog" --file "$tmp"/desktop > /dev/null &
exit
	fi
fi
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Icons-Generator---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
ICONGEN()
{
inrunTF="`echo "$mo_arg"| awk -F"¶¶¶" '{print $2}'`"
inrunpath="`echo "$mo_arg"| awk -F"¶¶¶" '{print $3}'`"
mimerunTF="`echo "$mo_arg"| awk -F"¶¶¶" '{print $4}'`"
mimerunpath="`echo "$mo_arg"| awk -F"¶¶¶" '{print $5}'`"
folderTF="`echo "$mo_arg"| awk -F"¶¶¶" '{print $6}'`"
folderpath="`echo "$mo_arg"| awk -F"¶¶¶" '{print $7}'`"
iconname="`echo "$mo_arg"| awk -F"¶¶¶" '{print $8}'`"
iconsource="`echo "$mo_arg"| awk -F"¶¶¶" '{print $9}'`"
iconpattern="`echo "$mo_arg"| awk -F"¶¶¶" '{print $10}'`"
if [ "$inrunTF" = "false" ] ; then if [ "$mimerunTF" = "false" ] ; then if [ "$folderTF" = "false" ] ; then exit ; fi ; fi ; fi
if ! [ -e "$iconsource" ] 
	then "$mo_gtkdialog" --file "$tmp"/error_icon > /dev/null & 
	exit
fi
i16="`echo "$iconpattern" | cut -d ' ' -f1`"
i22="`echo "$iconpattern" | cut -d ' ' -f2`"
i24="`echo "$iconpattern" | cut -d ' ' -f3`"
i32="`echo "$iconpattern" | cut -d ' ' -f4`"
i36="`echo "$iconpattern" | cut -d ' ' -f5`"
i48="`echo "$iconpattern" | cut -d ' ' -f6`"
i64="`echo "$iconpattern" | cut -d ' ' -f7`"
i72="`echo "$iconpattern" | cut -d ' ' -f8`"
i96="`echo "$iconpattern" | cut -d ' ' -f9`"
i128="`echo "$iconpattern" | cut -d ' ' -f10`"
i256="`echo "$iconpattern" | cut -d ' ' -f11`"
iOOO="`echo "$iconpattern" | cut -d ' ' -f12`"
if [ "$iOOO" = "true" ] ; then
icoChec1="`echo "$iconpattern" | cut -d ' ' -f13`"
T1=`echo $icoChec1 | cut -d x -f1`
T2=`echo $icoChec1 | cut -d x -f2`
if [ "$icoChec1" ] ; then
if [ "$(echo $icoChec1 | grep x)" ]
	then
		if [ "$T1" = "$T2" ]
			then
				OOO=""$T1"x"$T2""
			else
				"$mo_gtkdialog" --file "$tmp"/error_OIE > /dev/null &
		fi
	else
		"$mo_gtkdialog" --file "$tmp"/error_OIE > /dev/null &
fi
fi
fi
DIMS()
{
if [ "$i16" = "true" ] ; then echo 16x16 ; fi
if [ "$i22" = "true" ] ; then echo 22x22 ; fi
if [ "$i24" = "true" ] ; then echo 24x24 ; fi
if [ "$i32" = "true" ] ; then echo 32x32 ; fi
if [ "$i36" = "true" ] ; then echo 36x36 ; fi
if [ "$i48" = "true" ] ; then echo 48x48 ; fi
if [ "$i64" = "true" ] ; then echo 64x64 ; fi
if [ "$i72" = "true" ] ; then echo 72x72 ; fi
if [ "$i96" = "true" ] ; then echo 96x96 ; fi
if [ "$i128" = "true" ] ; then echo 128x128 ; fi
if [ "$i256" = "true" ] ; then echo 256x256 ; fi
if [ "$iOOO" = "true" ] ; then echo "$OOO" ; fi
}
dims="$(DIMS)"
DH="`identify -format %h "$iconsource"`"
DW="`identify -format %w "$iconsource"`"
if ! [ "$dims" ]
	then "$mo_gtkdialog" --file "$tmp"/error_OIE > /dev/null &
	exit
fi
if ! [ "$DH" = "$DW" ]
	then "$mo_gtkdialog" --file "$tmp"/error_icon > /dev/null & 
	exit 
fi
if [ "$inrunTF" = "true" ] ; then
	if ! [ "$inrunpath" ] ; then exit ; fi 
	for dim in $dims
	do
	if ! [ -e ""$runs"/"$inrunpath"/usr/share/icons/hicolor/$dim/apps" ] ; then
	mkdir -p "$runs"/"$inrunpath"/usr/share/icons/hicolor/$dim/apps ; fi
	convert "$iconsource" -resize $dim "$runs"/"$inrunpath"/usr/share/icons/hicolor/$dim/apps/"$iconname".png
	done
fi
if [ "$mimerunTF" = "true" ] ; then
	if ! [ "$mimerunpath" ] ; then exit ; fi 
	for dim in $dims
	do
	if ! [ -e ""$runs"/"$mimerunpath"/usr/share/icons/hicolor/$dim/mimetypes" ] ; then
	mkdir -p "$runs"/"$mimerunpath"/usr/share/icons/hicolor/$dim/mimetypes ; fi
	convert "$iconsource" -resize $dim "$runs"/"$mimerunpath"/usr/share/icons/hicolor/$dim/mimetypes/"$iconname".png
	done
fi
if [ "$folderTF" = "true" ] ; then
	if ! [ "$folderpath" ] ; then exit ; fi 
	for dim in $dims
	do
	if ! [ -e "$folderpath/icons/hicolor/$dim/apps" ] ; then
	mkdir -p "$folderpath"/icons/hicolor/$dim/apps ; fi
	convert "$iconsource" -resize $dim "$folderpath"/icons/hicolor/$dim/apps/"$iconname".png
	done
fi
}
ICONSIZES()
{
for size in 16x16 22x22 24x24 32x32 36x36 48x48 64x64 72x72 96x96 128x128 256x256 "$othersize"
	do
	var1=`echo $size | cut -d x -f1`
	var2=`echo $size | cut -d x -f2`
	if [ "$(echo $size | grep x)" ]
		then
			if [ "$var1" = "$var2" ]
				then
					var=$var1
					default="true"
					oTh="</checkbox>"
			fi
		else
			var=oth
			default="false"
			oTh="<action>if true enable:SizeOth</action><action>if false disable:SizeOth</action></checkbox><hbox><entry><variable>SizeOth</variable><sensitive>false</sensitive></entry></hbox>"
	fi
	echo "	<checkbox>
			<label>$size</label>
			<variable>S$var</variable>
			<default>$default</default>
		$oTh"
	done
}
echo '<window title="'$t_icon_gen'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<vbox>
		<hbox>
		<text use-markup="true">
			<label>"<span><b>'"$T_imageselect"'</b></span>"</label>
		</text>
		<entry fs-title="'$TTPIC'" fs-action="file" fs-filters-mime="image/*">
			<variable>IMGENTER</variable>
		</entry>
		<button>
			<input file stock="gtk-open"></input>
			<action>fileselect:IMGENTER</action>
		</button>
		</hbox>
		<notebook tab-labels="'$A_welcome'|'$T_options'|'$T_generate'">
			<vbox>
				<text use-markup="true">
					<label>"<span><b>'"$TT_icongen"'</b></span>"</label>
				</text>
			</vbox>
			<vbox>
				<text use-markup="true">
					<label>"<span><b>'"$T_sizes"'</b></span>"</label>
				</text>
	'"$(ICONSIZES)"'
			</vbox>
			<vbox>
				<checkbox>
					<label>'"$T_injection"'</label>
					<variable>maininject</variable>
					<default>false</default>
					<action>if true enable:mainruns</action>
					<action>if false disable:mainruns</action>
				</checkbox>
				<tree auto-sort="true" sort-column="0">
					<label>'$TOPEND'</label>
					<variable>mainruns</variable>
					<input>ls '"$runs"'</input>
					<sensitive>false</sensitive>
				</tree>
				<checkbox>
					<label>'"$T_injection_MIME"'</label>
					<variable>mimeinject</variable>
					<default>false</default>
					<action>if true enable:mimeruns</action>
					<action>if false disable:mimeruns</action>
				</checkbox>
				<tree auto-sort="true" sort-column="0">
					<label>'$TOPEND'</label>
					<variable>mimeruns</variable>
					<input>ls '"$runs"'</input>
					<sensitive>false</sensitive>
				</tree>
				<checkbox>
					<label>'"$T_iconfolder"'</label>
					<variable>chiconfolder</variable>
					<default>false</default>
					<action>if true enable:icontarget</action>
					<action>if false disable:icontarget</action>
					<action>if true enable:BUTT1</action>
					<action>if false disable:BUTT1</action>
				</checkbox>
				<hbox>
				<text use-markup="true">
					<label>"<span><b>'"$TT_select"'</b></span>"</label>
				</text>
				<entry fs-title="'$TT_select'" fs-action="folder">
					<variable>icontarget</variable>
					<sensitive>false</sensitive>
				</entry>
				<button>
					<input file stock="gtk-open"></input>
					<action>fileselect:icontarget</action>
					<sensitive>false</sensitive>
					<variable>BUTT1</variable>
				</button>
				</hbox>
			</vbox>
		</notebook>
		<hbox>
			<text use-markup="true">
			<label>"<span><b>'"$T_iconname"'</b></span>"</label>
		</text>
		<entry><variable>ICONID</variable>
		</entry>
		</hbox>
		<hbox>
			<button>
				<input file stock="gtk-ok"></input>
				<label>'"$T_ok"'</label>
		<action>if ! [ "$ICONID" ] ; then ICONID=$(basename "$IMGENTER" | cut -d '.' -f1) ; fi ; almohazzem --gui icon ¶¶¶$maininject¶¶¶$mainruns¶¶¶$mimeinject¶¶¶$mimeruns¶¶¶$chiconfolder¶¶¶$icontarget¶¶¶$ICONID¶¶¶$IMGENTER¶¶¶$S16 $S22 $S24 $S32 $S36 $S48 $S64 $S72 $S96 $S128 $S256 $Soth $SizeOth</action>
				<action>exit:Quit</action>
			</button>
			<button>
				<input file stock="gtk-cancel"></input>
				<label>'"$T_cancel"'</label>
				<action>exit:Quit</action>
			</button>
		</hbox>
	</vbox>
</window>' > "$tmp"/icongen
if [ "$mo_1" = "--gui" ]
	then
	if [ "$mo_2" = "icon" ]
		then
		if ! [ "$mo_3" ] ; then
		"$mo_gtkdialog" --file "$tmp/icongen" > /dev/null &
		exit
		fi
		ICONGEN "$mo_arg"
		exit
	fi
fi
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Internal-Objects---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
echo '<window title="'$Ttitle' - '$M_setting'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<vbox>
			<button>
				<label>'"$LanGseLection"'</label>
				<action>almohazzem --language</action>
			</button>
			<button>
				<label>'"$CleaRcaChe"'</label>
				<action>rm -rf "'$cache'"</action>
			</button>
			<button>
				<label>'"$ClearLOGS"'</label>
				<action>rm -rf "'$logs'"</action>
			</button>
			<frame '$SuperComm'>

			<radiobutton active="true">
				<label>"su -c"</label>
				<variable>rdsu</variable>
			</radiobutton>
			<radiobutton>
				<label>"sudo"</label>
				<variable>rdsudo</variable>
			</radiobutton>
			</frame>
			<button>
				<input file stock="gtk-ok"></input>
				<label>'"$T_ok"'</label>
				<action>if [ "$rdsu" = "true" ] ; then almohazzem --sudo disable ; fi</action>
				<action>if [ "$rdsudo" = "true" ] ; then almohazzem --sudo enable ; fi</action>
				<action>exit:Quit</action>
			</button>
			<button>
				<input file stock="gtk-cancel"></input>
				<label>'"$T_cancel"'</label>
				<action>exit:Quit</action>
			</button>
	</vbox>
</window>' > "$tmp"/OPtiOnS
echo '<window title="'$Ttitle'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<vbox>
		<hbox>
		<text use-markup="true">
			<label>"<span><b>'"$T_SeFi"'</b></span>"</label>
		</text>
		<entry fs-title="'$T_SeFi'" fs-action="file" fs-filters="*.almohazzem">
			<variable>toOpen</variable>
		</entry>
		<button>
			<input file stock="gtk-open"></input>
			<action>fileselect:toOpen</action>
		</button>
			<button>
				<input file stock="gtk-ok"></input>
				<label>'"$T_ok"'</label>
	<action>if [ "$toOpen" ] ; then almohazzem $toOpen ; fi</action>
				<action>exit:Quit</action>
			</button>
		</hbox>
	</vbox>
</window>' > "$tmp"/OpeN
echo '<window title="'$Ttitle - $M_Uninstaller'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<vbox>
		<text use-markup="true">
			<label>"<span><b>'"$T_Uninstaller"'</b></span>"</label>
		</text>
		<tree auto-sort="true" sort-column="0">
			<label>'$TUniNsTallS'</label>
			<variable>UniNsTallS</variable>
			<input>ls '"$uns"'</input>
		</tree>
		<hbox>
		<button>
			<input file stock="gtk-delete"></input>
			<label>'"$TTunins"'</label>
			<action>if [ "$UniNsTallS" ] ; then almasa-root " "'$uns'/$UniNsTallS" ; rm "'$uns'/$UniNsTallS" " ; fi</action>
			<action>exit:Quit</action>
		</button>
		<button>
			<input file stock="gtk-cancel"></input>
			<label>'"$T_cancel"'</label>
			<action>exit:Quit</action>
		</button>
		</hbox>
	</vbox><sensitive>false</sensitive>
</window>' > "$tmp"/Uninstaller
echo '<window title="'$Ttitle'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<vbox>
		<text use-markup="true">
			<label>"<span><b>'"$Tnote"'</b></span>"</label>
		</text>
		<hbox>
		<text use-markup="true">
			<label>"<span><b>'"$T_SeFi"'</b></span>"</label>
		</text>
		<entry fs-title="'$T_SeFi'" fs-action="file" fs-filters="*.rpm|*.deb">
			<variable>toOpen</variable>
		</entry>
		<button>
			<input file stock="gtk-open"></input>
			<action>fileselect:toOpen</action>
		</button>
		</hbox>
		<hbox>
		<text use-markup="true">
			<label>"<span><b>'"$N_outputdir"'</b></span>"</label>
		</text>
		<entry fs-title="'$T_SeFi'" fs-action="folder">
			<variable>OuTTtT</variable>
		</entry>
		<button>
			<input file stock="gtk-open"></input>
			<action>fileselect:OuTTtT</action>
			<variable>bOuTTtT</variable>
		</button>
		</hbox>
		<frame '"$What"'>
			<radiobutton><sensitive>false</sensitive>
				<label>"'$Install'"</label>
				<variable>rdInstall</variable>
				<action>if true enable:FINs</action>
				<action>if false disable:FINs</action>
				<action>if true disable:bOuTTtT</action>
				<action>if false enable:bOuTTtT</action>
				<action>if true disable:OuTTtT</action>
				<action>if false enable:OuTTtT</action>
			</radiobutton>
			<radiobutton active="true">
				<label>"'$Convert'"</label>
				<variable>rdConvert</variable>
				<action>if true enable:FConvert</action>
				<action>if false disable:FConvert</action>
			</radiobutton>
			<radiobutton>
				<label>"'$Extract'"</label>
				<variable>rdExtract</variable>
			</radiobutton>
 		</frame>
			<frame '"$Install"'>
				<radiobutton active="true">
					<label>"'$Inormal'"</label>
					<variable>rdInormal</variable>
				</radiobutton>
				<radiobutton>
					<label>"'$Iforce'"</label>
					<variable>rdIforce</variable>
				</radiobutton>
				<variable>FINs</variable>
				<sensitive>false</sensitive>
 			</frame>
			<frame '"$Convert"'>
				<text><label>"'$TTO'"</label></text>
				<comboboxtext>
				<variable>ToConvErt</variable>
					<item>rpm</item>
					<item>deb</item>
					<item>tgz</item>
					<item>lsb</item>
					<item>pkg</item>
				</comboboxtext>
				<sensitive>false</sensitive>
				<variable>FConvert</variable>
 			</frame>
		<hbox>
		<button>
				<input file stock="gtk-ok"></input>
				<label>'"$T_ok"'</label>
<action>almohazzem --operation ¶¶¶$rdInstall¶¶¶$rdConvert¶¶¶$rdSExtract¶¶¶$rdExtract¶¶¶$rdInormal¶¶¶$rdIforce¶¶¶$ToConvErt¶¶¶$toOpen¶¶¶$OuTTtT</action>
				<action>exit:Quit</action>
		</button>
		<button>
				<input file stock="gtk-cancel"></input>
				<label>'"$T_cancel"'</label>
				<action>exit:Quit</action>
		</button>
		</hbox>
	</vbox>
</window>' > "$tmp"/Operations
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Open-Dot-Almohazzem-Files---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
if [ "$mo_1" = "--openmode" ]
	then
	if [ "$projecttype" = "true" ]
		then
			"$tmp"/projectx $SV34 "source"
	elif [ "$projecttype" = "false" ]
		then
			"$tmp"/projectx $SV34 "folder"
	fi
	exit
fi
if ! [ "$mo_1" = "--gui" ] ; then
	ent="$mo_arg"
	if ! [ -e "$ent" ] ; then
		echo "$ent not supported or it is multi files "
		"$mo_gtkdialog" --file "$tmp/error_open" > /dev/null
		exit
	fi
	if [ "$(basename "$ent" .almohazzem)" = "$(basename "$ent")" ]
		then echo "$ent not supported"
		"$mo_gtkdialog" --file "$tmp/error_open" > /dev/null
		exit
	fi
	fcheck=`file -i "$ent" | cut -d ':' -f2 | cut -d '/' -f1 | cut -d ' ' -f2`
	pathto="`readlink -f "$ent"`"
	filename="`basename "$ent"`"
	if [ "$fcheck" = "text" ]
		then
	#old-.almohazzem
	echo "$ent is written in old Almohazzem , we can only repackage , Recreate it in new Almohazzem ."
	"$mo_gtkdialog" --file "$tmp/old" > /dev/null
	if ! [ -e "$HOME/Almohazzem RPMs/" ] ; then mkdir "$HOME/Almohazzem RPMs/" ; fi
	source "$pathto"
	cp "$pathto".tar "$tmp"
	cd "$tmp"
	tar -xf "$tmp"/$mo_arg_name.almohazzem.tar
	mv "$tmp"/$mo_arg_name/"$mo_arg_name"-almohazzem.spec "$tmp"/almohazzem.spec
	rpmbuild --buildroot="$tmp"/$mo_arg_name/ -ba "$tmp"/almohazzem.spec
	rm "$tmp"/$mo_arg_name.almohazzem.tar		
	rm -rf "$tmp"/$mo_arg_name
	if ! [ "$(ls -A "$HOME/Almohazzem RPMs/")" ] ; then rm -rf "$HOME/Almohazzem RPMs/" ; fi
		else
	#NEW-DOT-ALMOHAZZEM
	if [ -e "$tmp/opend" ]
		then rm -rf "$tmp/opend"
	fi
	mkdir "$tmp/opend"
	cp "$pathto" "$tmp/opend"
	cd "$tmp/opend"
	tar -xf "$filename"
	source "$tmp/opend/core"
	if ! [ -e "$tmp/other/$SV34" ]	; then
	mkdir -p "$tmp/other/$SV34" ; fi
	cp "$tmp/opend/$SV34"/other/* "$tmp/other/$SV34"
	if [ -e "$logs/$SV34-log" ]
		then rm "$logs/$SV34-log"
	fi
	touch "$logs/$SV34-log"
	if [ -e "$runs/$SV34" ]
		then rm -rf "$runs/$SV34"
	fi
	mkdir "$runs/$SV34"
	almohazzem --openmode
	fi
	exit
fi
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Project-STARTING---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
StArT()
{
AID=AID$(date +%Y%m%d%H%M%S)
touch "$logs/$AID-log"
mkdir "$runs/$AID"
mkdir -p "$tmp/other/$AID/"
touch "$tmp/other/$AID/pre-install"
touch "$tmp/other/$AID/post-install"
touch "$tmp/other/$AID/pre-uninstall"
touch "$tmp/other/$AID/post-uninstall"
touch "$tmp/other/$AID/description"
}
if [ "$mo_1" = "--gui" ]
	then
	if [ "$mo_2" = "new" ]
		then StArT
		"$tmp/projectx" $AID "folder"
		exit
	elif [ "$mo_2" = "source" ]
		then StArT
		echo > "$tmp"/"$AID"V47
		echo > "$tmp"/"$AID"V48
		echo > "$tmp"/"$AID"V49
		"$tmp/projectx" $AID "source"
		if ! [ -e "$cache/$AID" ]
			then
				mkdir "$cache/$AID"
		fi
		exit
	elif [ "$mo_2" ]
		then
		A2RG="`echo "$mo_arg" | sed "s:--gui::g"`"
		almohazzem $A2RG
		exit
	fi
fi
echo '<window title="'$TTNEW'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<hbox>
		<button image-position="Top">
			<label>"'$F_folder'"</label>
			<input file>"'$mo_icon'"</input>
			<action>almohazzem --gui new</action>
			<action>exit:Quit</action>
		</button>
		<button image-position="Top">
			<label>"'$F_source'"</label>
			<input file>"'$mo_icon'"</input>
			<action>almohazzem --gui source</action>
			<action>exit:Quit</action>
		</button>
	</hbox>
</window>' > "$tmp"/NeWProjEcT
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---About-Dialog---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
echo '<window title="'$t_about $Ttitle'" image-name="'$mo_icon'" window_position="1" resizable="false">
	<vbox>
		<pixmap>
			<input file>'"$mo_icon"'</input>
		</pixmap>
		<notebook tab-labels="'$A_welcome'|'$A_contributed'|'$A_license'|'$A_about'">
			<vbox>
				<text use-markup="true">
					<label>"<span><b>'"$T_welcome"'</b></span>"</label>
				</text>
			</vbox>
			<vbox>
				<text use-markup="true">
					<label>"<span><b>'"$T_contributed"'</b></span>"</label>
				</text>
			</vbox>
			<vbox>
	<edit><input file>/usr/share/doc/almohazzem/'$licensefile'</input></edit>
			</vbox>
			<vbox>
				<text use-markup="true">
					<label>"<span><b>'"$T_about"'</b></span>"</label>
				</text>
			</vbox>
		</notebook>
		<hbox>
			<button>
				<input file stock="gtk-ok"></input>
				<label>'"$T_ok"'</label>
				<action>exit:Quit</action>
			</button>
		</hbox>
	</vbox>
</window>' > "$tmp"/about
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#---Main-GUI---
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
echo "$S_main" > "$tmp/statusbar"
echo '<window title="'$Ttitle'" image-name="'$mo_icon'" window_position="1">
	<vbox spacing="0">
		<menubar>
			<menu label="'$M_file'" use-underline="true">
				<menuitem label="'$M_new'" accel-key="0x4e" accel-mods="4">
		<action signal="enter-notify-event">echo "'$S_new'" > '"$tmp/statusbar"'</action>
		<action signal="leave-notify-event">echo "'$S_main'" > '"$tmp/statusbar"'</action>
		<action signal="enter-notify-event">refresh:status</action>
		<action signal="leave-notify-event">refresh:status</action>
		<action>'$mo_gtkdialog' --file "'$tmp/NeWProjEcT'" > /dev/null &</action>
				</menuitem>
				<menuitem label="'$M_open'" accel-key="0x4f" accel-mods="4">
		<action signal="enter-notify-event">echo "'$S_open'" > '"$tmp/statusbar"'</action>
		<action signal="leave-notify-event">echo "'$S_main'" > '"$tmp/statusbar"'</action>
		<action signal="enter-notify-event">refresh:status</action>
		<action signal="leave-notify-event">refresh:status</action>
		<action>'$mo_gtkdialog' --file "'$tmp/OpeN'" > /dev/null &</action>
				</menuitem>
				<menuitem label="'$M_open_package'" accel-key="0x50" accel-mods="4">
		<action signal="enter-notify-event">echo "'$S_open_package'" > '"$tmp/statusbar"'</action>
		<action signal="leave-notify-event">echo "'$S_main'" > '"$tmp/statusbar"'</action>
		<action signal="enter-notify-event">refresh:status</action>
		<action signal="leave-notify-event">refresh:status</action>
		<action>'$mo_gtkdialog' --file "'$tmp/Operations'" > /dev/null &</action>
				</menuitem>
				<menuitem label="'$M_quit'" accel-key="0x51" accel-mods="4">
		<action signal="enter-notify-event">echo "'$S_quit'" > '"$tmp/statusbar"'</action>
		<action signal="leave-notify-event">echo "'$S_main'" > '"$tmp/statusbar"'</action>
		<action signal="enter-notify-event">refresh:status</action>
		<action signal="leave-notify-event">refresh:status</action>
		<action>exit:Quit</action>
				</menuitem>
			</menu>
			<menu label="'$M_edit'" use-underline="true">
				<menuitem label="'$M_setting'">
		<action signal="enter-notify-event">echo "'$S_setting'" > '"$tmp/statusbar"'</action>
		<action signal="leave-notify-event">echo "'$S_main'" > '"$tmp/statusbar"'</action>
		<action signal="enter-notify-event">refresh:status</action>
		<action signal="leave-notify-event">refresh:status</action>
		<action>'$mo_gtkdialog' --file "'$tmp/OPtiOnS'" > /dev/null &</action>
				</menuitem>
			</menu>
			<menu label="'$M_tools'" use-underline="true">
				<menuitem label="'$M_gen_icons'" accel-key="0x56" accel-mods="4">
		<action signal="enter-notify-event">echo "'$S_gen_icons'" > '"$tmp/statusbar"'</action>
		<action signal="leave-notify-event">echo "'$S_main'" > '"$tmp/statusbar"'</action>
		<action signal="enter-notify-event">refresh:status</action>
		<action signal="leave-notify-event">refresh:status</action>
		<action>'$mo_gtkdialog' --file "'$tmp/icongen'" > /dev/null &</action>
				</menuitem>
				<menuitem label="'$M_desktop'" accel-key="0x44" accel-mods="4">
		<action signal="enter-notify-event">echo "'$S_desktop'" > '"$tmp/statusbar"'</action>
		<action signal="leave-notify-event">echo "'$S_main'" > '"$tmp/statusbar"'</action>
		<action signal="enter-notify-event">refresh:status</action>
		<action signal="leave-notify-event">refresh:status</action>
		<action>almohazzem --gui desktop</action>
				</menuitem>
				<menuitem label="'$M_Uninstaller'">
		<action signal="enter-notify-event">echo "'$T_Uninstaller'" > '"$tmp/statusbar"'</action>
		<action signal="leave-notify-event">echo "'$S_main'" > '"$tmp/statusbar"'</action>
		<action signal="enter-notify-event">refresh:status</action>
		<action signal="leave-notify-event">refresh:status</action>
		<action>'$mo_gtkdialog' --file "'$tmp/Uninstaller'" > /dev/null &</action>
				</menuitem>
			</menu>
			<menu label="'$M_help'" use-underline="true">
				<menuitem label="'$M_content'" accel-key="0xffbe" accel-mods="4">
		<action signal="enter-notify-event">echo "'$S_content'" > '"$tmp/statusbar"'</action>
		<action signal="leave-notify-event">echo "'$S_main'" > '"$tmp/statusbar"'</action>
		<action signal="enter-notify-event">refresh:status</action>
		<action signal="leave-notify-event">refresh:status</action>
		<action>if [ -e /usr/share/doc/almohazzem/guide.pdf ] ; then xdg-open /usr/share/doc/almohazzem/guide.pdf ; else '$mo_gtkdialog' --file "'$tmp/error_doc'" > /dev/null ; fi &</action>
				</menuitem>
				<menuitem label="'$M_about'">
		<action signal="enter-notify-event">echo "'$S_about'" > '"$tmp/statusbar"'</action>
		<action signal="leave-notify-event">echo "'$S_main'" > '"$tmp/statusbar"'</action>
		<action signal="enter-notify-event">refresh:status</action>
		<action signal="leave-notify-event">refresh:status</action>
		<action>'$mo_gtkdialog' --file "'$tmp/about'" > /dev/null &</action>
				</menuitem>
			</menu>
		</menubar>
		<pixmap>
			<input file>'"$mo_image"'</input>
		</pixmap>
		<statusbar has-resize-grip="false">
			<input file>'"$tmp/statusbar"'</input>
			<variable>status</variable>
			<sensitive>true</sensitive>
		</statusbar>
	</vbox>
</window>
' > "$tmp"/main
"$mo_gtkdialog" --file "$tmp/main" > /dev/null
#---Cleaning---
echo '#! /bin/bash
sleep 2
ifrun="`ps --no-headers -Calmohazzem | wc -l`"
if ! [ "$ifrun" -ge 1 ] ; then rm -rf "'$tmp'" ; fi ' > "$tmp"/Exit
chmod +x "$tmp"/Exit
exec "$tmp"/Exit &
exit
#################################################################
#################################################################
#---------------------------------------------------------------#
#----Allah-all-thanked-to-help-me-to-write-this-program---------#
#----and-I-ask-him-to-make-the-benefit-for-you------------------#
#----Allah-can-do-that------------------------------------------#
#---------------------------------------------------------------#
#----With-our-best-wishes---------------------------------------#
#----almasa-project---------------------------------------------#
#---------------------------------------------------------------#
#################################################################
#################################################################
