wok-current rev 13117
dev86: add com2exe
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jul 01 13:52:12 2012 +0200 (2012-07-01) |
parents | eba86f42424e |
children | f5e71a92c2a8 |
files | dev86/receipt dev86/stuff/com2exe |
line diff
1.1 --- a/dev86/receipt Sat Jun 30 23:41:46 2012 +0200 1.2 +++ b/dev86/receipt Sun Jul 01 13:52:12 2012 +0200 1.3 @@ -19,7 +19,7 @@ 1.4 # Be busybox compatible 1.5 sed -i 's/ | cat -v//' libcompat 1.6 echo q | make -j 1 PREFIX=/usr && 1.7 - make -j 1 DIST=$PWD/_pkg install 1.8 + make -j 1 DIST=$DESTDIR install 1.9 } 1.10 1.11 # Rules to gen a SliTaz package suitable for Tazpkg. 1.12 @@ -28,6 +28,7 @@ 1.13 mkdir -p $fs/usr 1.14 cp -a $_pkg/usr/bin $fs/usr 1.15 cp -a $_pkg/usr/lib $fs/usr 1.16 + cp -a $stuff/com2exe $fs/usr/bin 1.17 } 1.18 1.19 # Pre and post install commands for Tazpkg.
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/dev86/stuff/com2exe Sun Jul 01 13:52:12 2012 +0200 2.3 @@ -0,0 +1,10 @@ 2.4 +#!/bin/sh 2.5 + 2.6 +[ ! -s "$1" ] && echo "Usage: $0 file.com > file.exe" && exit 1 2.7 +S=$(stat -c %s $1) 2.8 +P=$((($S+511)/512)) 2.9 +E=$((4096-(32*$P))) 2.10 +for i in 0x5A4D $(($S%512)) $P 0 2 $E $E -16 -2 0 256 -16 28 0 0 0 2.11 +do printf '\\\\x%02X\\\\x%02X' $(($i&255)) $((($i>>8)&255)) | xargs echo -en 2.12 +done 2.13 +cat $1