# HG changeset patch # User Pascal Bellard # Date 1341143532 -7200 # Node ID b43c047cc732952644435dedc827e36cce21646c # Parent eba86f42424edd726e79828ec4093bcb256e4f67 dev86: add com2exe diff -r eba86f42424e -r b43c047cc732 dev86/receipt --- a/dev86/receipt Sat Jun 30 23:41:46 2012 +0200 +++ b/dev86/receipt Sun Jul 01 13:52:12 2012 +0200 @@ -19,7 +19,7 @@ # Be busybox compatible sed -i 's/ | cat -v//' libcompat echo q | make -j 1 PREFIX=/usr && - make -j 1 DIST=$PWD/_pkg install + make -j 1 DIST=$DESTDIR install } # Rules to gen a SliTaz package suitable for Tazpkg. @@ -28,6 +28,7 @@ mkdir -p $fs/usr cp -a $_pkg/usr/bin $fs/usr cp -a $_pkg/usr/lib $fs/usr + cp -a $stuff/com2exe $fs/usr/bin } # Pre and post install commands for Tazpkg. diff -r eba86f42424e -r b43c047cc732 dev86/stuff/com2exe --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev86/stuff/com2exe Sun Jul 01 13:52:12 2012 +0200 @@ -0,0 +1,10 @@ +#!/bin/sh + +[ ! -s "$1" ] && echo "Usage: $0 file.com > file.exe" && exit 1 +S=$(stat -c %s $1) +P=$((($S+511)/512)) +E=$((4096-(32*$P))) +for i in 0x5A4D $(($S%512)) $P 0 2 $E $E -16 -2 0 256 -16 28 0 0 0 +do printf '\\\\x%02X\\\\x%02X' $(($i&255)) $((($i>>8)&255)) | xargs echo -en +done +cat $1