wok view chess3d/receipt @ rev 17442

qemu/cloop: fix V0-V2
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Dec 10 21:59:12 2014 +0100 (2014-12-10)
parents a0250385f2a5
children
line source
1 # SliTaz package receipt.
3 PACKAGE="chess3d"
4 VERSION="1.0"
5 CATEGORY="games"
6 SHORT_DESC="3D Chess game in javascript"
7 TARBALL="$PACKAGE-$VERSION.tar.lzma"
8 MAINTAINER="pascal.bellard@slitaz.org"
9 LICENSE="GPL"
10 WEB_SITE="http://chessforeva.appspot.com/"
11 TAGS="chess"
13 # Rules to configure and make the package.
14 compile_rules()
15 {
16 mkdir $src
17 cd $src
18 if [ ! -s C0_Toledo.htm ] &&
19 wget http://mirror.slitaz.org/sources/packages/c/$TARBALL; then
20 unlzma -c $TARBALL | tar xf -
21 mv $PACKAGE-$VERSION/* .
22 fi
23 mkdir arts d_img img
24 for i in C0_Toledo.htm c0_pgn.js c0_chess.js ; do
25 [ -s $i ] && continue
26 wget ${WEB_SITE}$i || return 1
27 dos2unix $i
28 done
29 for i in arts/a_arrow ; do
30 [ -s $i.gif ] && continue
31 wget -P arts ${WEB_SITE}$i.gif || return 1
32 done
33 for i in b_plus1 b_minus1 b_topview oie_arrow_white ; do
34 [ -s img/$i.gif ] && continue
35 wget -P img ${WEB_SITE}img/$i.gif || return 1
36 done
37 for i in t oie ; do
38 for j in board letters letters2 ; do
39 f=${i}_$j.gif
40 [ -s img/$f ] && continue
41 wget -P img ${WEB_SITE}img/$f || return 1
42 done
43 for j in w b ; do
44 for k in pawn rook knight1 knight2 bishop qeen king ; do
45 f=${i}_${j}$k.gif
46 [ -s img/$f ] && continue
47 wget -P img ${WEB_SITE}img/$f || return 1
48 done
49 done
50 done
51 sed -i -e 's/var THide=.*/var THide=1;/' \
52 -e 's/var Tnoback=.*/var Tnoback=1;/' \
53 -e 's/c0_topview=true;/&\nc0_ch_topview();/' \
54 -e 's|http://chess.*com/||' \
55 -e 's|http://www.ltn.lv/~gv/to.*gif|img/b_minus1.gif|' \
56 -e "s|${WEB_SITE}||" \
57 C0_Toledo.htm
58 sed -i -e "s|${WEB_SITE}||" *.js
59 }
61 # Rules to gen a SliTaz package suitable for Tazpkg.
62 genpkg_rules()
63 {
64 mkdir -p $fs/var/www/chess3d $fs/usr/share/applications
65 cp -a $src/* $fs/var/www/chess3d
66 mv $fs/var/www/chess3d/C0_Toledo.htm $fs/var/www/chess3d/index.html
67 chown -R 80.80 $fs/var/www/chess3d
68 cat > $fs/usr/share/applications/chess3d.desktop <<EOT
69 [Desktop Entry]
70 Type=Application
71 Name=Chess3d
72 Exec=browser file:///var/www/chess3d/index.html
73 Icon=chess3d
74 Terminal=false
75 Categories=Game;
76 Comment=3d chess game
77 EOT
78 }