#Packager: Shador <futur~DOT~andy~AT~googlemail.com>

pkgname=launchy
pkgver=2.5
pkgrel=1ab
#arch=x86_64
source=("http://downloads.sourceforge.net/project/launchy/Launchy%20on%20Linux/2.5/launchy-2.5.tar.gz")
sourcetemplate="http://gaia.homelinux.org/salix/packages-x86_64/$pkgname/$pkgver/"
docs=("readme.pdf" "build.txt" "license.txt")
url='http://www.launchy.net/'

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname (The Open Source Keystroke Launcher)"
"Launchy is a free cross-platform utility designed to help you forget"
"about your start menu, the icons on your desktop, and even your file"
"manager."
"Launchy indexes the programs in your start menu and can launch your"
"documents, project files, folders, and bookmarks with just a few"
"keystrokes!"
)


build() {
  set -e
  threadcount=$(($(sed -ne '/cpu cores/h;${g;s/[^0-9]*//p}' \
            < /proc/cpuinfo)*2))
  if [ $threadcount -lt 2 ]; then
    threadcount=2
  elif [ $threadcount -gt 8 ]; then
    threadcount=8
  fi
  threads="-j${threadcount}"

  cd $startdir/src/$pkgname-$pkgver
  
  test -z "${LIBDIRSUFFIX}" \
    || find . -iname '*.pro' -print0 \
      | xargs -0 -I'{}' sed -e "s#/lib#/lib${LIBDIRSUFFIX}#g" -i "{}"
  qmake || return 1
  make $threads || return 1
  make install INSTALL_ROOT=$startdir/pkg || return 1
  
  install -vd $startdir/pkg/usr/share/icons/hicolor/48x48/apps/
  convert Launchy.ico $startdir/pkg/usr/share/icons/hicolor/48x48/apps/launchy.png
  rm -rf $startdir/pkg/usr/share/pixmaps
  
  set +e
} 
