wok-next view runcom/receipt @ rev 20944

Fix versions to follow some uniform way
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Aug 31 01:31:07 2018 +0300 (2018-08-31)
parents ed8073aa8cf0
children d5aab818505e
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 # Rules to configure and make the package.
15 compile_rules()
16 {
17 mkdir -p $src
18 cd $src
19 #tarball=$(wget -O - $WEB_SITE/tech.html | \
20 # sed '/linuxstart/!d;s/.*href="\([^"]*\)".*/\1/')
21 #wget $WEB_SITE/$tarball
22 #tar xzf $tarball
23 mkdir -p $DESTDIR/usr/bin
24 cc -o $DESTDIR/usr/bin/runcom $stuff/runcom.c
25 cc -o $src/debug.o -Wa,-a=$src/debug.lst -c $stuff/debug.S
26 objcopy -O binary $src/debug.o $DESTDIR/usr/bin/debug.bin
27 cp $stuff/debug.com $DESTDIR/usr/bin
28 chmod +x $DESTDIR/usr/bin/debug.*
29 }
31 # Rules to gen a SliTaz package suitable for Tazpkg.
32 genpkg_rules()
33 {
34 cp -a $install/* $fs
35 }
37 # Post install command for Tazpkg.
38 post_install()
39 {
40 fmt="binfmt_misc"
41 proc="/proc/sys/fs/binfmt_misc"
42 bin=":BOOTBIN:E::bin::/usr/bin/runcom:"
43 com=":DOSCOM:E::com::/usr/bin/runcom:"
44 cat > /tmp/runcom$$ <<EOT
45 [ ! -e $proc/register ] && modprobe $fmt && mount -t $fmt $fmt $proc
46 echo "$bin" >$proc/register
47 echo "$com" >$proc/register
48 EOT
49 rc="$1/etc/init.d/local.sh"
50 grep -q "$com" $rc || cat /tmp/runcom$$ >> $rc
51 [ -n "$1" ] || . /tmp/runcom$$
52 rm -f /tmp/runcom$$
53 }
55 # Pre remove command for Tazpkg.
56 pre_remove()
57 {
58 echo -1 > /proc/sys/fs/binfmt_misc/BOOTBIN
59 echo -1 > /proc/sys/fs/binfmt_misc/DOSCOM
60 sed -i '/binfmt_misc/{NN;/DOSCOM:E::com/d}' "$1/etc/init.d/local.sh"
61 }