wok-stable view nanochess/receipt @ rev 12091
nanochess: red based colors
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Mar 10 18:05:44 2012 +0100 (2012-03-10) |
parents | ff54c8e52d6b |
children | 87c1138bb45b |
line source
1 # SliTaz package receipt.
3 PACKAGE="nanochess"
4 VERSION="1.0"
5 CATEGORY="games"
6 SHORT_DESC="Chess game in javascript (need an unicode aware browser)"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 WEB_SITE="http://nanochess.110mb.com/chess4.html"
10 # Rules to configure and make the package.
11 compile_rules()
12 {
13 # define colors
14 white="f0f0b0" # was f0f0f0
15 black="f05030" # was c0c0f0
16 gray="#843" # was #dde
17 red="blue"
19 mkdir -p $src 2> /dev/null
20 cp $stuff/index.html $src
21 cd $src
22 sed -i -e 's/<select/\♟ \→ &/' \
23 -e 's/50px/"+P+"px/g' -e 's/=60/="+H+"/g' \
24 -e 's|for(a=|H=innerHeight/9;P=H*5/6;|' -e 's/^"<table/for(a=&/' \
25 -e "s/c0c\":\"f0f\")+\"0f0/$white\":\"$black\")+\"/" \
26 -e "s/#dde/$gray/" -e "s/red/$red/" \
27 -e 's/><option.*$/>";/' -e 's|^doc.*|for(p=18;++p<23;)a+="<option>\b"+p+";</option>";document.write(a);|' \
28 -e 's|<script>|<title>Toledo chess</title>&|' \
29 -e 's|function Y|function Z(){if(y!=/\\?b/i.test(document.URL)?8:0)setTimeout("X(0,0,0,21,u,2),X(0,0,0,21,u,1)",250);}\n&|' \
30 -e 's|if(y)set.*|Z();}}Z()|' \
31 index.html
32 }
34 # Rules to gen a SliTaz package suitable for Tazpkg.
35 genpkg_rules()
36 {
37 mkdir -p $fs/var/www/chess $fs/usr/share/applications
38 cp $src/* $fs/var/www/chess
39 chown -R 80.80 $fs/var/www/chess
40 cat > $fs/usr/share/applications/chess.desktop <<EOT
41 [Desktop Entry]
42 Type=Application
43 Name=Chess
44 Name[zh_CN]=国际象棋
45 Exec=browser file:///var/www/chess/index.html
46 Icon=other
47 Terminal=false
48 Categories=Game;
49 Comment=Chess game
50 EOT
51 }