wok-next view runcom/receipt @ rev 14388

embryo: update deps
author Dominique Corbex <domcox@slitaz.org>
date Tue Apr 23 07:01:23 2013 +0200 (2013-04-23)
parents 5d74983842db
children a436a235f098
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 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 cat > /tmp/runcom$$ <<EOT
41 [ ! -e $proc/register ] && modprobe $fmt && mount -t $fmt $fmt $proc
42 echo "$bin" >$proc/register
43 echo "$com" >$proc/register
44 EOT
45 rc="$1/etc/init.d/local.sh"
46 grep -q "$com" $rc || cat /tmp/runcom$$ >> $rc
47 [ -n "$1" ] || . /tmp/runcom$$
48 rm -f /tmp/runcom$$
49 }
51 # Pre remove command for Tazpkg.
52 pre_remove()
53 {
54 echo -1 > $1/proc/sys/fs/binfmt_misc/BOOTBIN
55 echo -1 > $1/proc/sys/fs/binfmt_misc/DOSCOM
56 sed -i '/binfmt_misc/{NN;/DOSCOM:E::com/d}' $1/etc/init.d/local.sh
57 }