wok-next view runcom/receipt @ rev 21020

Cleaning is almost finished... I should proceed to upgrades.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Nov 02 14:15:08 2018 +0200 (2018-11-02)
parents cd7906120828
children d457c4e37c1b
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="http://bellard.org/jslinux"
10 REPOLOGY="-"
12 TAGS="virtual 8086 vm86"
14 compile_rules() {
15 mkdir -p $src
16 cd $src
17 #tarball=$(wget -O - $WEB_SITE/tech.html | \
18 # sed '/linuxstart/!d;s/.*href="\([^"]*\)".*/\1/')
19 #wget $WEB_SITE/$tarball
20 #tar xzf $tarball
21 mkdir -p $install/usr/bin
22 cc -o $install/usr/bin/runcom $stuff/runcom.c
23 cc -o $src/debug.o -Wa,-a=$src/debug.lst -c $stuff/debug.S
24 objcopy -O binary $src/debug.o $install/usr/bin/debug.bin
25 cp $stuff/debug.com $install/usr/bin
26 chmod +x $install/usr/bin/debug.*
27 }
29 genpkg_rules() {
30 cp -a $install/* $fs
31 }
33 post_install() {
34 fmt="binfmt_misc"
35 proc="/proc/sys/fs/binfmt_misc"
36 bin=":BOOTBIN:E::bin::/usr/bin/runcom:"
37 com=":DOSCOM:E::com::/usr/bin/runcom:"
38 cat > /tmp/runcom$$ <<EOT
39 [ ! -e $proc/register ] && modprobe $fmt && mount -t $fmt $fmt $proc
40 echo "$bin" >$proc/register
41 echo "$com" >$proc/register
42 EOT
43 rc="$1/etc/init.d/local.sh"
44 grep -q "$com" $rc || cat /tmp/runcom$$ >> $rc
45 [ -n "$1" ] || . /tmp/runcom$$
46 rm -f /tmp/runcom$$
47 }
49 # Pre remove command for Tazpkg.
50 pre_remove() {
51 echo -1 > /proc/sys/fs/binfmt_misc/BOOTBIN
52 echo -1 > /proc/sys/fs/binfmt_misc/DOSCOM
53 sed -i '/binfmt_misc/{NN;/DOSCOM:E::com/d}' "$1/etc/init.d/local.sh"
54 }