1 # Maintainer: Gadget3000 <gadget3000 at msn dot com>
2 # Contributor: Piotr Beling <qwak@stud.ics.p.lodz.pl>
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')
13 depends=('tcl>=8.5' 'tcl<8.6' 'gcc-libs')
17 cd $srcdir/deal${pkgver//./} || return 1
21 -e 'sX/usr/localX/usrXg' \
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
29 for i in ex format input lib
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
39 sed -i -e 's|source lib|source /usr/share/deal/lib|g' *.tcl || return 1
41 echo > ${srcdir}/deal${pkgver//./}/Make.dep
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
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