updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / stockfish / PKGBUILD
blob302e9c1b158495a372a9d3cf159e6806996e5148
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.2
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/0s2G1s213J3q420b1X0S/download/stockfish-${_pkgfilever}-linux.zip"
17         "http://api.cld.me/2R1L1Y0V0b1M3M1B1D26/download/sf-${_bookfilever}-book.zip")
18 md5sums=('e6edb709fe97ab7dd1af24a215340b83'
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