#!/bin/bash #=========================== # UMVIRT LINUX FROM SCRATCH #=========================== # Compilation script. # Network mode. #=========================== # Release: 0.2.3 # Package: k3b #=========================== # DB commit: f64c98382982c764c3ba140bfcbbc73d93096acd # APP commit: e09dc78145b10de9481608254eb2ac99efd0068b #=========================== echo "ULFS Package installation start" echo "===============================" echo "Package: k3b" echo "Release: 0.2.3" downloadFile() { local filename=$1 echo "Downloading $filename ..." if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl -k -O $filename else wget --no-check-certificate -nc $filename fi } echo "loading environment settings(profile)" . /etc/profile 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/k3b/ #Saving start timestamp date +%s > /var/log/ulfs-packages/k3b/start.time #Going to source directory... cd /sources #Checking dependances... #Checking libburn... if [ ! -f /var/cache/ulfs-packages/libburn ]; then echo "Dependance \"libburn\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/libburn/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/libburn/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libburn ]; then echo "Dependance \"libburn\" is not installed. Exiting..." exit fi fi #Checking cdrtools... if [ ! -f /var/cache/ulfs-packages/cdrtools ]; then echo "Dependance \"cdrtools\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/cdrtools/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/cdrtools/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/cdrtools ]; then echo "Dependance \"cdrtools\" is not installed. Exiting..." exit fi fi #Checking dvdrw-tools... if [ ! -f /var/cache/ulfs-packages/dvdrw-tools ]; then echo "Dependance \"dvdrw-tools\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/dvdrw-tools/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/dvdrw-tools/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/dvdrw-tools ]; then echo "Dependance \"dvdrw-tools\" is not installed. Exiting..." exit fi fi #Checking shared-mime-info... if [ ! -f /var/cache/ulfs-packages/shared-mime-info ]; then echo "Dependance \"shared-mime-info\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/shared-mime-info/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/shared-mime-info/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/shared-mime-info ]; then echo "Dependance \"shared-mime-info\" is not installed. Exiting..." exit fi fi #Checking libvorbis... if [ ! -f /var/cache/ulfs-packages/libvorbis ]; then echo "Dependance \"libvorbis\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/libvorbis/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/libvorbis/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libvorbis ]; then echo "Dependance \"libvorbis\" is not installed. Exiting..." exit fi fi #Checking libdvdread... if [ ! -f /var/cache/ulfs-packages/libdvdread ]; then echo "Dependance \"libdvdread\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/libdvdread/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/libdvdread/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libdvdread ]; then echo "Dependance \"libdvdread\" 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/ffmpeg/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/ffmpeg/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/ffmpeg ]; then echo "Dependance \"ffmpeg\" is not installed. Exiting..." exit fi fi #Checking lame... if [ ! -f /var/cache/ulfs-packages/lame ]; then echo "Dependance \"lame\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/lame/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/lame/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/lame ]; then echo "Dependance \"lame\" is not installed. Exiting..." exit fi fi #Checking flac... if [ ! -f /var/cache/ulfs-packages/flac ]; then echo "Dependance \"flac\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/flac/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/flac/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/flac ]; then echo "Dependance \"flac\" is not installed. Exiting..." exit fi fi #Checking libsndfile... if [ ! -f /var/cache/ulfs-packages/libsndfile ]; then echo "Dependance \"libsndfile\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/libsndfile/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/libsndfile/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libsndfile ]; then echo "Dependance \"libsndfile\" is not installed. Exiting..." exit fi fi #Checking udisks... if [ ! -f /var/cache/ulfs-packages/udisks ]; then echo "Dependance \"udisks\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/udisks/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/udisks/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/udisks ]; then echo "Dependance \"udisks\" is not installed. Exiting..." exit fi fi #Checking libmad... if [ ! -f /var/cache/ulfs-packages/libmad ]; then echo "Dependance \"libmad\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/libmad/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/libmad/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libmad ]; then echo "Dependance \"libmad\" is not installed. Exiting..." exit fi fi #Checking libsamplerate... if [ ! -f /var/cache/ulfs-packages/libsamplerate ]; then echo "Dependance \"libsamplerate\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/libsamplerate/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/libsamplerate/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libsamplerate ]; then echo "Dependance \"libsamplerate\" is not installed. Exiting..." exit fi fi #Checking taglib... if [ ! -f /var/cache/ulfs-packages/taglib ]; then echo "Dependance \"taglib\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/taglib/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/taglib/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/taglib ]; then echo "Dependance \"taglib\" is not installed. Exiting..." exit fi fi #Checking cdrdao... if [ ! -f /var/cache/ulfs-packages/cdrdao ]; then echo "Dependance \"cdrdao\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/cdrdao/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/cdrdao/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/cdrdao ]; then echo "Dependance \"cdrdao\" is not installed. Exiting..." exit fi fi #Checking KF6... if [ ! -f /var/cache/ulfs-packages/KF6 ]; then echo "Dependance \"KF6\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/KF6/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/KF6/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/KF6 ]; then echo "Dependance \"KF6\" is not installed. Exiting..." exit fi fi #Checking libkcddb... if [ ! -f /var/cache/ulfs-packages/libkcddb ]; then echo "Dependance \"libkcddb\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/libkcddb/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/libkcddb/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libkcddb ]; then echo "Dependance \"libkcddb\" is not installed. Exiting..." exit fi fi #Saving downloading timestamp date +%s > /var/log/ulfs-packages/k3b/download.time #Downloading source package archive... downloadFile https://umvirt.com/linux/downloads/0.2.3/packages/kde/apps/k3b-24.12.2.tar.xz.md5sum downloadFile https://umvirt.com/linux/downloads/0.2.3/packages/kde/apps/k3b-24.12.2.tar.xz #Checking source package file existance if [ ! -f k3b-24.12.2.tar.xz ]; then echo "Error: Can't find k3b-24.12.2.tar.xz. Exiting!" exit fi #Checking source package file checksum if [ -f k3b-24.12.2.tar.xz.md5sum ]; then MD5=`LANG=C md5sum -c k3b-24.12.2.tar.xz.md5sum | grep OK` if [ "$MD5" == "" ] ; then echo "Error: Checksum of k3b-24.12.2.tar.xz is wrong. Exiting!" exit fi fi #Saving cleanup timestamp date +%s > /var/log/ulfs-packages/k3b/cleanup.time rm -rfv /sources/k3b-24.12.2/ #Saving extracting timestamp date +%s > /var/log/ulfs-packages/k3b/unpack.time #Extracting tar source package archive with default parameters... tar -xf k3b-24.12.2.tar.xz #Checking package directory size after unpack... du -s k3b-24.12.2 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/k3b/unpack.size #Going to source package directory... cd k3b-24.12.2 #Saving configuration timestamp date +%s > /var/log/ulfs-packages/k3b/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/k3b-24.12.2 \! -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 "loading environment settings(profile)" . /etc/profile 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 mkdir build && cd build && cmake -D CMAKE_INSTALL_PREFIX=\$KF6_PREFIX \\ -D CMAKE_BUILD_TYPE=Release \\ -D BUILD_TESTING=OFF \\ -W no-dev .. EOIS cat ulfs_configure.sh | bash 2>&1 | tee /var/log/ulfs-packages/k3b/configure.log #Saving build timestamp date +%s > /var/log/ulfs-packages/k3b/build.time #Running build script... echo "loading environment settings(profile)" . /etc/profile 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 cd build make EOIS cat ulfs_build.sh | bash 2>&1 | tee /var/log/ulfs-packages/k3b/build.log #Saving install timestamp date +%s > /var/log/ulfs-packages/k3b/install.time #Running install script... cat > ulfs_install.sh << EOIS cd build make install EOIS echo "/sbin/ldconfig" >> ulfs_install.sh USER=`whoami` if [ "$USER" == "root" ] ; then cat ulfs_install.sh | bash 2>&1 | tee /var/log/ulfs-packages/k3b/install.log else cat ulfs_install.sh | sudo bash 2>&1 | tee /var/log/ulfs-packages/k3b/install.log fi #Saving finish timestamp date +%s > /var/log/ulfs-packages/k3b/finish.time #Checking package directory size after unpack... cd /sources du -s k3b-24.12.2 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/k3b/install.size echo "ULFS package installation completed." #Producing files list echo "Looking for installed files..." if [ -f /var/log/ulfs-packages/k3b/files.txt ]; then rm /var/log/ulfs-packages/k3b/files.txt fi USER=`whoami` if [ "$USER" == "root" ] ; then find /bin -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time >> /var/log/ulfs-packages/k3b/files.txt find /sbin -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time >> /var/log/ulfs-packages/k3b/files.txt find /usr -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time >> /var/log/ulfs-packages/k3b/files.txt find /etc -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time \! -path /etc/ld.so.cache >> /var/log/ulfs-packages/k3b/files.txt find /opt -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time >> /var/log/ulfs-packages/k3b/files.txt find /lib -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time >> /var/log/ulfs-packages/k3b/files.txt find /lib64 -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time >> /var/log/ulfs-packages/k3b/files.txt find /var -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time \! -path "/var/log/ulfs-packages/k3b/*" \! -path /var/cache/ldconfig/aux-cache >> /var/log/ulfs-packages/k3b/files.txt else sudo find /bin -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time >> /var/log/ulfs-packages/k3b/files.txt sudo find /sbin -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time >> /var/log/ulfs-packages/k3b/files.txt sudo find /usr -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time >> /var/log/ulfs-packages/k3b/files.txt sudo find /etc -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time \! -path /etc/ld.so.cache >> /var/log/ulfs-packages/k3b/files.txt sudo find /opt -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time >> /var/log/ulfs-packages/k3b/files.txt sudo find /lib -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time >> /var/log/ulfs-packages/k3b/files.txt sudo find /lib64 -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time >> /var/log/ulfs-packages/k3b/files.txt sudo find /var -type f -newer /var/log/ulfs-packages/k3b/configure.time \! -newer /var/log/ulfs-packages/k3b/finish.time \! -path "/var/log/ulfs-packages/k3b/*" \! -path /var/cache/ldconfig/aux-cache >> /var/log/ulfs-packages/k3b/files.txt fi #Marking package as installed... mkdir -p /var/cache/ulfs-packages USER=`whoami` if [ "$USER" == "root" ] ; then touch /var/cache/ulfs-packages/k3b else sudo touch /var/cache/ulfs-packages/k3b fi #Calculate delta size a=`cat /var/log/ulfs-packages/k3b/unpack.size` b=`cat /var/log/ulfs-packages/k3b/install.size` c=$(($b-$a)) echo $c > /var/log/ulfs-packages/k3b/delta.size #Calculate prepare time a=`cat /var/log/ulfs-packages/k3b/start.time` b=`cat /var/log/ulfs-packages/k3b/configure.time` dp=$(($b-$a)) #Calculate download time a=`cat /var/log/ulfs-packages/k3b/download.time` b=`cat /var/log/ulfs-packages/k3b/unpack.time` dd=$(($b-$a)) #Calculate delta time a=`cat /var/log/ulfs-packages/k3b/configure.time` b=`cat /var/log/ulfs-packages/k3b/finish.time` db=$(($b-$a)) echo $db > /var/log/ulfs-packages/k3b/delta.time #Report echo "" echo "ULFS Package installation report" echo "================================" echo "Package: k3b" echo "Release: 0.2.3" echo "Build size: $c" echo "Prepare time: $dp sec." echo "Download time: $dd sec." echo "Build time: $db sec." #End of script