#!/bin/bash #=========================== # UMVIRT LINUX FROM SCRATCH #=========================== # Compilation script. # Network mode. #=========================== # Release: 0.2.3 # Package: seahorse #=========================== # DB commit: f64c98382982c764c3ba140bfcbbc73d93096acd # APP commit: e09dc78145b10de9481608254eb2ac99efd0068b #=========================== echo "ULFS Package installation start" echo "===============================" echo "Package: seahorse" 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/seahorse/ #Saving start timestamp date +%s > /var/log/ulfs-packages/seahorse/start.time #Going to source directory... cd /sources #Checking dependances... #Checking openssh... if [ ! -f /var/cache/ulfs-packages/openssh ]; then echo "Dependance \"openssh\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/openssh/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/openssh/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/openssh ]; then echo "Dependance \"openssh\" is not installed. Exiting..." exit fi fi #Checking vala... if [ ! -f /var/cache/ulfs-packages/vala ]; then echo "Dependance \"vala\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/vala/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/vala/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/vala ]; then echo "Dependance \"vala\" is not installed. Exiting..." exit fi fi #Checking itstool... if [ ! -f /var/cache/ulfs-packages/itstool ]; then echo "Dependance \"itstool\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/itstool/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/itstool/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/itstool ]; then echo "Dependance \"itstool\" is not installed. Exiting..." exit fi fi #Checking libsecret... if [ ! -f /var/cache/ulfs-packages/libsecret ]; then echo "Dependance \"libsecret\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/libsecret/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/libsecret/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libsecret ]; then echo "Dependance \"libsecret\" is not installed. Exiting..." exit fi fi #Checking gnupg... if [ ! -f /var/cache/ulfs-packages/gnupg ]; then echo "Dependance \"gnupg\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/gnupg/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/gnupg/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/gnupg ]; then echo "Dependance \"gnupg\" is not installed. Exiting..." exit fi fi #Checking gcr3... if [ ! -f /var/cache/ulfs-packages/gcr3 ]; then echo "Dependance \"gcr3\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/gcr3/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/gcr3/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/gcr3 ]; then echo "Dependance \"gcr3\" is not installed. Exiting..." exit fi fi #Checking libsoup3... if [ ! -f /var/cache/ulfs-packages/libsoup3 ]; then echo "Dependance \"libsoup3\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/libsoup3/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/libsoup3/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libsoup3 ]; then echo "Dependance \"libsoup3\" is not installed. Exiting..." exit fi fi #Checking avahi... if [ ! -f /var/cache/ulfs-packages/avahi ]; then echo "Dependance \"avahi\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/avahi/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/avahi/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/avahi ]; then echo "Dependance \"avahi\" is not installed. Exiting..." exit fi fi #Checking libhandy... if [ ! -f /var/cache/ulfs-packages/libhandy ]; then echo "Dependance \"libhandy\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/libhandy/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/libhandy/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libhandy ]; then echo "Dependance \"libhandy\" is not installed. Exiting..." exit fi fi #Checking gnome-keyring... if [ ! -f /var/cache/ulfs-packages/gnome-keyring ]; then echo "Dependance \"gnome-keyring\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/gnome-keyring/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/gnome-keyring/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/gnome-keyring ]; then echo "Dependance \"gnome-keyring\" is not installed. Exiting..." exit fi fi #Checking libpwquality... if [ ! -f /var/cache/ulfs-packages/libpwquality ]; then echo "Dependance \"libpwquality\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/libpwquality/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/libpwquality/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libpwquality ]; then echo "Dependance \"libpwquality\" is not installed. Exiting..." exit fi fi #Checking gpgme... if [ ! -f /var/cache/ulfs-packages/gpgme ]; then echo "Dependance \"gpgme\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.2.3/gpgme/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.2.3/gpgme/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/gpgme ]; then echo "Dependance \"gpgme\" is not installed. Exiting..." exit fi fi #Saving downloading timestamp date +%s > /var/log/ulfs-packages/seahorse/download.time #Downloading source package archive... downloadFile https://umvirt.com/linux/downloads/0.2.3/packages/s/seahorse-47.0.1.tar.xz.md5sum downloadFile https://umvirt.com/linux/downloads/0.2.3/packages/s/seahorse-47.0.1.tar.xz #Checking source package file existance if [ ! -f seahorse-47.0.1.tar.xz ]; then echo "Error: Can't find seahorse-47.0.1.tar.xz. Exiting!" exit fi #Checking source package file checksum if [ -f seahorse-47.0.1.tar.xz.md5sum ]; then MD5=`LANG=C md5sum -c seahorse-47.0.1.tar.xz.md5sum | grep OK` if [ "$MD5" == "" ] ; then echo "Error: Checksum of seahorse-47.0.1.tar.xz is wrong. Exiting!" exit fi fi #Saving cleanup timestamp date +%s > /var/log/ulfs-packages/seahorse/cleanup.time rm -rfv /sources/seahorse-47.0.1/ #Saving extracting timestamp date +%s > /var/log/ulfs-packages/seahorse/unpack.time #Extracting tar source package archive with default parameters... tar -xf seahorse-47.0.1.tar.xz #Checking package directory size after unpack... du -s seahorse-47.0.1 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/seahorse/unpack.size #Going to source package directory... cd seahorse-47.0.1 #Saving configuration timestamp date +%s > /var/log/ulfs-packages/seahorse/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/seahorse-47.0.1 \! -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 sed -i -r 's:"(/apps):"/org/gnome\\1:' data/*.xml && mkdir build && cd build && meson setup --prefix=/usr --buildtype=release .. EOIS cat ulfs_configure.sh | bash 2>&1 | tee /var/log/ulfs-packages/seahorse/configure.log #Saving build timestamp date +%s > /var/log/ulfs-packages/seahorse/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 ninja EOIS cat ulfs_build.sh | bash 2>&1 | tee /var/log/ulfs-packages/seahorse/build.log #Saving install timestamp date +%s > /var/log/ulfs-packages/seahorse/install.time #Running install script... cat > ulfs_install.sh << EOIS cd build ninja 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/seahorse/install.log else cat ulfs_install.sh | sudo bash 2>&1 | tee /var/log/ulfs-packages/seahorse/install.log fi #Saving finish timestamp date +%s > /var/log/ulfs-packages/seahorse/finish.time #Checking package directory size after unpack... cd /sources du -s seahorse-47.0.1 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/seahorse/install.size echo "ULFS package installation completed." #Producing files list echo "Looking for installed files..." if [ -f /var/log/ulfs-packages/seahorse/files.txt ]; then rm /var/log/ulfs-packages/seahorse/files.txt fi USER=`whoami` if [ "$USER" == "root" ] ; then find /bin -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time >> /var/log/ulfs-packages/seahorse/files.txt find /sbin -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time >> /var/log/ulfs-packages/seahorse/files.txt find /usr -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time >> /var/log/ulfs-packages/seahorse/files.txt find /etc -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time \! -path /etc/ld.so.cache >> /var/log/ulfs-packages/seahorse/files.txt find /opt -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time >> /var/log/ulfs-packages/seahorse/files.txt find /lib -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time >> /var/log/ulfs-packages/seahorse/files.txt find /lib64 -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time >> /var/log/ulfs-packages/seahorse/files.txt find /var -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time \! -path "/var/log/ulfs-packages/seahorse/*" \! -path /var/cache/ldconfig/aux-cache >> /var/log/ulfs-packages/seahorse/files.txt else sudo find /bin -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time >> /var/log/ulfs-packages/seahorse/files.txt sudo find /sbin -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time >> /var/log/ulfs-packages/seahorse/files.txt sudo find /usr -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time >> /var/log/ulfs-packages/seahorse/files.txt sudo find /etc -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time \! -path /etc/ld.so.cache >> /var/log/ulfs-packages/seahorse/files.txt sudo find /opt -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time >> /var/log/ulfs-packages/seahorse/files.txt sudo find /lib -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time >> /var/log/ulfs-packages/seahorse/files.txt sudo find /lib64 -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time >> /var/log/ulfs-packages/seahorse/files.txt sudo find /var -type f -newer /var/log/ulfs-packages/seahorse/configure.time \! -newer /var/log/ulfs-packages/seahorse/finish.time \! -path "/var/log/ulfs-packages/seahorse/*" \! -path /var/cache/ldconfig/aux-cache >> /var/log/ulfs-packages/seahorse/files.txt fi #Marking package as installed... mkdir -p /var/cache/ulfs-packages USER=`whoami` if [ "$USER" == "root" ] ; then touch /var/cache/ulfs-packages/seahorse else sudo touch /var/cache/ulfs-packages/seahorse fi #Calculate delta size a=`cat /var/log/ulfs-packages/seahorse/unpack.size` b=`cat /var/log/ulfs-packages/seahorse/install.size` c=$(($b-$a)) echo $c > /var/log/ulfs-packages/seahorse/delta.size #Calculate prepare time a=`cat /var/log/ulfs-packages/seahorse/start.time` b=`cat /var/log/ulfs-packages/seahorse/configure.time` dp=$(($b-$a)) #Calculate download time a=`cat /var/log/ulfs-packages/seahorse/download.time` b=`cat /var/log/ulfs-packages/seahorse/unpack.time` dd=$(($b-$a)) #Calculate delta time a=`cat /var/log/ulfs-packages/seahorse/configure.time` b=`cat /var/log/ulfs-packages/seahorse/finish.time` db=$(($b-$a)) echo $db > /var/log/ulfs-packages/seahorse/delta.time #Report echo "" echo "ULFS Package installation report" echo "================================" echo "Package: seahorse" 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