wok view nanochess/receipt @ rev 10757

nanochess: get source in $SOURCES_REPOSITORY
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue May 31 11:34:51 2011 +0200 (2011-05-31)
parents 76ab12041a25
children 5ec8b1a4e241
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 mkdir $src 2> /dev/null
14 cd $src
15 _TARBALL=toledo_javascript_chess_3.html
16 [ -s $SOURCES_REPOSITORY/$_TARBALL ] ||
17 wget -P $SOURCES_REPOSITORY $(dirname $WEB_SITE)/archive/$_TARBALL
18 cp $SOURCES_REPOSITORY/$_TARBALL index.html &&
19 sed -i -e 's/<select/\&#9823; \&rarr; &/' \
20 -e 's/50px/"+P+"px/g' -e 's/=60/="+H+"/g' \
21 -e 's|for(a=|H=innerHeight/9;P=H*5/6;|' -e 's/^"<table/for(a=&/' \
22 -e 's/f0f":"c0c")+"0f0/f0f":"606")+"0c0/' -e 's/e0e0f0/b0b080/' \
23 -e 's/><option.*$/>";/' -e 's|^doc.*|for(p=18;++p<23;)a+="<option>\&#98"+p+";</option>";document.write(a);|' \
24 -e 's|<script>|<title>Toledo chess</title>&|' \
25 index.html
26 }
28 # Rules to gen a SliTaz package suitable for Tazpkg.
29 genpkg_rules()
30 {
31 mkdir -p $fs/var/www/chess $fs/usr/share/applications
32 cp $src/* $fs/var/www/chess
33 chown -R 80.80 $fs/var/www/chess
34 cat > $fs/usr/share/applications/chess.desktop <<EOT
35 [Desktop Entry]
36 Type=Application
37 Name=Chess
38 Name[zh_CN]=国际象棋
39 Exec=browser file:///var/www/chess/index.html
40 Icon=other.png
41 Terminal=false
42 Categories=Game;
43 Comment=Chess game
44 EOT
45 }