rev |
line source |
pascal@11674
|
1 # SliTaz package receipt.
|
pascal@11674
|
2
|
pascal@11674
|
3 PACKAGE="runcom"
|
pascal@11674
|
4 VERSION="1.0"
|
pascal@11674
|
5 CATEGORY="system-tools"
|
pascal@11674
|
6 SHORT_DESC="DOS .com binary format support"
|
pascal@13025
|
7 MAINTAINER="devel@slitaz.org"
|
pascal@14781
|
8 LICENSE="GPL"
|
pascal@11674
|
9 WEB_SITE="http://bellard.org/jslinux"
|
pascal@11674
|
10
|
pascal@11674
|
11 # Rules to configure and make the package.
|
pascal@11674
|
12 compile_rules()
|
pascal@11674
|
13 {
|
pascal@11674
|
14 mkdir -p $src
|
pascal@11674
|
15 cd $src
|
pascal@11674
|
16 #tarball=$(wget -O - $WEB_SITE/tech.html | \
|
pascal@11674
|
17 # sed '/linuxstart/!d;s/.*href="\([^"]*\)".*/\1/')
|
pascal@11674
|
18 #wget $WEB_SITE/$tarball
|
pascal@11674
|
19 #tar xzf $tarball
|
pascal@11674
|
20 mkdir -p $DESTDIR/usr/bin
|
pascal@11674
|
21 cc -o $DESTDIR/usr/bin/runcom $stuff/runcom.c
|
pascal@11674
|
22 cc -o $src/debug.o -Wa,-a=$src/debug.lst -c $stuff/debug.S
|
pascal@11674
|
23 objcopy -O binary $src/debug.o $DESTDIR/usr/bin/debug.bin
|
pascal@11674
|
24 cp $stuff/debug.com $DESTDIR/usr/bin
|
pascal@11674
|
25 chmod +x $DESTDIR/usr/bin/debug.*
|
pascal@11674
|
26 }
|
pascal@11674
|
27
|
pascal@11674
|
28 # Rules to gen a SliTaz package suitable for Tazpkg.
|
pascal@11674
|
29 genpkg_rules()
|
pascal@11674
|
30 {
|
pascal@15603
|
31 cp -a $install/* $fs
|
pascal@11674
|
32 }
|
pascal@11674
|
33
|
pascal@11674
|
34 # Post install command for Tazpkg.
|
pascal@11674
|
35 post_install()
|
pascal@11674
|
36 {
|
pascal@11674
|
37 fmt="binfmt_misc"
|
pascal@11674
|
38 proc="/proc/sys/fs/binfmt_misc"
|
pascal@11674
|
39 bin=":BOOTBIN:E::bin::/usr/bin/runcom:"
|
pascal@11674
|
40 com=":DOSCOM:E::com::/usr/bin/runcom:"
|
pascal@11685
|
41 cat > /tmp/runcom$$ <<EOT
|
pascal@11674
|
42 [ ! -e $proc/register ] && modprobe $fmt && mount -t $fmt $fmt $proc
|
pascal@11674
|
43 echo "$bin" >$proc/register
|
pascal@11674
|
44 echo "$com" >$proc/register
|
pascal@11674
|
45 EOT
|
pascal@11685
|
46 rc="$1/etc/init.d/local.sh"
|
pascal@11685
|
47 grep -q "$com" $rc || cat /tmp/runcom$$ >> $rc
|
pascal@11685
|
48 [ -n "$1" ] || . /tmp/runcom$$
|
pascal@11685
|
49 rm -f /tmp/runcom$$
|
pascal@11674
|
50 }
|
pascal@11674
|
51
|
pascal@11674
|
52 # Pre remove command for Tazpkg.
|
pascal@11674
|
53 pre_remove()
|
pascal@11674
|
54 {
|
pascal@11674
|
55 echo -1 > $1/proc/sys/fs/binfmt_misc/BOOTBIN
|
pascal@11674
|
56 echo -1 > $1/proc/sys/fs/binfmt_misc/DOSCOM
|
pascal@11674
|
57 sed -i '/binfmt_misc/{NN;/DOSCOM:E::com/d}' $1/etc/init.d/local.sh
|
pascal@11674
|
58 }
|