wok-next diff chess3d/receipt @ rev 20766

childsplay: up (3.3); tiny edits.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Jun 06 04:36:32 2018 +0300 (2018-06-06)
parents fe59386a94f9
children d5aab818505e
line diff
     1.1 --- a/chess3d/receipt	Sat Mar 18 17:36:09 2017 +0200
     1.2 +++ b/chess3d/receipt	Wed Jun 06 04:36:32 2018 +0300
     1.3 @@ -1,78 +1,64 @@
     1.4 -# SliTaz package receipt.
     1.5 +# SliTaz package receipt v2.
     1.6  
     1.7  PACKAGE="chess3d"
     1.8  VERSION="1.0"
     1.9  CATEGORY="games"
    1.10  SHORT_DESC="3D Chess game in javascript"
    1.11 -TARBALL="$PACKAGE-$VERSION.tar.lzma"
    1.12  MAINTAINER="pascal.bellard@slitaz.org"
    1.13  LICENSE="GPL"
    1.14  WEB_SITE="http://chessforeva.appspot.com/"
    1.15 -TAGS="chess"
    1.16  
    1.17 -# Rules to configure and make the package.
    1.18 -compile_rules()
    1.19 -{
    1.20 -	mkdir $src
    1.21 +compile_rules() {
    1.22 +	mkdir -p $src
    1.23  	cd $src
    1.24 -	if [ ! -s C0_Toledo.htm ] &&
    1.25 -		wget http://mirror.slitaz.org/sources/packages/c/$TARBALL; then
    1.26 -		unlzma -c $TARBALL | tar xf -
    1.27 -		mv $PACKAGE-$VERSION/* .
    1.28 -	fi
    1.29 -	mkdir -p arts d_img img
    1.30 -	for i in C0_Toledo.htm c0_pgn.js c0_chess.js ; do
    1.31 -		[ -s $i ] && continue
    1.32 -		wget ${WEB_SITE}$i || return 1
    1.33 -		dos2unix $i
    1.34 -	done
    1.35 -	for i in arts/a_arrow ; do
    1.36 -		[ -s $i.gif ] && continue
    1.37 -		wget -P arts ${WEB_SITE}$i.gif || return 1
    1.38 -	done
    1.39 -	for i in b_plus1 b_minus1 b_topview oie_arrow_white ; do
    1.40 -		[ -s img/$i.gif ] && continue
    1.41 -		wget -P img ${WEB_SITE}img/$i.gif || return 1
    1.42 -	done
    1.43 -	for i in t oie ; do
    1.44 -		for j in board letters letters2 ; do
    1.45 -			f=${i}_$j.gif
    1.46 -			[ -s img/$f ] && continue
    1.47 -			wget -P img ${WEB_SITE}img/$f || return 1
    1.48 +
    1.49 +	TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.50 +	if [ -f $SRC/$TARBALL ]; then
    1.51 +		tar -xf $SRC/$TARBALL
    1.52 +	else
    1.53 +		mkdir -p arts d_img img
    1.54 +
    1.55 +		for i in C0_Toledo.htm c0_pgn.js c0_chess.js; do
    1.56 +			wget $WEB_SITE$i || return 1
    1.57 +			dos2unix $i
    1.58  		done
    1.59 -		for j in w b ; do
    1.60 -			for k in pawn rook knight1 knight2 bishop qeen king ; do
    1.61 -				f=${i}_${j}$k.gif
    1.62 -				[ -s img/$f ] && continue
    1.63 -				wget -P img ${WEB_SITE}img/$f || return 1
    1.64 +
    1.65 +		wget -P arts ${WEB_SITE}arts/a_arrow.gif || return 1
    1.66 +
    1.67 +		for i in b_plus1 b_minus1 b_topview oie_arrow_white; do
    1.68 +			wget -P img ${WEB_SITE}img/$i.gif || return 1
    1.69 +		done
    1.70 +
    1.71 +		for i in t oie; do
    1.72 +			for j in board letters letters2; do
    1.73 +				wget -P img ${WEB_SITE}img/${i}_$j.gif || return 1
    1.74 +			done
    1.75 +			for j in w b; do
    1.76 +				for k in pawn rook knight1 knight2 bishop qeen king; do
    1.77 +					wget -P img ${WEB_SITE}img/${i}_${j}$k.gif || return 1
    1.78 +				done
    1.79  			done
    1.80  		done
    1.81 -	done
    1.82 -	sed -i	-e 's/var THide=.*/var THide=1;/' \
    1.83 +		tar -czf $SRC/$TARBALL *
    1.84 +	fi
    1.85 +
    1.86 +	sed \
    1.87 +		-e 's/var THide=.*/var THide=1;/' \
    1.88  		-e 's/var Tnoback=.*/var Tnoback=1;/' \
    1.89  		-e 's/c0_topview=true;/&\nc0_ch_topview();/' \
    1.90  		-e 's|http://chess.*com/||' \
    1.91  		-e 's|http://www.ltn.lv/~gv/to.*gif|img/b_minus1.gif|' \
    1.92 -		-e "s|${WEB_SITE}||" \
    1.93 -			C0_Toledo.htm
    1.94 -	sed -i	-e "s|${WEB_SITE}||" *.js
    1.95 +		-e "s|$WEB_SITE||" \
    1.96 +		-i C0_Toledo.htm
    1.97 +	sed -i	-e "s|$WEB_SITE||" *.js
    1.98 +
    1.99 +	mkdir -p     $install/var/www/chess3d/
   1.100 +	cp -r $src/* $install/var/www/chess3d/
   1.101 +	mv $install/var/www/chess3d/C0_Toledo.htm $install/var/www/chess3d/index.html
   1.102  }
   1.103  
   1.104 -# Rules to gen a SliTaz package suitable for Tazpkg.
   1.105 -genpkg_rules()
   1.106 -{
   1.107 -        mkdir -p $fs/var/www/chess3d $fs/usr/share/applications
   1.108 -	cp -a $src/* $fs/var/www/chess3d
   1.109 -	mv $fs/var/www/chess3d/C0_Toledo.htm $fs/var/www/chess3d/index.html
   1.110 +genpkg_rules() {
   1.111 +	copy @std
   1.112  	chown -R 80.80 $fs/var/www/chess3d
   1.113 -	cat > $fs/usr/share/applications/chess3d.desktop <<EOT
   1.114 -[Desktop Entry]
   1.115 -Type=Application
   1.116 -Name=Chess3d
   1.117 -Exec=browser file:///var/www/chess3d/index.html
   1.118 -Icon=chess3d
   1.119 -Terminal=false
   1.120 -Categories=Game;
   1.121 -Comment=3d chess game
   1.122 -EOT
   1.123 +	TAGS="chess"
   1.124  }