Current File : /home/inlingua/public_html/decay_sym/root/var/softaculous/apps/exim/build/make.sh
#!/bin/bash
source /var/softaculous/apps/build/common.sh

#Version
exim=exim-4.98.2
#version=2.6.8
is_file $AMPPS_PATH"exim/bin/exim"
if [ $? == 0 ]
then

	# Libraries
	#libmcrypt
	#mhash
	#libiconv
	
	banner "Installing exim"
	cd $SRC_PATH
	remove_dir $exim
	
	is_file $exim.tar.gz
	if [ $? == 0 ]
	then
		banner $exim".tar.gz Downloading"
		wget --no-check-certificate -O $SRC_PATH/$exim.tar.gz https://downloads.exim.org/exim4/$exim.tar.gz >> $LOG 2>&1
	fi	
	tar -zxf $exim.tar.gz
	cd $exim
	export LD_LIBRARY_PATH=/usr/local/apps/openssl-11/lib:/usr/local/apps/libspf2/lib:/usr/local/apps/lib
	export CPATH=/usr/local/apps/include
	
	cp /var/softaculous/apps/exim/build/Makefile/Makefile /setups/$exim/Local/Makefile
	sed -i 's/\r//g' /setups/$exim/Local/Makefile
	
	make makefile && make && make install

    patchelf --set-rpath /usr/local/apps/openssl-11/lib:/usr/local/apps/libspf2/lib:/usr/local/apps/libidn2/lib:/usr/local/apps/lib/ "/usr/local/apps/exim/bin/exim"

	 mkdir -p /usr/local/apps/exim/var/spool/exim/log
	 chown -R exim:exim /usr/local/apps/exim/var/spool/exim/log
	 chmod -R 755 /usr/local/apps/exim/var/spool/exim/log
	
	cp -r /usr/local/apps/exim/var /usr/local/appsln/exim/


fi
is_file $AMPPS_PATH"/exim/bin/exim"
if [ $? == 0 ]
then
	banner 'EXIM could not be installed due to some reason'
	exit 1
fi