#
# upx/ucl bash compiler
# by KAPITALSIN 2o21 B11092021
#
# B11092021
# ADDED DEPENDENCIES FOR BETTER COMPILATION
#
sudo apt-get install git zlib1g-dev libtool g++

git clone https://github.com/upx/upx.git
cd upx
git submodule update --init --recursive
wget http://www.oberhumer.com/opensource/ucl/download/ucl-1.03.tar.gz
tar xvfa ucl-1.03.tar.gz
cd ucl-1.03
export CPPFLAGS="$CPPFLAGS -std=c90 -fPIC"
./configure  --enable-static  --disable-shared
unset CPPFLAGS
make -j$(nproc)
export UPX_UCLDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd ../src
sed -i 's/.out/.git-$(UPX_VERSION_GITREV).bin/g' Makefile
make -j$(nproc) LDFLAGS="--static"
unset UPX_UCLDIR
strip upx.*.bin && ./upx*.bin --ultra-brute upx*.bin
mv upx*.bin ..

