#!/bin/bash #=========================== # UMVIRT LINUX FROM SCRATCH #=========================== # Compilation script. # Network mode. #=========================== # Release: 0.2.2 # Package: dosbox-x #=========================== # DB commit: 48bb9ee31306c82c48dfaaad707eb4f6a926eb8a # APP commit: 1ca4178aea919e4c9e869e3d650ff8af9678bd6f #=========================== echo "ULFS Package installation start" echo "===============================" echo "Package: dosbox-x" echo "Release: 0.2.2" echo "checking config file" if [ -f $ULFS_CONFIG_FILE ] then echo "loading config file $ULFS_CONFIG_FILE..." . $ULFS_CONFIG_FILE fi #Creating log directory mkdir -p /var/log/ulfs-packages/dosbox-x/ #Saving start timestamp date +%s > /var/log/ulfs-packages/dosbox-x/start.time #Going to source directory... cd /sources #Checking dependances... #Checking libpng... if [ ! -f /var/cache/ulfs-packages/libpng ]; then echo "Dependance \"libpng\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libpng/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libpng ]; then echo "Dependance \"libpng\" is not installed. Exiting..." exit fi fi #Checking X... if [ ! -f /var/cache/ulfs-packages/X ]; then echo "Dependance \"X\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/X/install -O - | bash if [ ! -f /var/cache/ulfs-packages/X ]; then echo "Dependance \"X\" is not installed. Exiting..." exit fi fi #Checking glu... if [ ! -f /var/cache/ulfs-packages/glu ]; then echo "Dependance \"glu\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/glu/install -O - | bash if [ ! -f /var/cache/ulfs-packages/glu ]; then echo "Dependance \"glu\" is not installed. Exiting..." exit fi fi #Checking SDL2... if [ ! -f /var/cache/ulfs-packages/SDL2 ]; then echo "Dependance \"SDL2\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/SDL2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/SDL2 ]; then echo "Dependance \"SDL2\" is not installed. Exiting..." exit fi fi #Checking sdl12-compat... if [ ! -f /var/cache/ulfs-packages/sdl12-compat ]; then echo "Dependance \"sdl12-compat\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/sdl12-compat/install -O - | bash if [ ! -f /var/cache/ulfs-packages/sdl12-compat ]; then echo "Dependance \"sdl12-compat\" is not installed. Exiting..." exit fi fi #Checking speexdsp... if [ ! -f /var/cache/ulfs-packages/speexdsp ]; then echo "Dependance \"speexdsp\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/speexdsp/install -O - | bash if [ ! -f /var/cache/ulfs-packages/speexdsp ]; then echo "Dependance \"speexdsp\" is not installed. Exiting..." exit fi fi #Checking libslirp... if [ ! -f /var/cache/ulfs-packages/libslirp ]; then echo "Dependance \"libslirp\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libslirp/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libslirp ]; then echo "Dependance \"libslirp\" is not installed. Exiting..." exit fi fi #Checking SDL2_net... if [ ! -f /var/cache/ulfs-packages/SDL2_net ]; then echo "Dependance \"SDL2_net\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/SDL2_net/install -O - | bash if [ ! -f /var/cache/ulfs-packages/SDL2_net ]; then echo "Dependance \"SDL2_net\" is not installed. Exiting..." exit fi fi #Checking SDL... if [ ! -f /var/cache/ulfs-packages/SDL ]; then echo "Dependance \"SDL\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/SDL/install -O - | bash if [ ! -f /var/cache/ulfs-packages/SDL ]; then echo "Dependance \"SDL\" is not installed. Exiting..." exit fi fi #Checking SDL_net... if [ ! -f /var/cache/ulfs-packages/SDL_net ]; then echo "Dependance \"SDL_net\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/SDL_net/install -O - | bash if [ ! -f /var/cache/ulfs-packages/SDL_net ]; then echo "Dependance \"SDL_net\" is not installed. Exiting..." exit fi fi #Checking opusfile... if [ ! -f /var/cache/ulfs-packages/opusfile ]; then echo "Dependance \"opusfile\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/opusfile/install -O - | bash if [ ! -f /var/cache/ulfs-packages/opusfile ]; then echo "Dependance \"opusfile\" is not installed. Exiting..." exit fi fi #Checking iir1... if [ ! -f /var/cache/ulfs-packages/iir1 ]; then echo "Dependance \"iir1\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/iir1/install -O - | bash if [ ! -f /var/cache/ulfs-packages/iir1 ]; then echo "Dependance \"iir1\" is not installed. Exiting..." exit fi fi #Checking zlib-ng... if [ ! -f /var/cache/ulfs-packages/zlib-ng ]; then echo "Dependance \"zlib-ng\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/zlib-ng/install -O - | bash if [ ! -f /var/cache/ulfs-packages/zlib-ng ]; then echo "Dependance \"zlib-ng\" is not installed. Exiting..." exit fi fi #Checking fluidsynth... if [ ! -f /var/cache/ulfs-packages/fluidsynth ]; then echo "Dependance \"fluidsynth\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/fluidsynth/install -O - | bash if [ ! -f /var/cache/ulfs-packages/fluidsynth ]; then echo "Dependance \"fluidsynth\" is not installed. Exiting..." exit fi fi #Checking libmt32emu... if [ ! -f /var/cache/ulfs-packages/libmt32emu ]; then echo "Dependance \"libmt32emu\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libmt32emu/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libmt32emu ]; then echo "Dependance \"libmt32emu\" is not installed. Exiting..." exit fi fi #Checking openglide... if [ ! -f /var/cache/ulfs-packages/openglide ]; then echo "Dependance \"openglide\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/openglide/install -O - | bash if [ ! -f /var/cache/ulfs-packages/openglide ]; then echo "Dependance \"openglide\" is not installed. Exiting..." exit fi fi #Saving downloading timestamp date +%s > /var/log/ulfs-packages/dosbox-x/download.time #Downloading source package archive... wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/packages/d/dosbox-x-v2024.10.01.tar.gz.md5sum wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/packages/d/dosbox-x-v2024.10.01.tar.gz #Checking source package file existance if [ ! -f dosbox-x-v2024.10.01.tar.gz ]; then echo "Error: Can't find dosbox-x-v2024.10.01.tar.gz. Exiting!" exit fi #Checking source package file checksum if [ -f dosbox-x-v2024.10.01.tar.gz.md5sum ]; then MD5=`LANG=C md5sum -c dosbox-x-v2024.10.01.tar.gz.md5sum | grep OK` if [ "$MD5" == "" ] ; then echo "Error: Checksum of dosbox-x-v2024.10.01.tar.gz is wrong. Exiting!" exit fi fi #Downloadning patches... wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/patches/dosbox-x-ulfs.patch #Saving cleanup timestamp date +%s > /var/log/ulfs-packages/dosbox-x/cleanup.time rm -rfv /sources/dosbox-x-dosbox-x-v2024.10.01/ #Saving extracting timestamp date +%s > /var/log/ulfs-packages/dosbox-x/unpack.time #Extracting tar source package archive with default parameters... tar -xf dosbox-x-v2024.10.01.tar.gz #Checking package directory size after unpack... du -s dosbox-x-dosbox-x-v2024.10.01 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/dosbox-x/unpack.size #Going to source package directory... cd dosbox-x-dosbox-x-v2024.10.01 #Applying patches... patch -Np1 -i ../dosbox-x-ulfs.patch #Saving configuration timestamp date +%s > /var/log/ulfs-packages/dosbox-x/configure.time #Sleep 1 second sleep 1 if [[ "$ULFS_PKG_DATERESET" == "YES" ]] then #Changing all files creation time (except build configuration files) in source directory to find them after installation find /sources/dosbox-x-dosbox-x-v2024.10.01 \! -path "*/configure*" \! -path "*/Makefile*" \! -path "*.make" \! -path "*.m4" \! -path "*.am" \! -path "*.mk" \! -path "*.stamp" \! -path "*gentpl.py" -exec touch -m {} + fi #Running configuration script... echo "checking config file" if [ -f $ULFS_CONFIG_FILE ] then echo "loading config file $ULFS_CONFIG_FILE..." . $ULFS_CONFIG_FILE fi cat > ulfs_configure.sh << EOIS echo "Initializing distributed build environment... " if [[ "\$ULFS_ICECC" == "YES" ]] then export PATH="\$ULFS_ICECC_PATH:\$PATH" echo "ICECC" fi echo "Environment debug..." echo "PATH: \$PATH" echo "MAKEFLAGS: \$MAKEFLAGS" echo "NINJAJOBS: \$NINJAJOBS" env | grep ULFS ./autogen.sh ./configure --prefix=/usr --enable-sdl2 EOIS cat ulfs_configure.sh | bash 2>&1 | tee /var/log/ulfs-packages/dosbox-x/configure.log #Saving build timestamp date +%s > /var/log/ulfs-packages/dosbox-x/build.time #Running build script... echo "checking config file" if [ -f $ULFS_CONFIG_FILE ] then echo "loading config file $ULFS_CONFIG_FILE..." . $ULFS_CONFIG_FILE fi cat > ulfs_build.sh << EOIS echo "Initializing distributed build environment... " if [[ "\$ULFS_ICECC" == "YES" ]] then export PATH="\$ULFS_ICECC_PATH:\$PATH" echo "ICECC" fi echo "Environment debug..." echo "PATH: \$PATH" echo "MAKEFLAGS: \$MAKEFLAGS" echo "NINJAJOBS: \$NINJAJOBS" env | grep ULFS make EOIS cat ulfs_build.sh | bash 2>&1 | tee /var/log/ulfs-packages/dosbox-x/build.log #Saving install timestamp date +%s > /var/log/ulfs-packages/dosbox-x/install.time #Running install script... cat > ulfs_install.sh << EOIS make install EOIS USER=`whoami` if [ "$USER" == "root" ] ; then cat ulfs_install.sh | bash 2>&1 | tee /var/log/ulfs-packages/dosbox-x/install.log else cat ulfs_install.sh | sudo bash 2>&1 | tee /var/log/ulfs-packages/dosbox-x/install.log fi #Saving finish timestamp date +%s > /var/log/ulfs-packages/dosbox-x/finish.time #Checking package directory size after unpack... cd /sources du -s dosbox-x-dosbox-x-v2024.10.01 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/dosbox-x/install.size echo "ULFS package installation completed." #Producing files list echo "Looking for installed files..." if [ -f /var/log/ulfs-packages/dosbox-x/files.txt ]; then rm /var/log/ulfs-packages/dosbox-x/files.txt fi USER=`whoami` if [ "$USER" == "root" ] ; then find /bin -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt find /sbin -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt find /usr -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt find /etc -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt find /opt -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt find /lib -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt find /lib64 -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt find /var -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time \! -path "/var/log/ulfs-packages/dosbox-x/*" >> /var/log/ulfs-packages/dosbox-x/files.txt else sudo find /bin -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt sudo find /sbin -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt sudo find /usr -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt sudo find /etc -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt sudo find /opt -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt sudo find /lib -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt sudo find /lib64 -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time >> /var/log/ulfs-packages/dosbox-x/files.txt sudo find /var -type f -newer /var/log/ulfs-packages/dosbox-x/configure.time \! -newer /var/log/ulfs-packages/dosbox-x/finish.time \! -path "/var/log/ulfs-packages/dosbox-x/*" >> /var/log/ulfs-packages/dosbox-x/files.txt fi #Marking package as installed... mkdir -p /var/cache/ulfs-packages USER=`whoami` if [ "$USER" == "root" ] ; then touch /var/cache/ulfs-packages/dosbox-x else sudo touch /var/cache/ulfs-packages/dosbox-x fi #Calculate delta size a=`cat /var/log/ulfs-packages/dosbox-x/unpack.size` b=`cat /var/log/ulfs-packages/dosbox-x/install.size` c=$(($b-$a)) echo $c > /var/log/ulfs-packages/dosbox-x/delta.size #Calculate prepare time a=`cat /var/log/ulfs-packages/dosbox-x/start.time` b=`cat /var/log/ulfs-packages/dosbox-x/configure.time` dp=$(($b-$a)) #Calculate download time a=`cat /var/log/ulfs-packages/dosbox-x/download.time` b=`cat /var/log/ulfs-packages/dosbox-x/unpack.time` dd=$(($b-$a)) #Calculate delta time a=`cat /var/log/ulfs-packages/dosbox-x/configure.time` b=`cat /var/log/ulfs-packages/dosbox-x/finish.time` db=$(($b-$a)) echo $db > /var/log/ulfs-packages/dosbox-x/delta.time #Report echo "" echo "ULFS Package installation report" echo "================================" echo "Package: dosbox-x" echo "Release: 0.2.2" echo "Build size: $c" echo "Prepare time: $dp sec." echo "Download time: $dd sec." echo "Build time: $db sec." #End of script