rev |
line source |
pascal@7045
|
1 # SliTaz package receipt.
|
pascal@7045
|
2
|
pascal@7045
|
3 PACKAGE="nanochess"
|
pascal@7045
|
4 VERSION="1.0"
|
pascal@7045
|
5 CATEGORY="games"
|
pascal@7045
|
6 SHORT_DESC="Chess game in javascript (need an unicode aware browser)"
|
pascal@7045
|
7 MAINTAINER="pascal.bellard@slitaz.org"
|
pascal@7045
|
8 WEB_SITE="http://nanochess.110mb.com/chess4.html"
|
pascal@7045
|
9
|
pascal@7045
|
10 # Rules to configure and make the package.
|
pascal@7045
|
11 compile_rules()
|
pascal@7045
|
12 {
|
pascal@12091
|
13 # define colors
|
pascal@12092
|
14 white="#f0f0b0" # was #f0f0f0
|
pascal@12092
|
15 black="#f05030" # was #c0c0f0
|
pascal@12091
|
16 gray="#843" # was #dde
|
pascal@12091
|
17 red="blue"
|
pascal@12091
|
18
|
pascal@10761
|
19 mkdir -p $src 2> /dev/null
|
slaxemulator@11041
|
20 cp $stuff/index.html $src
|
pascal@7045
|
21 cd $src
|
pascal@12094
|
22 sed -i -e 's/<select/<input type=\\"button\\" value=\\"\♚ \⇔ \♔\\" onclick=\\"yy^=8;Z()\\">&/' \
|
pascal@12094
|
23 -e "s/ style='font-size:20px'//" \
|
pascal@7611
|
24 -e 's/50px/"+P+"px/g' -e 's/=60/="+H+"/g' \
|
pascal@7075
|
25 -e 's|for(a=|H=innerHeight/9;P=H*5/6;|' -e 's/^"<table/for(a=&/' \
|
pascal@12091
|
26 -e "s/c0c\":\"f0f\")+\"0f0/$white\":\"$black\")+\"/" \
|
pascal@12092
|
27 -e "s/#dde/$gray/" -e "s/red/$red/" -e 's/bgcolor=#/bgcolor=/' \
|
pascal@12094
|
28 -e 's/><option.*$/>";/' -e 's|^doc.*|yy=0;for(p=18;++p<23;)a+="<option>\♟ \→ \b"+p+";</option>";document.write(a);|' \
|
pascal@11615
|
29 -e 's|<script>|<title>Toledo chess</title>&|' \
|
pascal@12094
|
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&|' \
|
pascal@11614
|
31 -e 's|if(y)set.*|Z();}}Z()|' \
|
pascal@7045
|
32 index.html
|
pascal@7045
|
33 }
|
pascal@7045
|
34
|
pascal@7045
|
35 # Rules to gen a SliTaz package suitable for Tazpkg.
|
pascal@7045
|
36 genpkg_rules()
|
pascal@7045
|
37 {
|
pascal@7045
|
38 mkdir -p $fs/var/www/chess $fs/usr/share/applications
|
pascal@7045
|
39 cp $src/* $fs/var/www/chess
|
pascal@7045
|
40 chown -R 80.80 $fs/var/www/chess
|
pascal@7045
|
41 cat > $fs/usr/share/applications/chess.desktop <<EOT
|
pascal@7045
|
42 [Desktop Entry]
|
pascal@7045
|
43 Type=Application
|
pascal@7045
|
44 Name=Chess
|
lufeng369@7530
|
45 Name[zh_CN]=国际象棋
|
pascal@12095
|
46 Exec=sh -c "url=file:///var/www/chess/index.html ; tazweb --notoolbar \$url || browser \$url"
|
samuel_trassare@12029
|
47 Icon=other
|
pascal@7045
|
48 Terminal=false
|
pascal@7045
|
49 Categories=Game;
|
pascal@7045
|
50 Comment=Chess game
|
pascal@7045
|
51 EOT
|
pascal@7045
|
52 }
|
pascal@7045
|
53
|