updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / stockfish / PKGBUILD
blob2c4492dfc611a4dba6dd439a051f28d4ed3f415a
1 # Maintainer: Auguste Pop < auguste [at] gmail [dot] com >
2 # Contributor: P. Badredin <p dot badredin at gmail dot com>
3 # Contributor: Justin Blanchard <UncombedCoconut at gmail dot com>
5 pkgname=stockfish
6 pkgver=2.2.1
7 _bookver=2.1.1
8 pkgrel=1
9 pkgdesc="A strong chess engine written by Tord Romstad, Marco Costalba, Joona Kiiski"
10 arch=('i686' 'x86_64')
11 url="http://www.stockfishchess.com/"
12 license=('GPL3')
13 install=stockfish.install
14 _pkgfilever=${pkgver//./}
15 _bookfilever=${_bookver//./}
16 source=("http://api.cld.me/1T1R0b0z3u3A3B363o2l/download/stockfish-${_pkgfilever}-linux.zip"
17         "http://api.cld.me/2R1L1Y0V0b1M3M1B1D26/download/sf-${_bookfilever}-book.zip")
18 md5sums=('0ec3f2f0899f00a25dda135111e3c712'
19          'c41f7a3e30a141415591dba2355deccb')
22 build()
24     cd "$srcdir/stockfish-${_pkgfilever}-linux/src"
25     # Change the default book path to a system-wide location
26     sed -i '/Book File/s:book.bin:/usr/share/stockfish/book.bin:' ucioption.cpp
27     # Patch Makefile to enable profile-build
28     sed -i 's/\(.*\)LDFLAGS += $(CXXFLAGS)/\1LDFLAGS += -flto/' Makefile
30     [ "$CARCH" = "i686" ] && _arch=x86-32 || _arch=x86-64
31     make profile-build ARCH=$_arch
34 package()
36     cd "$srcdir/sf-${_bookfilever}-book"
37     install -D -m644 Book.bin $pkgdir/usr/share/$pkgname/book.bin
39     cd "$srcdir/stockfish-${_pkgfilever}-linux/src"
40     make PREFIX="$pkgdir/usr" install