wok-next annotate runcom/receipt @ rev 21451

updated snownews (1.5.12 -> 1.6.10)
author Hans-G?nter Theisgen
date Thu May 07 13:19:49 2020 +0100 (2020-05-07)
parents 49205cea4356
children
rev   line source
pascal@11674 1 # SliTaz package receipt.
pascal@11674 2
pascal@11674 3 PACKAGE="runcom"
pascal@11674 4 VERSION="1.0"
pascal@11674 5 CATEGORY="system-tools"
pascal@11674 6 SHORT_DESC="DOS .com binary format support"
pascal@13025 7 MAINTAINER="devel@slitaz.org"
pascal@14781 8 LICENSE="GPL"
al@21041 9 WEB_SITE="https://bellard.org/jslinux/"
al@21058 10 HOST_ARCH="i486"
al@20888 11 REPOLOGY="-"
al@20888 12
pascal@16678 13 TAGS="virtual 8086 vm86"
pascal@11674 14
al@21058 15 # Error on x86_64:
al@21058 16 # ${stuff}/runcom.c: In function 'vm86':
al@21058 17 # ${stuff}/runcom.c:31:20: error: '__NR_vm86' undeclared (first use in this function); did you mean '__NR_mmap'?
al@21058 18 # return syscall(__NR_vm86, func, v86);
al@21058 19
al@21020 20 compile_rules() {
pascal@11674 21 mkdir -p $src
pascal@11674 22 cd $src
pascal@11674 23 #tarball=$(wget -O - $WEB_SITE/tech.html | \
pascal@11674 24 # sed '/linuxstart/!d;s/.*href="\([^"]*\)".*/\1/')
pascal@11674 25 #wget $WEB_SITE/$tarball
pascal@11674 26 #tar xzf $tarball
al@21055 27 # may use web archive: https://web.archive.org/web/20161227063415/http://bellard.org/jslinux/tech.html
al@21055 28
al@21020 29 mkdir -p $install/usr/bin
al@21055 30 cc -o $install/usr/bin/runcom $stuff/runcom.c &&
al@21055 31
al@21055 32 cc -o $src/debug.o -Wa,-a=$src/debug.lst -c $stuff/debug.S &&
al@21055 33 objcopy -O binary $src/debug.o $install/usr/bin/debug.bin &&
al@21055 34
al@21055 35 cp $stuff/debug.com $install/usr/bin &&
al@21020 36 chmod +x $install/usr/bin/debug.*
pascal@11674 37 }
pascal@11674 38
al@21020 39 genpkg_rules() {
pascal@15603 40 cp -a $install/* $fs
pascal@11674 41 }
pascal@11674 42
al@21020 43 post_install() {
pascal@11674 44 fmt="binfmt_misc"
pascal@11674 45 proc="/proc/sys/fs/binfmt_misc"
pascal@11674 46 bin=":BOOTBIN:E::bin::/usr/bin/runcom:"
pascal@11674 47 com=":DOSCOM:E::com::/usr/bin/runcom:"
pascal@11685 48 cat > /tmp/runcom$$ <<EOT
pascal@11674 49 [ ! -e $proc/register ] && modprobe $fmt && mount -t $fmt $fmt $proc
pascal@11674 50 echo "$bin" >$proc/register
pascal@11674 51 echo "$com" >$proc/register
pascal@11674 52 EOT
pascal@11685 53 rc="$1/etc/init.d/local.sh"
pascal@11685 54 grep -q "$com" $rc || cat /tmp/runcom$$ >> $rc
pascal@11685 55 [ -n "$1" ] || . /tmp/runcom$$
pascal@11685 56 rm -f /tmp/runcom$$
pascal@11674 57 }
pascal@11674 58
pascal@11674 59 # Pre remove command for Tazpkg.
al@21020 60 pre_remove() {
pascal@18732 61 echo -1 > /proc/sys/fs/binfmt_misc/BOOTBIN
pascal@18732 62 echo -1 > /proc/sys/fs/binfmt_misc/DOSCOM
pascal@18730 63 sed -i '/binfmt_misc/{NN;/DOSCOM:E::com/d}' "$1/etc/init.d/local.sh"
pascal@11674 64 }