wok-current view nanochess/receipt @ rev 13585

sbxkb: add LDFLAGS
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Nov 06 12:55:04 2012 +0100 (2012-11-06)
parents 8532e733eda4
children a436a235f098
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"
9 TAGS="chess"
11 # Rules to configure and make the package.
12 compile_rules()
13 {
14 # define colors
15 white="#f0f0b0" # was #f0f0f0
16 black="#f05030" # was #c0c0f0
17 gray="#843" # was #dde
18 background="$white" # was white
19 red="blue"
21 mkdir -p $src 2> /dev/null
22 cp $stuff/index.html $src
23 cd $src
24 sed -i -e 's/<select/<input type=\\"button\\" value=\\"\&#9818; \&hArr; \&#9812;\\" onclick=\\"yy^=8;Z()\\">&/' \
25 -e 's/><option.*$/>";/' -e "s/ style='font-size:20px'//" \
26 -e 's/50px/"+P+"px/g' -e 's/=60/="+H+"/g' \
27 -e 's|for(a=|H=innerHeight/9;P=H*5/6;|' -e 's/^"<table/for(a=&/' \
28 -e "s/c0c\":\"f0f\")+\"0f0/$white\":\"$black\")+\"/" \
29 -e "s/#dde/$gray/" -e "s/red/$red/" -e 's/bgcolor=#/bgcolor=/' \
30 -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);|' \
31 -e "s|<script>|<style>body {background: $background; overflow: hidden;} input,select {background: transparent; -webkit-appearance: none;}</style>\n<title>Toledo chess</title>&|" \
32 -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&|' \
33 -e 's|if(y)set.*|Z();}}Z()|' \
34 index.html
35 }
37 # Rules to gen a SliTaz package suitable for Tazpkg.
38 genpkg_rules()
39 {
40 mkdir -p $fs/var/www/chess $fs/usr/share/applications
41 cp $src/* $fs/var/www/chess
42 chown -R 80.80 $fs/var/www/chess
43 cat > $fs/usr/share/applications/chess.desktop <<EOT
44 [Desktop Entry]
45 Type=Application
46 Name=Chess
47 Name[zh_CN]=国际象棋
48 Exec=sh -c "url=file:///var/www/chess/index.html ; tazweb --notoolbar \$url || browser \$url"
49 Icon=other
50 Terminal=false
51 Categories=Game;
52 Comment=Chess game
53 EOT
54 }