#!/bin/bash # packager : Frederic Boulet bipbiponlinux~AT~gmail.com # source location : http://decibel.silent-blade.org/uploads/Main/decibel-audio-player-1.02.tar.gz # last revised : 3.12.2009 softname='decibel-audio-player' softversion='1.02' packageversion='1fb' arch='i486' cpu='i686' prefix=/usr # log ;) ( # # building-computer dependent: the number of parallel 'jobs' of 'make' # # "big" PC: 6 compilation at same time # # numjobs='-j6' # # "light" PC: 2 compilation at same time # numjobs='-j2' # parameters needed for the build process buildir=$(pwd) src="$buildir/$softname-$softversion" srcpkg="$buildir/$softname-$softversion.tar.gz" package="$softname-$softversion-$arch-$packageversion" dest="$buildir/$package" source=http://decibel.silent-blade.org/uploads/Main/$softname-$softversion.tar.gz # prepare the build result directory rm -rf $dest mkdir -p $dest mkdir -p $dest/install mkdir -p $dest/$prefix/bin mkdir -p $dest/usr/share/applications mkdir -p $dest/usr/share/icons/hicolor/48x48/apps mkdir -p $dest/usr/doc mkdir -p $dest/usr/src/$softname-$softversion # Slack-desc cat < $dest/install/slack-desc |-----handy-ruler------------------------------------------------------| decibel-audio-player: decibel-audio-player (Audio player) decibel-audio-player: decibel-audio-player: Decibel Audio Player is a GTK+ open-source (GPL license) audio player decibel-audio-player: designed for GNU/Linux, which aims at being very straightforward to decibel-audio-player: use by mean of a very clean and user friendly interface. It aims also decibel-audio-player: at being a real audio player and, as such, it does not include decibel-audio-player: features that are not meant to be part of an audio player. If you're decibel-audio-player: looking for an audio player than can also make coffee, then you should decibel-audio-player: stay away from Decibel and give a try to other players (e.g., Amarok, decibel-audio-player: Exaile). decibel-audio-player: EOF # check if source is present if [ -f $softname"_w_fonts"-$softversion.tar.gz ]; then echo "Source file already here, no need to download"; else echo "Downloading source" wget -c --no-check-certificate $source fi # extract the source code cd $buildir tar xzvf $srcpkg cd $src # build export prefix=/usr make install DESTDIR=$dest # make the .desktop file cat << "EOF" > $dest/usr/share/applications/$softname.desktop [Desktop Entry] Name=Decibel Audio Player Name[de]=Decibel Audio Player Name[nn]=Desibel Ljudavspelar Name[no]=Desibel Lydavspiller GenericName=Audio Player GenericName[de]=Musikwiedergabe GenericName[nn]=Musikkavspelar GenericName[no]=Musikkavspiller Comment=A simple audio player Comment[fr]=Un lecteur audio simple d'utilisation Comment[de]=Ein einfacher Audio Player Comment[nn]=Ein enkel ljudavspelar Comment[no]=En enkel lydavspiller Exec=decibel-audio-player MimeType=application/x-executable; Terminal=false Type=Application Icon=decibel-audio-player StartupNotify=true Categories=GNOME;GTK;AudioVideo; EOF # make the package freedesktop compliant cd $dest/usr/share/icons/hicolor/48x48/apps/ ln -sf ../../../../pixmaps/$softname.png $softname.png # add 'default' files cd $src mkdir -p $dest/usr/doc/$softname-$softversion cp -a doc/{LICENCE,ChangeLog} $dest/usr/doc/$softname-$softversion # strip executables ( cd $dest find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # compress man pages ( mv $dest/usr/share/man $dest/$prefix/man cd $dest/$prefix/man find . -name "*.?" | xargs gzip -9 ) # SalixBuild cd $buildir cp build-$softname.sh $dest/$prefix/src/$softname-$softversion # set target permissions chown -R root.root $dest cd $dest find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; # real packaging work cd $dest makepkg -l y -c n $dest.txz # md5sum signature cd $buildir md5sum $package.txz > $package.md5 # .dep cd $buildir echo -e "gst-plugins-base,gst-python,gstreamer,\ gtk+2,mutagen,pycairo,pygobject,pygtk,pynotify,python" > $package.dep # .sug echo -e "gst-plugins-good,gst-plugins-bad,gst-plugins-ugly" > $package.sug # generate source file echo http://zenwalk.pinguix.com/user-accounts/bip/EXTRA/xap/decibel-audio-player/source/build-decibel-audio-player.sh > $package.src echo $source >> $package.src # erase rm -rf $src rm -rf $dest # # log # ) 2>&1 | tee "$softname-$softversion-build.log"