#!/bin/bash #=========================== # UMVIRT LINUX FROM SCRATCH #=========================== # Compilation script. # Network mode. #=========================== # Release: 0.1 # Package: blender #=========================== # DB commit: d35a620850806ab581b32cb34d268a904c9c0a5f # APP commit: #=========================== echo "ULFS Package installation start" echo "===============================" echo "Package: blender" echo "Release: 0.1" 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/blender/ #Saving start timestamp date +%s > /var/log/ulfs-packages/blender/start.time #Going to source directory... cd /sources #Checking dependances... #Checking mesa... if [ ! -f /var/cache/ulfs-packages/mesa ]; then echo "Dependance \"mesa\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/mesa/install -O - | bash if [ ! -f /var/cache/ulfs-packages/mesa ]; then echo "Dependance \"mesa\" is not installed. Exiting..." exit fi fi #Checking cmake... if [ ! -f /var/cache/ulfs-packages/cmake ]; then echo "Dependance \"cmake\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/cmake/install -O - | bash if [ ! -f /var/cache/ulfs-packages/cmake ]; then echo "Dependance \"cmake\" is not installed. Exiting..." exit fi fi #Checking libpng... if [ ! -f /var/cache/ulfs-packages/libpng ]; then echo "Dependance \"libpng\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/libpng/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libpng ]; then echo "Dependance \"libpng\" 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://ulfs.org/linux/packages//0.1/tiff/install -O - | bash if [ ! -f /var/cache/ulfs-packages/tiff ]; then echo "Dependance \"tiff\" 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://ulfs.org/linux/packages//0.1/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 openjpeg... if [ ! -f /var/cache/ulfs-packages/openjpeg ]; then echo "Dependance \"openjpeg\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/openjpeg/install -O - | bash if [ ! -f /var/cache/ulfs-packages/openjpeg ]; then echo "Dependance \"openjpeg\" is not installed. Exiting..." exit fi fi #Checking libboost... if [ ! -f /var/cache/ulfs-packages/libboost ]; then echo "Dependance \"libboost\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/libboost/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libboost ]; then echo "Dependance \"libboost\" 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://ulfs.org/linux/packages//0.1/SDL2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/SDL2 ]; then echo "Dependance \"SDL2\" is not installed. Exiting..." exit fi fi #Checking ffmpeg... if [ ! -f /var/cache/ulfs-packages/ffmpeg ]; then echo "Dependance \"ffmpeg\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/ffmpeg/install -O - | bash if [ ! -f /var/cache/ulfs-packages/ffmpeg ]; then echo "Dependance \"ffmpeg\" is not installed. Exiting..." exit fi fi #Checking oiio... if [ ! -f /var/cache/ulfs-packages/oiio ]; then echo "Dependance \"oiio\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/oiio/install -O - | bash if [ ! -f /var/cache/ulfs-packages/oiio ]; then echo "Dependance \"oiio\" is not installed. Exiting..." exit fi fi #Checking openexr... if [ ! -f /var/cache/ulfs-packages/openexr ]; then echo "Dependance \"openexr\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/openexr/install -O - | bash if [ ! -f /var/cache/ulfs-packages/openexr ]; then echo "Dependance \"openexr\" is not installed. Exiting..." exit fi fi #Checking glew... if [ ! -f /var/cache/ulfs-packages/glew ]; then echo "Dependance \"glew\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/glew/install -O - | bash if [ ! -f /var/cache/ulfs-packages/glew ]; then echo "Dependance \"glew\" is not installed. Exiting..." exit fi fi #Checking python3-numpy... if [ ! -f /var/cache/ulfs-packages/python3-numpy ]; then echo "Dependance \"python3-numpy\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/python3-numpy/install -O - | bash if [ ! -f /var/cache/ulfs-packages/python3-numpy ]; then echo "Dependance \"python3-numpy\" is not installed. Exiting..." exit fi fi #Checking python3-requests... if [ ! -f /var/cache/ulfs-packages/python3-requests ]; then echo "Dependance \"python3-requests\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/python3-requests/install -O - | bash if [ ! -f /var/cache/ulfs-packages/python3-requests ]; then echo "Dependance \"python3-requests\" is not installed. Exiting..." exit fi fi #Checking jemalloc... if [ ! -f /var/cache/ulfs-packages/jemalloc ]; then echo "Dependance \"jemalloc\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/jemalloc/install -O - | bash if [ ! -f /var/cache/ulfs-packages/jemalloc ]; then echo "Dependance \"jemalloc\" is not installed. Exiting..." exit fi fi #Checking openal... if [ ! -f /var/cache/ulfs-packages/openal ]; then echo "Dependance \"openal\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/openal/install -O - | bash if [ ! -f /var/cache/ulfs-packages/openal ]; then echo "Dependance \"openal\" is not installed. Exiting..." exit fi fi #Checking alembic... if [ ! -f /var/cache/ulfs-packages/alembic ]; then echo "Dependance \"alembic\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/alembic/install -O - | bash if [ ! -f /var/cache/ulfs-packages/alembic ]; then echo "Dependance \"alembic\" is not installed. Exiting..." exit fi fi #Checking fftw-single... if [ ! -f /var/cache/ulfs-packages/fftw-single ]; then echo "Dependance \"fftw-single\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/fftw-single/install -O - | bash if [ ! -f /var/cache/ulfs-packages/fftw-single ]; then echo "Dependance \"fftw-single\" is not installed. Exiting..." exit fi fi #Checking fftw-double... if [ ! -f /var/cache/ulfs-packages/fftw-double ]; then echo "Dependance \"fftw-double\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/fftw-double/install -O - | bash if [ ! -f /var/cache/ulfs-packages/fftw-double ]; then echo "Dependance \"fftw-double\" is not installed. Exiting..." exit fi fi #Checking fftw-longdouble... if [ ! -f /var/cache/ulfs-packages/fftw-longdouble ]; then echo "Dependance \"fftw-longdouble\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/fftw-longdouble/install -O - | bash if [ ! -f /var/cache/ulfs-packages/fftw-longdouble ]; then echo "Dependance \"fftw-longdouble\" is not installed. Exiting..." exit fi fi #Checking fftw-quad... if [ ! -f /var/cache/ulfs-packages/fftw-quad ]; then echo "Dependance \"fftw-quad\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/fftw-quad/install -O - | bash if [ ! -f /var/cache/ulfs-packages/fftw-quad ]; then echo "Dependance \"fftw-quad\" is not installed. Exiting..." exit fi fi #Checking opencollada... if [ ! -f /var/cache/ulfs-packages/opencollada ]; then echo "Dependance \"opencollada\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/opencollada/install -O - | bash if [ ! -f /var/cache/ulfs-packages/opencollada ]; then echo "Dependance \"opencollada\" is not installed. Exiting..." exit fi fi #Checking opencolorio... if [ ! -f /var/cache/ulfs-packages/opencolorio ]; then echo "Dependance \"opencolorio\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/opencolorio/install -O - | bash if [ ! -f /var/cache/ulfs-packages/opencolorio ]; then echo "Dependance \"opencolorio\" is not installed. Exiting..." exit fi fi #Checking openshadinglanguage... if [ ! -f /var/cache/ulfs-packages/openshadinglanguage ]; then echo "Dependance \"openshadinglanguage\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/openshadinglanguage/install -O - | bash if [ ! -f /var/cache/ulfs-packages/openshadinglanguage ]; then echo "Dependance \"openshadinglanguage\" is not installed. Exiting..." exit fi fi #Checking oidn... if [ ! -f /var/cache/ulfs-packages/oidn ]; then echo "Dependance \"oidn\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/oidn/install -O - | bash if [ ! -f /var/cache/ulfs-packages/oidn ]; then echo "Dependance \"oidn\" is not installed. Exiting..." exit fi fi #Checking libspnav... if [ ! -f /var/cache/ulfs-packages/libspnav ]; then echo "Dependance \"libspnav\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/libspnav/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libspnav ]; then echo "Dependance \"libspnav\" is not installed. Exiting..." exit fi fi #Checking ptex... if [ ! -f /var/cache/ulfs-packages/ptex ]; then echo "Dependance \"ptex\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/ptex/install -O - | bash if [ ! -f /var/cache/ulfs-packages/ptex ]; then echo "Dependance \"ptex\" is not installed. Exiting..." exit fi fi #Checking opensubdiv... if [ ! -f /var/cache/ulfs-packages/opensubdiv ]; then echo "Dependance \"opensubdiv\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/opensubdiv/install -O - | bash if [ ! -f /var/cache/ulfs-packages/opensubdiv ]; then echo "Dependance \"opensubdiv\" is not installed. Exiting..." exit fi fi #Checking log4cplus... if [ ! -f /var/cache/ulfs-packages/log4cplus ]; then echo "Dependance \"log4cplus\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/log4cplus/install -O - | bash if [ ! -f /var/cache/ulfs-packages/log4cplus ]; then echo "Dependance \"log4cplus\" is not installed. Exiting..." exit fi fi #Checking openvdb... if [ ! -f /var/cache/ulfs-packages/openvdb ]; then echo "Dependance \"openvdb\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/openvdb/install -O - | bash if [ ! -f /var/cache/ulfs-packages/openvdb ]; then echo "Dependance \"openvdb\" is not installed. Exiting..." exit fi fi #Saving downloading timestamp date +%s > /var/log/ulfs-packages/blender/download.time #Downloading source package archive... wget --no-check-certificate -nc https://ulfs.org/linux/downloads/package_files/0.1/packages/b/blender-2.81.tar.xz.md5sum wget --no-check-certificate -nc https://ulfs.org/linux/downloads/package_files/0.1/packages/b/blender-2.81.tar.xz #Checking source package file existance if [ ! -f blender-2.81.tar.xz ]; then echo "Error: Can't find blender-2.81.tar.xz. Exiting!" exit fi #Checking source package file checksum if [ -f blender-2.81.tar.xz.md5sum ]; then MD5=`LANG=C md5sum -c blender-2.81.tar.xz.md5sum | grep OK` if [ "$MD5" == "" ] ; then echo "Error: Checksum of blender-2.81.tar.xz is wrong. Exiting!" exit fi fi #Saving cleanup timestamp date +%s > /var/log/ulfs-packages/blender/cleanup.time rm -rfv /sources/blender-2.81/ #Saving extracting timestamp date +%s > /var/log/ulfs-packages/blender/unpack.time #Extracting tar source package archive with default parameters... tar -xf blender-2.81.tar.xz #Checking package directory size after unpack... du -s blender-2.81 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/blender/unpack.size #Going to source package directory... cd blender-2.81 #Saving configuration timestamp date +%s > /var/log/ulfs-packages/blender/configure.time #Sleep 1 second sleep 1 #Running configuration script... #LFS BUGFIX: 3.7m in /usr/include not 3.7. ln -s /usr/include/python3.7m /usr/include/python3.7 #numpy bugfix ln -s /usr/lib/python3.7/site-packages/numpy*/numpy /usr/lib/python3.7 mkdir build cd build #cmake config for debug: # files/cmake/config/blender_lite.cmake cmake \ -GNinja \ -C../build_files/cmake/config/blender_release.cmake .. \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_INSTALL_PORTABLE=OFF \ -DWITH_PYTHON_INSTALL=OFF \ -DPYTHON_VERSION=3.7 \ -DPYTHON_LIBPATH=/usr/lib \ -DPYTHON_LIBRARY=python3.7m \ -DPYTHON_INCLUDE_DIRS=/usr/include/python3.7m #Saving build timestamp date +%s > /var/log/ulfs-packages/blender/build.time #Running build script... ninja #Saving install timestamp date +%s > /var/log/ulfs-packages/blender/install.time #Running install script... cat > ulfs_install.sh << EOIS ninja install EOIS USER=`whoami` if [ "$USER" == "root" ] ; then cat ulfs_install.sh | bash 2>&1 | tee /var/log/ulfs-packages/blender/install.log else cat ulfs_install.sh | sudo bash 2>&1 | tee /var/log/ulfs-packages/blender/install.log fi #Saving finish timestamp date +%s > /var/log/ulfs-packages/blender/finish.time #Checking package directory size after unpack... cd /sources du -s blender-2.81 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/blender/install.size echo "ULFS package installation completed." #Producing files list echo "Looking for installed files..." if [ -f /var/log/ulfs-packages/blender/files.txt ]; then rm /var/log/ulfs-packages/blender/files.txt fi USER=`whoami` if [ "$USER" == "root" ] ; then find /bin -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt find /sbin -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt find /usr -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt find /etc -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt find /opt -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt find /lib -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt find /lib64 -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt find /var -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time \! -path "/var/log/ulfs-packages/blender/*" >> /var/log/ulfs-packages/blender/files.txt else sudo find /bin -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt sudo find /sbin -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt sudo find /usr -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt sudo find /etc -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt sudo find /opt -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt sudo find /lib -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt sudo find /lib64 -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time >> /var/log/ulfs-packages/blender/files.txt sudo find /var -type f -newer /var/log/ulfs-packages/blender/configure.time \! -newer /var/log/ulfs-packages/blender/finish.time \! -path "/var/log/ulfs-packages/blender/*" >> /var/log/ulfs-packages/blender/files.txt fi #Marking package as installed... mkdir -p /var/cache/ulfs-packages USER=`whoami` if [ "$USER" == "root" ] ; then touch /var/cache/ulfs-packages/blender else sudo touch /var/cache/ulfs-packages/blender fi #Calculate delta size a=`cat /var/log/ulfs-packages/blender/unpack.size` b=`cat /var/log/ulfs-packages/blender/install.size` c=$(($b-$a)) echo $c > /var/log/ulfs-packages/blender/delta.size #Calculate prepare time a=`cat /var/log/ulfs-packages/blender/start.time` b=`cat /var/log/ulfs-packages/blender/configure.time` dp=$(($b-$a)) #Calculate download time a=`cat /var/log/ulfs-packages/blender/download.time` b=`cat /var/log/ulfs-packages/blender/unpack.time` dd=$(($b-$a)) #Calculate delta time a=`cat /var/log/ulfs-packages/blender/configure.time` b=`cat /var/log/ulfs-packages/blender/finish.time` db=$(($b-$a)) echo $db > /var/log/ulfs-packages/blender/delta.time #Report echo "" echo "ULFS Package installation report" echo "================================" echo "Package: blender" echo "Release: 0.1" echo "Build size: $c" echo "Prepare time: $dp sec." echo "Download time: $dd sec." echo "Build time: $db sec." #End of script