#!/bin/bash #=========================== # UMVIRT LINUX FROM SCRATCH #=========================== # Compilation script. # Network mode. #=========================== # Release: 0.2.2 # Package: MPlayer #=========================== # DB commit: 48bb9ee31306c82c48dfaaad707eb4f6a926eb8a # APP commit: 1ca4178aea919e4c9e869e3d650ff8af9678bd6f #=========================== echo "ULFS Package installation start" echo "===============================" echo "Package: MPlayer" 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/MPlayer/ #Saving start timestamp date +%s > /var/log/ulfs-packages/MPlayer/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 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 yasm... if [ ! -f /var/cache/ulfs-packages/yasm ]; then echo "Dependance \"yasm\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/yasm/install -O - | bash if [ ! -f /var/cache/ulfs-packages/yasm ]; then echo "Dependance \"yasm\" is not installed. Exiting..." exit fi fi #Checking cdparanoia-III... if [ ! -f /var/cache/ulfs-packages/cdparanoia-III ]; then echo "Dependance \"cdparanoia-III\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/cdparanoia-III/install -O - | bash if [ ! -f /var/cache/ulfs-packages/cdparanoia-III ]; then echo "Dependance \"cdparanoia-III\" 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..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libvorbis/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libvorbis ]; then echo "Dependance \"libvorbis\" is not installed. Exiting..." exit fi fi #Checking libtheora... if [ ! -f /var/cache/ulfs-packages/libtheora ]; then echo "Dependance \"libtheora\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libtheora/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libtheora ]; then echo "Dependance \"libtheora\" 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..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libdvdread/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libdvdread ]; then echo "Dependance \"libdvdread\" is not installed. Exiting..." exit fi fi #Checking libdvdnav... if [ ! -f /var/cache/ulfs-packages/libdvdnav ]; then echo "Dependance \"libdvdnav\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libdvdnav/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libdvdnav ]; then echo "Dependance \"libdvdnav\" 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 giflib... if [ ! -f /var/cache/ulfs-packages/giflib ]; then echo "Dependance \"giflib\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/giflib/install -O - | bash if [ ! -f /var/cache/ulfs-packages/giflib ]; then echo "Dependance \"giflib\" 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..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/lame/install -O - | bash if [ ! -f /var/cache/ulfs-packages/lame ]; then echo "Dependance \"lame\" is not installed. Exiting..." exit fi fi #Checking x264... if [ ! -f /var/cache/ulfs-packages/x264 ]; then echo "Dependance \"x264\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/x264/install -O - | bash if [ ! -f /var/cache/ulfs-packages/x264 ]; then echo "Dependance \"x264\" is not installed. Exiting..." exit fi fi #Checking libvdpau... if [ ! -f /var/cache/ulfs-packages/libvdpau ]; then echo "Dependance \"libvdpau\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libvdpau/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libvdpau ]; then echo "Dependance \"libvdpau\" is not installed. Exiting..." exit fi fi #Checking libvpx... if [ ! -f /var/cache/ulfs-packages/libvpx ]; then echo "Dependance \"libvpx\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libvpx/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libvpx ]; then echo "Dependance \"libvpx\" is not installed. Exiting..." exit fi fi #Checking mpg123... if [ ! -f /var/cache/ulfs-packages/mpg123 ]; then echo "Dependance \"mpg123\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/mpg123/install -O - | bash if [ ! -f /var/cache/ulfs-packages/mpg123 ]; then echo "Dependance \"mpg123\" is not installed. Exiting..." exit fi fi #Checking speex... if [ ! -f /var/cache/ulfs-packages/speex ]; then echo "Dependance \"speex\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/speex/install -O - | bash if [ ! -f /var/cache/ulfs-packages/speex ]; then echo "Dependance \"speex\" is not installed. Exiting..." exit fi fi #Checking pulseaudio... if [ ! -f /var/cache/ulfs-packages/pulseaudio ]; then echo "Dependance \"pulseaudio\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/pulseaudio/install -O - | bash if [ ! -f /var/cache/ulfs-packages/pulseaudio ]; then echo "Dependance \"pulseaudio\" is not installed. Exiting..." exit fi fi #Checking libcdio... if [ ! -f /var/cache/ulfs-packages/libcdio ]; then echo "Dependance \"libcdio\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libcdio/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libcdio ]; then echo "Dependance \"libcdio\" is not installed. Exiting..." exit fi fi #Checking samba... if [ ! -f /var/cache/ulfs-packages/samba ]; then echo "Dependance \"samba\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/samba/install -O - | bash if [ ! -f /var/cache/ulfs-packages/samba ]; then echo "Dependance \"samba\" is not installed. Exiting..." exit fi fi #Checking ALSA... if [ ! -f /var/cache/ulfs-packages/ALSA ]; then echo "Dependance \"ALSA\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/ALSA/install -O - | bash if [ ! -f /var/cache/ulfs-packages/ALSA ]; then echo "Dependance \"ALSA\" is not installed. Exiting..." exit fi fi #Checking lzo... if [ ! -f /var/cache/ulfs-packages/lzo ]; then echo "Dependance \"lzo\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/lzo/install -O - | bash if [ ! -f /var/cache/ulfs-packages/lzo ]; then echo "Dependance \"lzo\" is not installed. Exiting..." exit fi fi #Checking a52dec... if [ ! -f /var/cache/ulfs-packages/a52dec ]; then echo "Dependance \"a52dec\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/a52dec/install -O - | bash if [ ! -f /var/cache/ulfs-packages/a52dec ]; then echo "Dependance \"a52dec\" 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..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libmad/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libmad ]; then echo "Dependance \"libmad\" is not installed. Exiting..." exit fi fi #Checking libdv... if [ ! -f /var/cache/ulfs-packages/libdv ]; then echo "Dependance \"libdv\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libdv/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libdv ]; then echo "Dependance \"libdv\" is not installed. Exiting..." exit fi fi #Checking libdvdcss... if [ ! -f /var/cache/ulfs-packages/libdvdcss ]; then echo "Dependance \"libdvdcss\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libdvdcss/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libdvdcss ]; then echo "Dependance \"libdvdcss\" is not installed. Exiting..." exit fi fi #Checking faad2... if [ ! -f /var/cache/ulfs-packages/faad2 ]; then echo "Dependance \"faad2\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/faad2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/faad2 ]; then echo "Dependance \"faad2\" is not installed. Exiting..." exit fi fi #Checking libmpeg2... if [ ! -f /var/cache/ulfs-packages/libmpeg2 ]; then echo "Dependance \"libmpeg2\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libmpeg2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libmpeg2 ]; then echo "Dependance \"libmpeg2\" is not installed. Exiting..." exit fi fi #Checking aalib... if [ ! -f /var/cache/ulfs-packages/aalib ]; then echo "Dependance \"aalib\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/aalib/install -O - | bash if [ ! -f /var/cache/ulfs-packages/aalib ]; then echo "Dependance \"aalib\" is not installed. Exiting..." exit fi fi #Checking libmng... if [ ! -f /var/cache/ulfs-packages/libmng ]; then echo "Dependance \"libmng\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libmng/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libmng ]; then echo "Dependance \"libmng\" is not installed. Exiting..." exit fi fi #Checking faac... if [ ! -f /var/cache/ulfs-packages/faac ]; then echo "Dependance \"faac\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/faac/install -O - | bash if [ ! -f /var/cache/ulfs-packages/faac ]; then echo "Dependance \"faac\" is not installed. Exiting..." exit fi fi #Checking xvidcore... if [ ! -f /var/cache/ulfs-packages/xvidcore ]; then echo "Dependance \"xvidcore\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/xvidcore/install -O - | bash if [ ! -f /var/cache/ulfs-packages/xvidcore ]; then echo "Dependance \"xvidcore\" is not installed. Exiting..." exit fi fi #Saving downloading timestamp date +%s > /var/log/ulfs-packages/MPlayer/download.time #Downloading source package archive... wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/packages/m/MPlayer-1.5.tar.xz.md5sum wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/packages/m/MPlayer-1.5.tar.xz #Checking source package file existance if [ ! -f MPlayer-1.5.tar.xz ]; then echo "Error: Can't find MPlayer-1.5.tar.xz. Exiting!" exit fi #Checking source package file checksum if [ -f MPlayer-1.5.tar.xz.md5sum ]; then MD5=`LANG=C md5sum -c MPlayer-1.5.tar.xz.md5sum | grep OK` if [ "$MD5" == "" ] ; then echo "Error: Checksum of MPlayer-1.5.tar.xz is wrong. Exiting!" exit fi fi #Downloadning add-ons... #Downloadning add-on "Clearlooks-2.0.tar.bz2"... wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/packages/c/Clearlooks-2.0.tar.bz2.md5sum wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/packages/c/Clearlooks-2.0.tar.bz2 #Checking addon file existance if [ ! -f Clearlooks-2.0.tar.bz2 ]; then echo "Error: Can't find Clearlooks-2.0.tar.bz2. Exiting!" exit fi #Checking add-on file checksum if [ -f Clearlooks-2.0.tar.bz2.md5sum ]; then MD5=`LANG=C md5sum -c Clearlooks-2.0.tar.bz2.md5sum | grep OK` if [ "$MD5" == "" ] ; then echo "Error: Checksum of Clearlooks-2.0.tar.bz2 is wrong. Exiting!" exit fi fi #Downloadning patches... wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/patches/MPlayer-1.5-upstream_ffmpg6_fixes-1.patch #Downloadning patches... wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/patches/mplayer-ffmpeg-6.0-binutils_2.41-1.patch #Saving cleanup timestamp date +%s > /var/log/ulfs-packages/MPlayer/cleanup.time rm -rfv /sources/MPlayer-1.5/ #Saving extracting timestamp date +%s > /var/log/ulfs-packages/MPlayer/unpack.time #Extracting tar source package archive with default parameters... tar -xf MPlayer-1.5.tar.xz #Checking package directory size after unpack... du -s MPlayer-1.5 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/MPlayer/unpack.size #Going to source package directory... cd MPlayer-1.5 #Applying patches... patch -Np1 -i ../MPlayer-1.5-upstream_ffmpg6_fixes-1.patch patch -Np1 -i ../mplayer-ffmpeg-6.0-binutils_2.41-1.patch #Saving configuration timestamp date +%s > /var/log/ulfs-packages/MPlayer/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/MPlayer-1.5 \! -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 -Wno-error=int-conversion" export CFLAGS ./configure --prefix=/usr \\ --confdir=/etc/mplayer \\ --enable-dynamic-plugins \\ --disable-libmpeg2-internal \\ --enable-menu \\ --enable-runtime-cpudetection \\ --enable-gui EOIS cat ulfs_configure.sh | bash 2>&1 | tee /var/log/ulfs-packages/MPlayer/configure.log #Saving build timestamp date +%s > /var/log/ulfs-packages/MPlayer/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_DOCUMENTATION" == "YES" ]] then make doc fi EOIS cat ulfs_build.sh | bash 2>&1 | tee /var/log/ulfs-packages/MPlayer/build.log #Saving install timestamp date +%s > /var/log/ulfs-packages/MPlayer/install.time #Running install script... cat > ulfs_install.sh << EOIS make install && ln -svf ../icons/hicolor/48x48/apps/mplayer.png \ /usr/share/pixmaps/mplayer.png if [[ "\$ULFS_PKG_DOCUMENTATION" == "YES" ]] then install -v -m755 -d /usr/share/doc/mplayer-1.5 && install -v -m644 DOCS/HTML/en/* \ /usr/share/doc/mplayer-1.5 fi install -v -m644 etc/codecs.conf /etc/mplayer install -v -m644 etc/*.conf /etc/mplayer tar -xvf ../Clearlooks-2.0.tar.bz2 \ -C /usr/share/mplayer/skins && ln -sfvn Clearlooks /usr/share/mplayer/skins/default 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/MPlayer/install.log else cat ulfs_install.sh | sudo bash 2>&1 | tee /var/log/ulfs-packages/MPlayer/install.log fi #Saving finish timestamp date +%s > /var/log/ulfs-packages/MPlayer/finish.time #Checking package directory size after unpack... cd /sources du -s MPlayer-1.5 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/MPlayer/install.size echo "ULFS package installation completed." #Producing files list echo "Looking for installed files..." if [ -f /var/log/ulfs-packages/MPlayer/files.txt ]; then rm /var/log/ulfs-packages/MPlayer/files.txt fi USER=`whoami` if [ "$USER" == "root" ] ; then find /bin -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt find /sbin -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt find /usr -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt find /etc -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt find /opt -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt find /lib -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt find /lib64 -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt find /var -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time \! -path "/var/log/ulfs-packages/MPlayer/*" >> /var/log/ulfs-packages/MPlayer/files.txt else sudo find /bin -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt sudo find /sbin -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt sudo find /usr -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt sudo find /etc -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt sudo find /opt -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt sudo find /lib -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt sudo find /lib64 -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time >> /var/log/ulfs-packages/MPlayer/files.txt sudo find /var -type f -newer /var/log/ulfs-packages/MPlayer/configure.time \! -newer /var/log/ulfs-packages/MPlayer/finish.time \! -path "/var/log/ulfs-packages/MPlayer/*" >> /var/log/ulfs-packages/MPlayer/files.txt fi #Marking package as installed... mkdir -p /var/cache/ulfs-packages USER=`whoami` if [ "$USER" == "root" ] ; then touch /var/cache/ulfs-packages/MPlayer else sudo touch /var/cache/ulfs-packages/MPlayer fi #Calculate delta size a=`cat /var/log/ulfs-packages/MPlayer/unpack.size` b=`cat /var/log/ulfs-packages/MPlayer/install.size` c=$(($b-$a)) echo $c > /var/log/ulfs-packages/MPlayer/delta.size #Calculate prepare time a=`cat /var/log/ulfs-packages/MPlayer/start.time` b=`cat /var/log/ulfs-packages/MPlayer/configure.time` dp=$(($b-$a)) #Calculate download time a=`cat /var/log/ulfs-packages/MPlayer/download.time` b=`cat /var/log/ulfs-packages/MPlayer/unpack.time` dd=$(($b-$a)) #Calculate delta time a=`cat /var/log/ulfs-packages/MPlayer/configure.time` b=`cat /var/log/ulfs-packages/MPlayer/finish.time` db=$(($b-$a)) echo $db > /var/log/ulfs-packages/MPlayer/delta.time #Report echo "" echo "ULFS Package installation report" echo "================================" echo "Package: MPlayer" 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