File: rules

package info (click to toggle)
gnuchess-book 1.02-2.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 83,760 kB
  • sloc: makefile: 28
file content (35 lines) | stat: -rwxr-xr-x 1,264 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /usr/bin/make -f

SHELL = /bin/bash

VERSION = 1.02
PGNBOOK := book_$(VERSION).pgn

%:
	dh $@

override_dh_auto_build:
	dh_testdir $(PGNBOOK)
	# Spam only if stdout is a tty
	@ if /usr/bin/tty -s 0>&1; then ( \
	   echo "---------------------------------------------------------------"; \
	   echo "Building book, this may take some time. There will be a counter"; \
	   echo "running to keep you entertained. The PGN file seems to contain "; \
	   echo -n "`grep -c '^\[White' $(PGNBOOK) 2> /dev/null` games. "        ; \
	   echo "The actual count will probably be a little less"                ; \
	   echo "because gnuchess only accepts games played by some hardcoded"   ; \
	   echo "list of players."                                               ; \
	   echo "---------------------------------------------------------------"; \
	   /usr/games/gnuchess --addbook $(PGNBOOK) ); \
	else ( \
	   echo "Building book."; \
	   /usr/games/gnuchess --addbook $(PGNBOOK) &> /dev/null ); \
	fi

get-orig-source:
	wget http://ftp.gnu.org/pub/gnu/chess/$(PGNBOOK).gz
	gunzip $(PGNBOOK).gz
	mkdir gnuchess-book-$(VERSION)
	mv $(PGNBOOK) gnuchess-book-$(VERSION)
	tar czf gnuchess-book_$(VERSION).orig.tar.gz gnuchess-book-$(VERSION)
	rm -rf gnuchess-book-$(VERSION)/