wok rev 24130

Add tnylpo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Oct 18 14:47:15 2021 +0000 (2021-10-18)
parents e613c69d3e36
children db9d9cb3c164
files p2c/receipt qb2c/receipt sokojs/stuff/multiset.sh sokojs/stuff/slc2htm.sh tnylpo/description.txt tnylpo/receipt
line diff
     1.1 --- a/p2c/receipt	Sat Oct 16 18:25:56 2021 +0000
     1.2 +++ b/p2c/receipt	Mon Oct 18 14:47:15 2021 +0000
     1.3 @@ -13,6 +13,12 @@
     1.4  
     1.5  DEPENDS="perl"
     1.6  
     1.7 +current_version()
     1.8 +{
     1.9 +	wget -O - $WEB_SITE 2>/dev/null | \
    1.10 +	sed "/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|;q"
    1.11 +}
    1.12 +
    1.13  # Rules to configure and make the package.
    1.14  compile_rules()
    1.15  {
    1.16 @@ -35,7 +41,6 @@
    1.17  	cp sys.p2crc loc.p2crc system.imp system.m2 turbo.imp string.pas \
    1.18  		$DESTDIR/usr/lib/p2c
    1.19  	mv $DESTDIR/usr/lib/p2c/sys.p2crc $DESTDIR/usr/lib/p2c/p2crc
    1.20 -	
    1.21  }
    1.22  
    1.23  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.24 @@ -43,4 +48,3 @@
    1.25  {
    1.26  	cp -a $install/* $fs
    1.27  }
    1.28 -
     2.1 --- a/qb2c/receipt	Sat Oct 16 18:25:56 2021 +0000
     2.2 +++ b/qb2c/receipt	Mon Oct 18 14:47:15 2021 +0000
     2.3 @@ -11,6 +11,12 @@
     2.4  WGET_URL="${WEB_SITE%/}"
     2.5  TAGS="basic C"
     2.6  
     2.7 +current_version()
     2.8 +{
     2.9 +	wget -O - $(dirname $WGET_URL) 2>/dev/null | \
    2.10 +	sed '/qb2c/!d;s|.*qb2c-||;s|.tgz.*||'
    2.11 +}
    2.12 +
    2.13  # Rules to configure and make the package.
    2.14  compile_rules()
    2.15  {
     3.1 --- a/sokojs/stuff/multiset.sh	Sat Oct 16 18:25:56 2021 +0000
     3.2 +++ b/sokojs/stuff/multiset.sh	Mon Oct 18 14:47:15 2021 +0000
     3.3 @@ -1,29 +1,9 @@
     3.4  #!/bin/sh
     3.5  
     3.6 -grep -q 'text/html' level.htm || patch -p0 <<EOT
     3.7 ---- level.htm
     3.8 -+++ level.htm
     3.9 -@@ -22,12 +22,14 @@
    3.10 - <html>
    3.11 - <head>
    3.12 - <title></title>
    3.13 -+<META HTTP-EQUIV="Content Type" CONTENT="text/html;charset=utf-8">
    3.14 - <script type="text/javascript">
    3.15 - <!--
    3.16 - if (parent.frames[0] == null) { document.location = "sokojs.htm"  }
    3.17 --Row=16
    3.18 --Col=16
    3.19 --document.write("<body style=\"margin:0\" bgcolor=\"black\">&nbsp;<b><FONT FACE=\"Comic Sans MS\" SIZE=4 COLOR=\"red\">LEVEL ",
    3.20 -+Row = eval(parent.frames[0].document.forms[1].elements[0].value)
    3.21 -+Col = eval(parent.frames[0].document.forms[1].elements[1].value)
    3.22 -+document.write("<body style=\"margin:0\" bgcolor=\"black\">&nbsp;<b><FONT FACE=\"Comic Sans MS\" SIZE=4 COLOR=\"red\">",
    3.23 -+  parent.frames[0].document.forms[1].elements[2].value," LEVEL ",
    3.24 -   eval(parent.frames[0].document.forms[0].elements[(Row*Col)+1].value) + 1);
    3.25 - 
    3.26 - 
    3.27 +[ -s level.htm ] && rm level.htm && patch -p0 <<EOT
    3.28  --- main.htm
    3.29  +++ main.htm
    3.30 -@@ -11,8 +11,9 @@
    3.31 +@@ -11,8 +11,9 @@ Voir : http://www.gnu.org/licenses/gpl.h
    3.32   -->
    3.33   <html>
    3.34   <head>
    3.35 @@ -34,7 +14,7 @@
    3.36   <!--
    3.37   img.r{
    3.38   width:30px;
    3.39 -@@ -76,19 +77,19 @@
    3.40 +@@ -76,19 +77,19 @@ if (parent.frames[0] == null) { document
    3.41   var ie4= (navigator.appName == "Microsoft Internet Explorer")?1:0;
    3.42   var ns4= (navigator.appName=="Netscape")?1:0;
    3.43   
    3.44 @@ -58,7 +38,7 @@
    3.45       }
    3.46   }
    3.47   
    3.48 -@@ -108,7 +109,7 @@
    3.49 +@@ -108,7 +109,7 @@ function Imajevent(){
    3.50            if (window.event.keyCode == 37) {
    3.51        Move(eval(manpos) - 1)
    3.52     } else if (window.event.keyCode == 38) {
    3.53 @@ -67,7 +47,7 @@
    3.54     } else if (window.event.keyCode == 39) {
    3.55        Move(eval(manpos) + 1)
    3.56     } else if (window.event.keyCode == 40) {
    3.57 -@@ -150,7 +151,7 @@
    3.58 +@@ -150,7 +151,7 @@ manU  = new Image(30, 30); manU.src = "8
    3.59   manD  = new Image(30, 30); manD.src = "9.gif"; // down
    3.60   
    3.61   level = new Array()
    3.62 @@ -76,7 +56,7 @@
    3.63   moves = 0
    3.64   
    3.65   function ReloadLevel() {
    3.66 -@@ -168,14 +169,18 @@
    3.67 +@@ -168,14 +169,18 @@ function ReloadLevel() {
    3.68   
    3.69   function GoLevel(n) {
    3.70     if (n == nbLevel) ReloadLevel()
    3.71 @@ -98,7 +78,7 @@
    3.72   }
    3.73   
    3.74   function print_moves(m) {
    3.75 -@@ -226,7 +231,7 @@
    3.76 +@@ -226,7 +231,7 @@ function Move(a) {
    3.77       if (nbBoxin == 0) {
    3.78         if (nbLevel < maxLevel) {
    3.79           alert("You have done a good job !")
    3.80 @@ -107,7 +87,7 @@
    3.81           GoLevel(nbLevel)
    3.82         } else {
    3.83           alert("Congratulations !")
    3.84 -@@ -246,14 +251,14 @@
    3.85 +@@ -246,14 +251,14 @@ function Move(a) {
    3.86     for (y = 0 ; y < Row; y++) {
    3.87       document.write ("<TR>")
    3.88       for (x = 0; x < Col; x++) {
    3.89 @@ -128,14 +108,18 @@
    3.90       }
    3.91       document.write("<\/TR>")
    3.92     }
    3.93 -@@ -266,8 +271,12 @@
    3.94 +@@ -266,8 +271,16 @@ function Move(a) {
    3.95    document.write("<FORM>",
    3.96     "<INPUT TYPE=button onClick=\"Javascript:ReloadLevel();\" value=\"Restart\">",
    3.97     "<INPUT TYPE=button onClick=\"Javascript:UndoMove();\" value=\"Undo\"><p id=\"moves\" style=\"color:white\">0 moves</p></center>")
    3.98  +  style="style='font-family:Courier New;font-size:14px;font-weight:bold;border:1;border-color:0;padding:0;margin:0px;background-color:#c0c0c0;color:#404040..'"
    3.99  +  document.write("<select id='set' "+style+" onChange=\"Javascript:GoSet();\">")
   3.100 ++  document.write("<option>Change level pack</option>");
   3.101  +  document.write("<option>sokojs</option>");
   3.102 -+    document.write("</select><br />")
   3.103 ++  document.write("</select><br />")
   3.104 ++  document.write("<body style=\"margin:0\" bgcolor=\"black\">&nbsp;<b><FONT FACE=\"Comic Sans MS\" SIZE=4 COLOR=\"red\">",
   3.105 ++    parent.frames[0].document.forms[1].elements[2].value," LEVEL ",
   3.106 ++  eval(parent.frames[0].document.forms[0].elements[(Row*Col)+1].value) + 1,"<br/>")
   3.107     for (i = 0; i <= maxLevel; i++) {
   3.108  -    document.write("<INPUT style='font-family:Courier New;font-size:14px;font-weight:bold;border:1;border-color:0;padding:0;margin:0px;background-color:#c0c0c0;color:#404040รน' TYPE=\"button\" onClick=\"Javascript:GoLevel(", i, ");\" value=\"", (i<9?"&nbsp;":"")+(i+1), "\">")
   3.109  +    document.write("<INPUT "+style+" TYPE=\"button\" onClick=\"Javascript:GoLevel(", i, ");\" value=\"", (i<9?"&nbsp;":"")+(i+1), "\">")
   3.110 @@ -144,7 +128,7 @@
   3.111   
   3.112  --- sokojs.htm
   3.113  +++ sokojs.htm
   3.114 -@@ -22,13 +22,13 @@
   3.115 +@@ -22,14 +22,13 @@ Foundation, Inc., 59 Temple Place - Suit
   3.116   <html>
   3.117   <head>
   3.118   <TITLE>Sokoban (C) Michel Buze</TITLE>
   3.119 @@ -154,16 +138,27 @@
   3.120   <meta name="viewport" content="width=device-width, initial-scale=1">
   3.121   </head>
   3.122   
   3.123 - <frameset border="0" rows="0,700,*">
   3.124 +-<frameset border="0" rows="0,700,*">
   3.125  -<frame src="level0.htm">
   3.126 +-<frame src="0.gif">
   3.127 ++<frameset border="0" rows="0,*">
   3.128  +<frame src="sokojs/level0.htm">
   3.129   <frame src="0.gif">
   3.130 - <frame src="0.gif">
   3.131   <noframes>
   3.132 + <body>
   3.133  EOT
   3.134 -[ -s level0.htm ] && mkdir sokojs && mv level?*.htm sokojs &&
   3.135 -sed -i 's|location = "|&../|;/.*main.htm/i document.write("<FORM ACTION=\\"\\">")\
   3.136 +[ -s level0.htm ] && mkdir sokojs && for l in level*.htm ; do
   3.137 +	col=$(sed '/^Col/!d;s|Col=||' $l)
   3.138 +	pos=$(sed '/write/!d;/value=\\"[0-9]/!d;s|.*value=."||;s|.".*||' $l)
   3.139 +	awk -vx=$(($pos%$col+2)) -vy=$(($pos/$col+10)) '{ c="@"
   3.140 +  if (substr($0,x,1) == ".") c="+"
   3.141 +  if(l++==y) $0=substr($0,1,x-1) c substr($0,x+1)
   3.142 +  print }' < $l | sed -e "s|1)|&.replace('+','.').replace('@','_')|" \
   3.143 +	-e '/level.htm/d;s|location = "|&../|;/.*main.htm/i document.write("<FORM ACTION=\\"\\">")\
   3.144  document.write("<INPUT TYPE=\\"button\\" value=\\""+Row+"\\">",\
   3.145                 "<INPUT TYPE=\\"button\\" value=\\""+Col+"\\">",\
   3.146                 "<INPUT TYPE=\\"button\\" value=\\"sokojs\\">",\
   3.147 -               "<INPUT TYPE=\\"button\\" value=\\"97\\"><\\/FORM>")' sokojs/level*.htm
   3.148 +               "<INPUT TYPE=\\"button\\" value=\\"97\\"><\\/FORM>")' > sokojs/$l
   3.149 +	rm -f $l
   3.150 +done
   3.151 +
     4.1 --- a/sokojs/stuff/slc2htm.sh	Sat Oct 16 18:25:56 2021 +0000
     4.2 +++ b/sokojs/stuff/slc2htm.sh	Mon Oct 18 14:47:15 2021 +0000
     4.3 @@ -1,5 +1,21 @@
     4.4  #!/bin/sh
     4.5  
     4.6 +swap() {
     4.7 +    awk 'BEGIN { n=0 } { l[n++]=$0 } END {
     4.8 + for (i = 0; i < length(l[0]); i++) {
     4.9 +   for (j = 0; j < n; j++) printf "%s", substr(l[j],i+1,1)
    4.10 +   print ""
    4.11 + }}'
    4.12 +}
    4.13 +
    4.14 +filter() {
    4.15 +    sed 's| _|  |;s|_ |  |;s|^_| |;s|_$| |'
    4.16 +}
    4.17 +
    4.18 +check() {
    4.19 +    grep -Eq ' _|_ |^_|_$'
    4.20 +}
    4.21 +
    4.22  [ -z "$1" ] && echo "$0 set1.slc ..." && exit 1
    4.23  [ ! -s "main.htm" ] && echo "$PWD/main.htm not found" && exit 2
    4.24  
    4.25 @@ -32,6 +48,11 @@
    4.26                          height="$(echo "$line" | sed 's|.*Height="||;s|".*||')"
    4.27  			height=$((($row-$height)/2))
    4.28  			l=0
    4.29 +			echo -n "" > $set/tmp0
    4.30 +			while [ $height -gt $l ]; do
    4.31 +				printf "$fmt\n" "" >> "$set/tmp0"
    4.32 +				l=$(($l+1))
    4.33 +			done
    4.34  			cat > "$set/level$level.htm" <<EOT
    4.35  <html>
    4.36  <head>
    4.37 @@ -42,24 +63,29 @@
    4.38  <!--
    4.39  if (parent.frames[0] == null) { document.location = "../sokojs.htm"  }
    4.40  l = new Array(
    4.41 +// $id ${maxwidth}x$maxheight+$((($col-$width)/2))+$height
    4.42  EOT
    4.43 -			prev=""
    4.44  			continue ;;
    4.45  		*\</Level\>) state=""
    4.46  			while [ $row -gt $l ]; do
    4.47 -				printf "\"$fmt\",\n" "$prev" >> "$set/level$level.htm"
    4.48 -				prev=""
    4.49 +				printf "$fmt\n" "" >> "$set/tmp0"
    4.50  				l=$(($l+1))
    4.51  			done
    4.52 +			while swap < $set/tmp0 | check || check < $set/tmp0 ; do
    4.53 +				swap < $set/tmp0 | filter | swap | filter > $set/tmp1
    4.54 +				mv -f $set/tmp1 $set/tmp0
    4.55 +			done
    4.56 +			x=$(($(sed '/[@+]/{s|[@+].*||;q}' $set/tmp0 |\
    4.57 +				 wc -cl | sed 's|^|-|;s|......$|+&|')))
    4.58 +			sed 's|.*|"&",|;$s|,$|);|' $set/tmp0 >> "$set/level$level.htm"
    4.59  			cat >> "$set/level$level.htm" <<EOT
    4.60 -$(printf "\"$fmt\"" "$prev"));
    4.61  
    4.62  Row=$row
    4.63  Col=$col
    4.64  for  (x = 0; x < Row; x++)
    4.65    for  (y = 0; y < Col; y++)
    4.66      document.write("<INPUT TYPE=\"button\" value=\"",
    4.67 -      ' _#*$.'.indexOf(l[x].substring(y, y + 1)), "\">")
    4.68 +      ' _#*$.'.indexOf(l[x].substring(y, y + 1).replace('+','.').replace('@','_')), "\">")
    4.69  document.write("<INPUT TYPE=\"button\" value=\"$x\">",
    4.70                 "<INPUT TYPE=\"button\" value=\"$level\"><\/FORM>")
    4.71  
    4.72 @@ -69,12 +95,12 @@
    4.73                 "<INPUT TYPE=\"button\" value=\"$set\">",
    4.74                 "<INPUT TYPE=\"button\" value=\"COUNT\"><\/FORM>")
    4.75  parent.frames[1].location = "../main.htm"
    4.76 -parent.frames[2].location = "../level.htm"
    4.77  //-->
    4.78  </script></form>
    4.79  </body>
    4.80  </html>
    4.81  EOT
    4.82 +			rm -f $set/tmp*
    4.83  			level=$(($level+1))
    4.84  			continue ;;
    4.85  		esac
    4.86 @@ -82,20 +108,7 @@
    4.87  		Description)
    4.88  			echo "$line" >> "$set/description.txt" ;;
    4.89  		Level)
    4.90 -			[ "$prev" ] && printf "\"$fmt\",$comment\n" "$prev" >> "$set/level$level.htm" ||
    4.91 -			echo "// $id ${maxwidth}x$maxheight+$((($col-$width)/2))+$height" >> "$set/level$level.htm"
    4.92 -			while [ $height -gt 0 ]; do
    4.93 -				printf "\"$fmt\",\n" "" >> "$set/level$level.htm"
    4.94 -				height=$(($height-1))
    4.95 -				l=$(($l+1))
    4.96 -			done
    4.97 -			prev="$(echo "$line" | sed 's|.*<L>||;s|</L>||;:a;s|\([#.+@$\*]_*\) |\1_|;ta')"
    4.98 -			comment=""
    4.99 -			if echo "$prev" | grep -Eq '@|\+'; then
   4.100 -				x=$(($(echo "$prev" | sed 's|[@+].*||' | wc -c)+($l*$col)+($col-$width)/2-1))
   4.101 -				comment=" // $(printf "\"$fmt\"," "$prev") $x"
   4.102 -				prev="$(echo "$prev" | sed 's|\+|.|;s|@|_|')"
   4.103 -			fi
   4.104 +			printf "$fmt\n" "$(echo "$line" | sed 's|.*<L>||;s|</L>||;:a;s|\([#.+@$\*]_*\) |\1_|;ta')" >> "$set/tmp0"
   4.105  			l=$(($l+1))
   4.106  		esac
   4.107  	done < "$file"
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/tnylpo/description.txt	Mon Oct 18 14:47:15 2021 +0000
     5.3 @@ -0,0 +1,5 @@
     5.4 +tnylpo allows the execution of programs written for CP/M-80 version 2.2 under
     5.5 +Unixy operating systems. It has been tested under Linux, and Mac OS X, but
     5.6 +should need little to no modifications to run under any other reasonably
     5.7 +recent system. The companion program tnylpo-convert converts text files to
     5.8 +and from the CP/M format.
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/tnylpo/receipt	Mon Oct 18 14:47:15 2021 +0000
     6.3 @@ -0,0 +1,35 @@
     6.4 +# SliTaz package receipt.
     6.5 +
     6.6 +PACKAGE="tnylpo"
     6.7 +VERSION="1.1.4"
     6.8 +CATEGORY="misc"
     6.9 +SHORT_DESC="Run CP/M-80 programs under Unix/Linux."
    6.10 +MAINTAINER="pascal.bellard@slitaz.org"
    6.11 +LICENSE="BSD"
    6.12 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    6.13 +WEB_SITE="https://gitlab.com/gbrein/tnylpo"
    6.14 +WGET_URL="$WEB_SITE/-/archive/$VERSION/$TARBALL"
    6.15 +
    6.16 +DEPENDS="ncursesw"
    6.17 +BUILD_DEPENDS="ncursesw-dev"
    6.18 +
    6.19 +current_version()
    6.20 +{
    6.21 +	wget -O - ${WGET_URL%/arch*}/tags 2>/dev/null | \
    6.22 +	sed '/tar.gz/!d;s|.*/tnylpo-\(.*\).tar.gz".*|\1|;q'
    6.23 +}
    6.24 +
    6.25 +# Rules to configure and make the package.
    6.26 +compile_rules()
    6.27 +{
    6.28 +	make
    6.29 +}
    6.30 +
    6.31 +# Rules to gen a SliTaz package suitable for Tazpkg.
    6.32 +genpkg_rules()
    6.33 +{
    6.34 +	mkdir -p $fs/usr/bin $install/usr/share/man
    6.35 +	cp -a $src/tnylpo $fs/usr/bin
    6.36 +	cp -a $src/tnylpo-convert $fs/usr/bin
    6.37 +	cp -a $src/tnylpo*.1 $install/usr/share/man
    6.38 +}