updated on Wed Jan 11 12:00:27 UTC 2012
[aur-mirror.git] / deal / PKGBUILD
blob2caa4cf449b4d76ecedb62188cbe902c4c8d53e6
1 # Maintainer: Gadget3000 <gadget3000 at msn dot com>
2 # Contributor: Piotr Beling <qwak@stud.ics.p.lodz.pl>
4 pkgname=deal
5 pkgver=3.1.9
6 pkgrel=1
7 arch=('i686' 'x86_64')
8 pkgdesc="Bridge hand (deals) generator"
9 url="http://bridge.thomasoandrews.com/deal/"
10 source=(http://bridge.thomasoandrews.com/deal/deal${pkgver//./}.zip)
11 md5sums=('7ddeb149478fa32aa9f0432092cfd179')
12 license=('GPL')
13 depends=('tcl>=8.5' 'tcl<8.6' 'gcc-libs')
14 options=(docs)
16 build() {
17     cd $srcdir/deal${pkgver//./}                        || return 1
18     
19     #Patch Makefile:
20     sed -i \
21         -e 'sX/usr/localX/usrXg' \
22         -e 's/-fast//g' \
23         -e 's/-ltcl/-ltcl8.5/g' \
24         {Makefile,Make.mac-osx}
25     #Patch c file to include deal.tcl from proper directory:
26     sed -i -e 's|source deal.tcl|source /usr/share/deal/deal.tcl|g' \
27          tcl_deal.c                                     || return 1
28          
29     for i in ex format input lib
30     do
31         cd $i
32         sed -i -e 's|source format|source /usr/share/deal/format|g' *   || return 1
33         sed -i -e 's|source input|source /usr/share/deal/input|g' *     || return 1             
34         sed -i -e 's|source "input|source "/usr/share/deal/input|g' *   || return 1
35         sed -i -e 's|source ex|source /usr/share/deal/ex|g' *           || return 1
36         sed -i -e 's|source lib|source /usr/share/deal/lib|g' * || return 1
37         cd ..
38     done
39     sed -i -e 's|source lib|source /usr/share/deal/lib|g' *.tcl || return 1
40     
41     echo > ${srcdir}/deal${pkgver//./}/Make.dep
42     make                                                || return 1
43     local destdir=$pkgdir/usr/share/deal
44     install -d $destdir                                 || return 1
45     cp -R format $destdir/                              || return 1
46     cp -R input $destdir/                               || return 1
47     cp -R lib $destdir/                                 || return 1
48     cp -R ex $destdir/                                  || return 1    
49     cp deal.tcl $destdir/                               || return 1
50     install -D -m755 deal $pkgdir/usr/bin/deal          || return 1
51     
52     local docdst=$pkgdir/usr/share/doc/deal
53     install -d $docdst                                  || return 1
54     cp -R html/* $docdst/                               || return 1
56     mv ${pkgdir}/usr/bin/deal ${pkgdir}/usr/bin/deal-bin
57     echo \#\!/bin/bash > ${pkgdir}/usr/bin/deal
58     echo cd /usr/share/deal >> ${pkgdir}/usr/bin/deal
59     echo deal-bin >> ${pkgdir}/usr/bin/deal
60     chmod +x ${pkgdir}/usr/bin/deal