#!/bin/bash #=========================== # UMVIRT LINUX FROM SCRATCH #=========================== # Compilation script. # Network mode. #=========================== # Release: 0.2.2 # Package: gimp #=========================== # DB commit: 48bb9ee31306c82c48dfaaad707eb4f6a926eb8a # APP commit: 1ca4178aea919e4c9e869e3d650ff8af9678bd6f #=========================== echo "ULFS Package installation start" echo "===============================" echo "Package: gimp" 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/gimp/ #Saving start timestamp date +%s > /var/log/ulfs-packages/gimp/start.time #Going to source directory... cd /sources #Checking dependances... #Checking python2-pycairo... if [ ! -f /var/cache/ulfs-packages/python2-pycairo ]; then echo "Dependance \"python2-pycairo\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/python2-pycairo/install -O - | bash if [ ! -f /var/cache/ulfs-packages/python2-pycairo ]; then echo "Dependance \"python2-pycairo\" is not installed. Exiting..." exit fi fi #Checking python3-pycairo... if [ ! -f /var/cache/ulfs-packages/python3-pycairo ]; then echo "Dependance \"python3-pycairo\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/python3-pycairo/install -O - | bash if [ ! -f /var/cache/ulfs-packages/python3-pycairo ]; then echo "Dependance \"python3-pycairo\" is not installed. Exiting..." exit fi fi #Checking libheif... if [ ! -f /var/cache/ulfs-packages/libheif ]; then echo "Dependance \"libheif\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libheif/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libheif ]; then echo "Dependance \"libheif\" is not installed. Exiting..." exit fi fi #Checking libde265... if [ ! -f /var/cache/ulfs-packages/libde265 ]; then echo "Dependance \"libde265\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libde265/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libde265 ]; then echo "Dependance \"libde265\" is not installed. Exiting..." exit fi fi #Checking appstream-glib... if [ ! -f /var/cache/ulfs-packages/appstream-glib ]; then echo "Dependance \"appstream-glib\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/appstream-glib/install -O - | bash if [ ! -f /var/cache/ulfs-packages/appstream-glib ]; then echo "Dependance \"appstream-glib\" is not installed. Exiting..." exit fi fi #Checking libxml2... if [ ! -f /var/cache/ulfs-packages/libxml2 ]; then echo "Dependance \"libxml2\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libxml2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libxml2 ]; then echo "Dependance \"libxml2\" is not installed. Exiting..." exit fi fi #Checking harfbuzz... if [ ! -f /var/cache/ulfs-packages/harfbuzz ]; then echo "Dependance \"harfbuzz\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/harfbuzz/install -O - | bash if [ ! -f /var/cache/ulfs-packages/harfbuzz ]; then echo "Dependance \"harfbuzz\" 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 gtk2... if [ ! -f /var/cache/ulfs-packages/gtk2 ]; then echo "Dependance \"gtk2\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/gtk2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/gtk2 ]; then echo "Dependance \"gtk2\" is not installed. Exiting..." exit fi fi #Checking libjpeg-turbo... if [ ! -f /var/cache/ulfs-packages/libjpeg-turbo ]; then echo "Dependance \"libjpeg-turbo\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libjpeg-turbo/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libjpeg-turbo ]; then echo "Dependance \"libjpeg-turbo\" is not installed. Exiting..." exit fi fi #Checking tiff... if [ ! -f /var/cache/ulfs-packages/tiff ]; then echo "Dependance \"tiff\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/tiff/install -O - | bash if [ ! -f /var/cache/ulfs-packages/tiff ]; then echo "Dependance \"tiff\" is not installed. Exiting..." exit fi fi #Checking pygtk2... if [ ! -f /var/cache/ulfs-packages/pygtk2 ]; then echo "Dependance \"pygtk2\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/pygtk2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/pygtk2 ]; then echo "Dependance \"pygtk2\" is not installed. Exiting..." exit fi fi #Checking dbus-glib... if [ ! -f /var/cache/ulfs-packages/dbus-glib ]; then echo "Dependance \"dbus-glib\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/dbus-glib/install -O - | bash if [ ! -f /var/cache/ulfs-packages/dbus-glib ]; then echo "Dependance \"dbus-glib\" is not installed. Exiting..." exit fi fi #Checking graphviz... if [ ! -f /var/cache/ulfs-packages/graphviz ]; then echo "Dependance \"graphviz\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/graphviz/install -O - | bash if [ ! -f /var/cache/ulfs-packages/graphviz ]; then echo "Dependance \"graphviz\" is not installed. Exiting..." exit fi fi #Checking iso-codes... if [ ! -f /var/cache/ulfs-packages/iso-codes ]; then echo "Dependance \"iso-codes\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/iso-codes/install -O - | bash if [ ! -f /var/cache/ulfs-packages/iso-codes ]; then echo "Dependance \"iso-codes\" is not installed. Exiting..." exit fi fi #Checking librsvg... if [ ! -f /var/cache/ulfs-packages/librsvg ]; then echo "Dependance \"librsvg\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/librsvg/install -O - | bash if [ ! -f /var/cache/ulfs-packages/librsvg ]; then echo "Dependance \"librsvg\" is not installed. Exiting..." exit fi fi #Checking glib-networking... if [ ! -f /var/cache/ulfs-packages/glib-networking ]; then echo "Dependance \"glib-networking\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/glib-networking/install -O - | bash if [ ! -f /var/cache/ulfs-packages/glib-networking ]; then echo "Dependance \"glib-networking\" is not installed. Exiting..." exit fi fi #Checking libgudev... if [ ! -f /var/cache/ulfs-packages/libgudev ]; then echo "Dependance \"libgudev\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libgudev/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libgudev ]; then echo "Dependance \"libgudev\" is not installed. Exiting..." exit fi fi #Checking lcms2... if [ ! -f /var/cache/ulfs-packages/lcms2 ]; then echo "Dependance \"lcms2\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/lcms2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/lcms2 ]; then echo "Dependance \"lcms2\" is not installed. Exiting..." exit fi fi #Checking gexiv2... if [ ! -f /var/cache/ulfs-packages/gexiv2 ]; then echo "Dependance \"gexiv2\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/gexiv2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/gexiv2 ]; then echo "Dependance \"gexiv2\" is not installed. Exiting..." exit fi fi #Checking poppler... if [ ! -f /var/cache/ulfs-packages/poppler ]; then echo "Dependance \"poppler\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/poppler/install -O - | bash if [ ! -f /var/cache/ulfs-packages/poppler ]; then echo "Dependance \"poppler\" is not installed. Exiting..." exit fi fi #Checking xdg-utils... if [ ! -f /var/cache/ulfs-packages/xdg-utils ]; then echo "Dependance \"xdg-utils\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/xdg-utils/install -O - | bash if [ ! -f /var/cache/ulfs-packages/xdg-utils ]; then echo "Dependance \"xdg-utils\" is not installed. Exiting..." exit fi fi #Checking ghostscript... if [ ! -f /var/cache/ulfs-packages/ghostscript ]; then echo "Dependance \"ghostscript\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/ghostscript/install -O - | bash if [ ! -f /var/cache/ulfs-packages/ghostscript ]; then echo "Dependance \"ghostscript\" is not installed. Exiting..." exit fi fi #Checking gegl... if [ ! -f /var/cache/ulfs-packages/gegl ]; then echo "Dependance \"gegl\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/gegl/install -O - | bash if [ ! -f /var/cache/ulfs-packages/gegl ]; then echo "Dependance \"gegl\" is not installed. Exiting..." exit fi fi #Checking libmypaint... if [ ! -f /var/cache/ulfs-packages/libmypaint ]; then echo "Dependance \"libmypaint\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libmypaint/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libmypaint ]; then echo "Dependance \"libmypaint\" is not installed. Exiting..." exit fi fi #Checking mypaint-brushes... if [ ! -f /var/cache/ulfs-packages/mypaint-brushes ]; then echo "Dependance \"mypaint-brushes\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/mypaint-brushes/install -O - | bash if [ ! -f /var/cache/ulfs-packages/mypaint-brushes ]; then echo "Dependance \"mypaint-brushes\" is not installed. Exiting..." exit fi fi #Saving downloading timestamp date +%s > /var/log/ulfs-packages/gimp/download.time #Downloading source package archive... wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/packages/g/gimp-2.10.38.tar.bz2.md5sum wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/packages/g/gimp-2.10.38.tar.bz2 #Checking source package file existance if [ ! -f gimp-2.10.38.tar.bz2 ]; then echo "Error: Can't find gimp-2.10.38.tar.bz2. Exiting!" exit fi #Checking source package file checksum if [ -f gimp-2.10.38.tar.bz2.md5sum ]; then MD5=`LANG=C md5sum -c gimp-2.10.38.tar.bz2.md5sum | grep OK` if [ "$MD5" == "" ] ; then echo "Error: Checksum of gimp-2.10.38.tar.bz2 is wrong. Exiting!" exit fi fi #Saving cleanup timestamp date +%s > /var/log/ulfs-packages/gimp/cleanup.time rm -rfv /sources/gimp-2.10.38/ #Saving extracting timestamp date +%s > /var/log/ulfs-packages/gimp/unpack.time #Extracting tar source package archive with default parameters... tar -xf gimp-2.10.38.tar.bz2 #Checking package directory size after unpack... du -s gimp-2.10.38 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/gimp/unpack.size #Going to source package directory... cd gimp-2.10.38 #Saving configuration timestamp date +%s > /var/log/ulfs-packages/gimp/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/gimp-2.10.38 \! -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 CFLAGS+=" -Wno-error=incompatible-pointer-types" export CFLAGS ./configure --prefix=/usr --sysconfdir=/etc EOIS cat ulfs_configure.sh | bash 2>&1 | tee /var/log/ulfs-packages/gimp/configure.log #Saving build timestamp date +%s > /var/log/ulfs-packages/gimp/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 if [[ "\$ULFS_PKG_TEST" == "YES" ]] then make check fi EOIS cat ulfs_build.sh | bash 2>&1 | tee /var/log/ulfs-packages/gimp/build.log #Saving install timestamp date +%s > /var/log/ulfs-packages/gimp/install.time #Running install script... cat > ulfs_install.sh << EOIS make install gtk-update-icon-cache -qtf /usr/share/icons/hicolor && update-desktop-database -q EOIS USER=`whoami` if [ "$USER" == "root" ] ; then cat ulfs_install.sh | bash 2>&1 | tee /var/log/ulfs-packages/gimp/install.log else cat ulfs_install.sh | sudo bash 2>&1 | tee /var/log/ulfs-packages/gimp/install.log fi #Saving finish timestamp date +%s > /var/log/ulfs-packages/gimp/finish.time #Checking package directory size after unpack... cd /sources du -s gimp-2.10.38 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/gimp/install.size echo "ULFS package installation completed." #Producing files list echo "Looking for installed files..." if [ -f /var/log/ulfs-packages/gimp/files.txt ]; then rm /var/log/ulfs-packages/gimp/files.txt fi USER=`whoami` if [ "$USER" == "root" ] ; then find /bin -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt find /sbin -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt find /usr -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt find /etc -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt find /opt -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt find /lib -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt find /lib64 -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt find /var -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time \! -path "/var/log/ulfs-packages/gimp/*" >> /var/log/ulfs-packages/gimp/files.txt else sudo find /bin -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt sudo find /sbin -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt sudo find /usr -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt sudo find /etc -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt sudo find /opt -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt sudo find /lib -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt sudo find /lib64 -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time >> /var/log/ulfs-packages/gimp/files.txt sudo find /var -type f -newer /var/log/ulfs-packages/gimp/configure.time \! -newer /var/log/ulfs-packages/gimp/finish.time \! -path "/var/log/ulfs-packages/gimp/*" >> /var/log/ulfs-packages/gimp/files.txt fi #Marking package as installed... mkdir -p /var/cache/ulfs-packages USER=`whoami` if [ "$USER" == "root" ] ; then touch /var/cache/ulfs-packages/gimp else sudo touch /var/cache/ulfs-packages/gimp fi #Calculate delta size a=`cat /var/log/ulfs-packages/gimp/unpack.size` b=`cat /var/log/ulfs-packages/gimp/install.size` c=$(($b-$a)) echo $c > /var/log/ulfs-packages/gimp/delta.size #Calculate prepare time a=`cat /var/log/ulfs-packages/gimp/start.time` b=`cat /var/log/ulfs-packages/gimp/configure.time` dp=$(($b-$a)) #Calculate download time a=`cat /var/log/ulfs-packages/gimp/download.time` b=`cat /var/log/ulfs-packages/gimp/unpack.time` dd=$(($b-$a)) #Calculate delta time a=`cat /var/log/ulfs-packages/gimp/configure.time` b=`cat /var/log/ulfs-packages/gimp/finish.time` db=$(($b-$a)) echo $db > /var/log/ulfs-packages/gimp/delta.time #Report echo "" echo "ULFS Package installation report" echo "================================" echo "Package: gimp" 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