wok-6.x view nanochess/receipt @ rev 17274

linux64: update module list
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Oct 25 09:28:27 2014 +0200 (2014-10-25)
parents d51b2411e55e
children ebb57f2c0d8a
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 LICENSE="GPL"
9 WEB_SITE="http://www.nanochess.org/"
10 HOST_ARCH="any"
11 TAGS="chess"
13 # Rules to configure and make the package.
14 compile_rules()
15 {
16 # define colors
17 white="#f0f0b0" # was #f0f0f0
18 black="#f05030" # was #c0c0f0
19 gray="#843" # was #dde
20 background="$white" # was white
21 red="blue"
23 mkdir -p $src 2> /dev/null
24 cp $stuff/index.html $src
25 cd $src
26 sed -i -e 's/<select/<input type=\\"button\\" value=\\"\&#9818; \&hArr; \&#9812;\\" onclick=\\"yy^=8;Z()\\">&/' \
27 -e 's/><option.*$/>";/' -e "s/ style='font-size:20px'//" \
28 -e 's/50px/"+P+"px/g' -e 's/=60/="+H+"/g' \
29 -e 's|for(a=|H=innerHeight/9;P=H*5/6;|' -e 's/^"<table/for(a=&/' \
30 -e "s/c0c\":\"f0f\")+\"0f0/$white\":\"$black\")+\"/" \
31 -e "s/#dde/$gray/" -e "s/red/$red/" -e 's/bgcolor=#/bgcolor=/' \
32 -e 's|^doc.*|yy=/\\?b/i.test(document.URL)?8:0;for(p=18;++p<23;)a+="<option>\&#9823; \&rarr; \&#98"+p+";</option>";document.write(a);|' \
33 -e "s|<script>|<style>body {background: $background; overflow: hidden;} input,select {background: transparent; -webkit-appearance: none;}</style>\n<title>Toledo chess</title>&|" \
34 -e 's|function Y|function Z(){if(y!=yy)setTimeout("X(0,0,0,21,u,2),X(0,0,0,21,u,1)",250);}\n&|' \
35 -e 's|if(y)set.*|Z();}}Z()|' \
36 index.html
37 }
39 # Rules to gen a SliTaz package suitable for Tazpkg.
40 genpkg_rules()
41 {
42 mkdir -p $fs/var/www/chess $fs/usr/share/applications
43 cp $src/* $fs/var/www/chess
44 chown -R 80.80 $fs/var/www/chess
45 cat > $fs/usr/share/applications/chess.desktop <<EOT
46 [Desktop Entry]
47 Type=Application
48 Name=Chess
49 Name[zh_CN]=国际象棋
50 Exec=sh -c "url=file:///var/www/chess/index.html ; tazweb --notoolbar \$url || browser \$url"
51 Icon=gnome-glchess
52 Terminal=false
53 Categories=Game;
54 Comment=Chess game
55 EOT
56 }