wok view nanochess/receipt @ rev 12095

nanochess, sudoku: run tazweb --notoolbar (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Mar 10 23:13:38 2012 +0100 (2012-03-10)
parents b8c9e41e80ef
children 00d3597d0816
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/<input type=\\"button\\" value=\\"\&#9818; \&hArr; \&#9812;\\" onclick=\\"yy^=8;Z()\\">&/' \
23 -e "s/ style='font-size:20px'//" \
24 -e 's/50px/"+P+"px/g' -e 's/=60/="+H+"/g' \
25 -e 's|for(a=|H=innerHeight/9;P=H*5/6;|' -e 's/^"<table/for(a=&/' \
26 -e "s/c0c\":\"f0f\")+\"0f0/$white\":\"$black\")+\"/" \
27 -e "s/#dde/$gray/" -e "s/red/$red/" -e 's/bgcolor=#/bgcolor=/' \
28 -e 's/><option.*$/>";/' -e 's|^doc.*|yy=0;for(p=18;++p<23;)a+="<option>\&#9823; \&rarr; \&#98"+p+";</option>";document.write(a);|' \
29 -e 's|<script>|<title>Toledo chess</title>&|' \
30 -e 's|function Y|function Z(){if(y!=yy^/\\?b/i.test(document.URL)?8:0)setTimeout("X(0,0,0,21,u,2),X(0,0,0,21,u,1)",250);}\n&|' \
31 -e 's|if(y)set.*|Z();}}Z()|' \
32 index.html
33 }
35 # Rules to gen a SliTaz package suitable for Tazpkg.
36 genpkg_rules()
37 {
38 mkdir -p $fs/var/www/chess $fs/usr/share/applications
39 cp $src/* $fs/var/www/chess
40 chown -R 80.80 $fs/var/www/chess
41 cat > $fs/usr/share/applications/chess.desktop <<EOT
42 [Desktop Entry]
43 Type=Application
44 Name=Chess
45 Name[zh_CN]=国际象棋
46 Exec=sh -c "url=file:///var/www/chess/index.html ; tazweb --notoolbar \$url || browser \$url"
47 Icon=other
48 Terminal=false
49 Categories=Game;
50 Comment=Chess game
51 EOT
52 }