#!/bin/bash # packager : Frederic Boulet bipbiponlinux~AT~gmail.com # source location : http://tilda.sourceforge.net/wiki/index.php/Main_Page # last revised : 28.04.2008 softname='tilda' softversion='0.9.6' packageversion='1fb' arch='i486' cpu='i686' # log ;) ( # parameters needed for the build process buildir=$(pwd) srcpkg="$buildir/$softname-$softversion.tar.gz" src="$buildir/$softname-$softversion" package="$softname-$softversion-$arch-$packageversion" dest="$buildir/$package" source=http://puzzle.dl.sourceforge.net/sourceforge/tilda/$softname-$softversion.tar.gz # prepare the build result directory dest="$buildir/$package" rm -rf $dest mkdir -p $dest mkdir -p $dest/install mkdir -p $dest/usr/doc/$softname-$softversion mkdir -p $dest/usr/share/icons/hicolor/48x48/apps/ mkdir -p $dest/usr/share/applications mkdir -p $dest/usr/share/$softname mkdir -p $dest/usr/src/$softname-$softversion # Slack-desc cat < $dest/install/slack-desc |-----handy-ruler------------------------------------------------------| tilda: Tilda (a drop-down terminal) tilda: tilda: Tilda is a Linux terminal taking after the likeness of many classic tilda: terminals from first person shooter games, Quake, Doom and Half-Life tilda: (to name a few), where the terminal has no border and is hidden from tilda: the desktop until a key is pressed. tilda: tilda: tilda: tilda: tilda: EOF # check if source is present if [ -f $softname-$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 xvf $srcpkg cd $src # build export CFLAGS="-O2 -march=$arch -mtune=$cpu" export CXXFLAGS="-O2 -march=$arch -mtune=$cpu" ./configure \ --prefix=/usr \ --datarootdir=/usr/share/$softname \ --localedir=/usr/share/locale \ --program-prefix="" \ --program-suffix="" \ --build=$arch-slackware-linux make make install DESTDIR=$dest # add 'default' files cp -a \ ABOUT-NLS AUTHORS ChangeLog COPYING INSTALL NEWS README TODO \ $dest/usr/doc/$softname-$softversion # Strip ( 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 ) # .desktop file rm -rf $dest/usr/share/$softname/applications/ cat << "EOF" > $dest/usr/share/applications/$softname.desktop [Desktop Entry] Encoding=UTF-8 Name=Tilda Comment=A drop down terminal Exec= tilda Icon=tilda Terminal=false Type=Application Categories=System;TerminalEmulator; StartupNotify=true EOF # Make the package freedesktop compliant cp $dest/usr/share/$softname/pixmaps/$softname.png $dest/usr/share/icons/hicolor/48x48/apps/ # ZenBuild cp $buildir/build-$softname.sh $dest/usr/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 "atk,cairo,confuse,expat,fontconfig,freetype,glib2,\ gtk+2,libX11,libXau,libXcomposite,libXcursor,libXdamage,libXdmcp,\ libXext,libXfixes,libXi,libXinerama,libXrandr,libXrender,libglade,\ libpng,libxcb,libxml2,ncurses,pango,pixman,vte,zlib" > $package.dep # generate source file echo http://zenwalk.pinguix.com/user-accounts/bip/divers/salix/xap/tilda/build-tilda.sh > $package.src echo $source >> $package.src # erase rm -rf $src rm -rf $dest # log ;) ) 2>&1 | tee "$softname-$softversion-build.log"