wok diff runcom/receipt @ rev 11680

Up: stella to 3.5.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat Feb 18 08:13:30 2012 -0500 (2012-02-18)
parents
children 5d74983842db
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/runcom/receipt	Sat Feb 18 08:13:30 2012 -0500
     1.3 @@ -0,0 +1,58 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="runcom"
     1.7 +VERSION="1.0"
     1.8 +CATEGORY="system-tools"
     1.9 +SHORT_DESC="DOS .com binary format support"
    1.10 +MAINTAINER="dev@slitaz.org"
    1.11 +WEB_SITE="http://bellard.org/jslinux"
    1.12 +
    1.13 +# Rules to configure and make the package.
    1.14 +compile_rules()
    1.15 +{
    1.16 +	mkdir -p $src
    1.17 +	cd $src
    1.18 +	#tarball=$(wget -O - $WEB_SITE/tech.html | \
    1.19 +	#	  sed '/linuxstart/!d;s/.*href="\([^"]*\)".*/\1/')
    1.20 +	#wget $WEB_SITE/$tarball
    1.21 +	#tar xzf $tarball
    1.22 +	mkdir -p $DESTDIR/usr/bin
    1.23 +	cc -o $DESTDIR/usr/bin/runcom $stuff/runcom.c
    1.24 +	cc -o $src/debug.o -Wa,-a=$src/debug.lst -c $stuff/debug.S
    1.25 +	objcopy -O binary $src/debug.o $DESTDIR/usr/bin/debug.bin
    1.26 +	cp $stuff/debug.com $DESTDIR/usr/bin
    1.27 +	chmod +x $DESTDIR/usr/bin/debug.*
    1.28 +}
    1.29 +
    1.30 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.31 +genpkg_rules()
    1.32 +{
    1.33 +	cp -a $_pkg/* $fs
    1.34 +}
    1.35 +
    1.36 +# Post install command for Tazpkg.
    1.37 +post_install()
    1.38 +{
    1.39 +	fmt="binfmt_misc"
    1.40 +	proc="/proc/sys/fs/binfmt_misc"
    1.41 +	bin=":BOOTBIN:E::bin::/usr/bin/runcom:"
    1.42 +	com=":DOSCOM:E::com::/usr/bin/runcom:"
    1.43 +	rc="$1/etc/init.d/local.sh"
    1.44 +	grep -q "$com" $rc || cat >> $rc <<EOT
    1.45 +[ ! -e $proc/register ] && modprobe $fmt && mount -t $fmt $fmt $proc
    1.46 +echo "$bin" >$proc/register
    1.47 +echo "$com" >$proc/register
    1.48 +EOT
    1.49 +	[ -n "$1" ] && return
    1.50 +	[ ! -e $proc/register ] && modprobe $fmt && mount -t $fmt $fmt $proc
    1.51 +	echo "$bin" >$proc/register
    1.52 +	echo "$com" >$proc/register
    1.53 +}
    1.54 +
    1.55 +# Pre remove command for Tazpkg.
    1.56 +pre_remove()
    1.57 +{
    1.58 +	echo -1 > $1/proc/sys/fs/binfmt_misc/BOOTBIN
    1.59 +	echo -1 > $1/proc/sys/fs/binfmt_misc/DOSCOM
    1.60 +	sed -i '/binfmt_misc/{NN;/DOSCOM:E::com/d}' $1/etc/init.d/local.sh
    1.61 +}