updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / thunderbird-firetray / PKGBUILD
blobc086521089887f0934dc17fba4556bf6a682ad60
1 # Contributor: Vasily Ryabov
2 # Maintainer: Sebastien Duthil <duthils@free.fr>
4 pkgname=thunderbird-firetray
5 pkgver=0.3.5
6 pkgrel=1
7 pkgdesc="A system tray extension for linux. Installs globally for all users. Useful as package when home mounted with noexec, because extension requires execute permission."
8 arch=('any')
9 url="http://code.google.com/p/firetray/"
10 license=('GPL')
11 depends=('thunderbird')
12 source=(http://firetray.googlecode.com/files/firetray-$pkgver.xpi)
13 md5sums=('fc311801344fafb794b01f598664ba3f')
14 options=(!strip)
15 install="$pkgname.install"
17 package() {
19     # Looking for thhe install path
20     TB_DIRS="$(ls /usr/lib | grep thunderbird)"
21     TB_FINAL_DIR=""
22     for TB_DIR in $TB_DIRS ; do
23         if [ -d "/usr/lib/$TB_DIR/extensions" ] ; then
24             # Checking if there are multiple possible paths
25             if [ -z "$TB_FINAL_DIR" ] ; then
26                 TB_FINAL_DIR="$TB_DIR"
27             else
28                 error "There are multiple thunderbird folders in /usr/lib."
29                 msg "Please specify the Thunderbird folder containing the extensions directory in the _tb_firetray_install variable."
30                 return 1
31             fi
32         fi
33     done
35     if [ -z "$TB_FINAL_DIR" ] ; then
36         # Specified path ?
37         if [ -z "$_tb_firetray_install" ] ; then
38             error "No thunderbird path found."
39             msg "Please specify the Thunderbird folder containing the extensions directory in the _tb_firetray_install variable."
40             return 1
41         else
42             TB_FINAL_DIR="$_tb_firetray_install"
43         fi
44     fi
46     EXT_ID=$(sed -n '/.*<em:id>\(.*\)<\/em:id>.*/{s//\1/p;q}' install.rdf) || return 1
47     DEST_DIR="$pkgdir/usr/lib/$TB_FINAL_DIR/extensions/$EXT_ID/"
48     mkdir -p "$DEST_DIR"
49     cp -a "$srcdir/"* "$DEST_DIR"
50     rm "$DEST_DIR"/*.xpi