updated on Thu Jan 19 16:10:29 UTC 2012
[aur-mirror.git] / osdlyrics / PKGBUILD
blob470c98c8e4b381257dafdee63730d11dc30a351f
1 # Maintainer: Auguste Pop <auguste [at] gmail [dot] com>
3 pkgname=osdlyrics
4 pkgver=0.4.2
5 pkgrel=2
6 pkgdesc="A lyric show compatible with various media players"
7 arch=('i686' 'x86_64')
8 url="http://code.google.com/p/osd-lyrics/"
9 license=('GPL3')
10 depends=('gtk2' 'dbus-glib' 'curl' 'libnotify' 'sqlite3'
11          'desktop-file-utils' 'hicolor-icon-theme')
12 makedepends=('intltool')
13 optdepends=('libmpd: MPD support'
14             'xmms2:   XMMS2 support')
15 install=$pkgname.install
16 source=(http://osd-lyrics.googlecode.com/files/$pkgname-$pkgver.tar.gz
17         http://osd-lyrics.googlecode.com/files/$pkgname-$pkgver-glib.patch)
18 md5sums=('80d704b97a72a117bb9890948adcf79c'
19          '23cabc6a12a32383e8a84dd873566fc2')
21 _ods=()
22 _tmpfile="$pkgdir/.tmp"
24 add_ods()
26     pkg-config $1 && echo "$3" >> "$_tmpfile" || _ods=("${_ods[@]}" "$2")
29 unset_optdepend()
31     for _idx in ${!optdepends[@]}
32     do
33         if [[ "${optdepends[$_idx]}" =~ ^$1:* ]]
34         then
35             unset optdepends[$_idx]
36             break
37         fi
38     done
41 build()
43     cd "$srcdir/$pkgname-$pkgver"
44     patch -p1 -i "$srcdir/$pkgname-$pkgver-glib.patch"
46     aclocal
47     autoheader
48     autoconf
49     automake --add-missing
51     rm -rf "$_tmpfile"
52     add_ods libmpd "--disable-mpd" libmpd
53     add_ods xmms2-client "--disable-xmms2" xmms2
55     LIBS=-lm ./configure --prefix=/usr "${_ods[@]}"
56     make
59 package()
61     cd "$srcdir/$pkgname-$pkgver"
62     make DESTDIR="$pkgdir" install
64     while read _ch
65     do
66         if [ 1 -gt 0 ]; then depends=("${depends[@]}" "$_ch"); fi
67         unset_optdepend "$_ch"
68     done < "$_tmpfile"
69     optdepends=("${optdepends[@]}")
70     rm -rf "$_tmpfile"