wok-4.x view runcom/receipt @ rev 11674
add runcom
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Feb 18 09:00:05 2012 +0100 (2012-02-18) |
parents | |
children | 5d74983842db |
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="dev@slitaz.org"
8 WEB_SITE="http://bellard.org/jslinux"
10 # Rules to configure and make the package.
11 compile_rules()
12 {
13 mkdir -p $src
14 cd $src
15 #tarball=$(wget -O - $WEB_SITE/tech.html | \
16 # sed '/linuxstart/!d;s/.*href="\([^"]*\)".*/\1/')
17 #wget $WEB_SITE/$tarball
18 #tar xzf $tarball
19 mkdir -p $DESTDIR/usr/bin
20 cc -o $DESTDIR/usr/bin/runcom $stuff/runcom.c
21 cc -o $src/debug.o -Wa,-a=$src/debug.lst -c $stuff/debug.S
22 objcopy -O binary $src/debug.o $DESTDIR/usr/bin/debug.bin
23 cp $stuff/debug.com $DESTDIR/usr/bin
24 chmod +x $DESTDIR/usr/bin/debug.*
25 }
27 # Rules to gen a SliTaz package suitable for Tazpkg.
28 genpkg_rules()
29 {
30 cp -a $_pkg/* $fs
31 }
33 # Post install command for Tazpkg.
34 post_install()
35 {
36 fmt="binfmt_misc"
37 proc="/proc/sys/fs/binfmt_misc"
38 bin=":BOOTBIN:E::bin::/usr/bin/runcom:"
39 com=":DOSCOM:E::com::/usr/bin/runcom:"
40 rc="$1/etc/init.d/local.sh"
41 grep -q "$com" $rc || cat >> $rc <<EOT
42 [ ! -e $proc/register ] && modprobe $fmt && mount -t $fmt $fmt $proc
43 echo "$bin" >$proc/register
44 echo "$com" >$proc/register
45 EOT
46 [ -n "$1" ] && return
47 [ ! -e $proc/register ] && modprobe $fmt && mount -t $fmt $fmt $proc
48 echo "$bin" >$proc/register
49 echo "$com" >$proc/register
50 }
52 # Pre remove command for Tazpkg.
53 pre_remove()
54 {
55 echo -1 > $1/proc/sys/fs/binfmt_misc/BOOTBIN
56 echo -1 > $1/proc/sys/fs/binfmt_misc/DOSCOM
57 sed -i '/binfmt_misc/{NN;/DOSCOM:E::com/d}' $1/etc/init.d/local.sh
58 }