wok-stable view nanochess/receipt @ rev 12229

perl-libwww: fix depends
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Mon Apr 09 10:53:20 2012 +0200 (2012-04-09)
parents 00d3597d0816
children
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 background="$white" # was white
18 red="blue"
20 mkdir -p $src 2> /dev/null
21 cp $stuff/index.html $src
22 cd $src
23 sed -i -e 's/<select/<input type=\\"button\\" value=\\"\&#9818; \&hArr; \&#9812;\\" onclick=\\"yy^=8;Z()\\">&/' \
24 -e 's/><option.*$/>";/' -e "s/ style='font-size:20px'//" \
25 -e 's/50px/"+P+"px/g' -e 's/=60/="+H+"/g' \
26 -e 's|for(a=|H=innerHeight/9;P=H*5/6;|' -e 's/^"<table/for(a=&/' \
27 -e "s/c0c\":\"f0f\")+\"0f0/$white\":\"$black\")+\"/" \
28 -e "s/#dde/$gray/" -e "s/red/$red/" -e 's/bgcolor=#/bgcolor=/' \
29 -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);|' \
30 -e "s|<script>|<style>body {background: $background; overflow: hidden;} input,select {background: transparent; -webkit-appearance: none;}</style>\n<title>Toledo chess</title>&|" \
31 -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&|' \
32 -e 's|if(y)set.*|Z();}}Z()|' \
33 index.html
34 }
36 # Rules to gen a SliTaz package suitable for Tazpkg.
37 genpkg_rules()
38 {
39 mkdir -p $fs/var/www/chess $fs/usr/share/applications
40 cp $src/* $fs/var/www/chess
41 chown -R 80.80 $fs/var/www/chess
42 cat > $fs/usr/share/applications/chess.desktop <<EOT
43 [Desktop Entry]
44 Type=Application
45 Name=Chess
46 Name[zh_CN]=国际象棋
47 Exec=sh -c "url=file:///var/www/chess/index.html ; tazweb --notoolbar \$url || browser \$url"
48 Icon=other
49 Terminal=false
50 Categories=Game;
51 Comment=Chess game
52 EOT
53 }