wok-current view runcom/receipt @ rev 15648
Up libparserutils (0.1.1)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Dec 10 15:54:17 2013 +0000 (2013-12-10) |
parents | a436a235f098 |
children | 4e519df1c7b9 |
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"
11 # Rules to configure and make the package.
12 compile_rules()
13 {
14 mkdir -p $src
15 cd $src
16 #tarball=$(wget -O - $WEB_SITE/tech.html | \
17 # sed '/linuxstart/!d;s/.*href="\([^"]*\)".*/\1/')
18 #wget $WEB_SITE/$tarball
19 #tar xzf $tarball
20 mkdir -p $DESTDIR/usr/bin
21 cc -o $DESTDIR/usr/bin/runcom $stuff/runcom.c
22 cc -o $src/debug.o -Wa,-a=$src/debug.lst -c $stuff/debug.S
23 objcopy -O binary $src/debug.o $DESTDIR/usr/bin/debug.bin
24 cp $stuff/debug.com $DESTDIR/usr/bin
25 chmod +x $DESTDIR/usr/bin/debug.*
26 }
28 # Rules to gen a SliTaz package suitable for Tazpkg.
29 genpkg_rules()
30 {
31 cp -a $install/* $fs
32 }
34 # Post install command for Tazpkg.
35 post_install()
36 {
37 fmt="binfmt_misc"
38 proc="/proc/sys/fs/binfmt_misc"
39 bin=":BOOTBIN:E::bin::/usr/bin/runcom:"
40 com=":DOSCOM:E::com::/usr/bin/runcom:"
41 cat > /tmp/runcom$$ <<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 rc="$1/etc/init.d/local.sh"
47 grep -q "$com" $rc || cat /tmp/runcom$$ >> $rc
48 [ -n "$1" ] || . /tmp/runcom$$
49 rm -f /tmp/runcom$$
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 }