wok-next view runcom/receipt @ rev 21727

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