wok-6.x view chess3d/receipt @ rev 15102

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