wok annotate emu2/receipt @ rev 25770
dool,fake-hwclock,gtkam,xfce4-*-plugin,xlogo: add current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Sep 06 11:29:23 2024 +0000 (2 months ago) |
parents | 8ac6f7029d68 |
children |
rev | line source |
---|---|
pascal@25616 | 1 # SliTaz package receipt. |
pascal@25616 | 2 |
pascal@25616 | 3 PACKAGE="emu2" |
pascal@25616 | 4 VERSION="2021.01" |
pascal@25616 | 5 CATEGORY="system-tools" |
pascal@25616 | 6 TAGS="emulator dos vm86 8086" |
pascal@25616 | 7 SHORT_DESC="Simple x86 and DOS emulator for the Linux terminal." |
pascal@25616 | 8 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@25616 | 9 LICENSE="GPL2" |
pascal@25616 | 10 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pascal@25616 | 11 WEB_SITE="https://github.com/dmsc/emu2" |
pascal@25616 | 12 WGET_URL="$WEB_SITE/archive/v$VERSION.tar.gz" |
pascal@25616 | 13 |
pascal@25616 | 14 BUILD_DEPENDS="gcc83" |
pascal@25616 | 15 |
pascal@25616 | 16 # What is the latest version available today? |
pascal@25616 | 17 current_version() |
pascal@25616 | 18 { |
pascal@25616 | 19 wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \ |
pascal@25616 | 20 sed '/tag\//!d;s|.*tag/v*||;s|".*||;q' |
pascal@25616 | 21 } |
pascal@25616 | 22 |
pascal@25616 | 23 # Rules to configure and make the package. |
pascal@25616 | 24 compile_rules() |
pascal@25616 | 25 { |
pascal@25624 | 26 cp $stuff/* src |
pascal@25647 | 27 sed -i '/HALT instruction/{N;s|.*|/*& */|}' src/cpu.c |
pascal@25616 | 28 mkdir obj |
pascal@25616 | 29 make CC=gcc-83 DESTDIR=$DESTDIR install |
pascal@25616 | 30 } |
pascal@25616 | 31 |
pascal@25616 | 32 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@25616 | 33 genpkg_rules() |
pascal@25616 | 34 { |
pascal@25616 | 35 mkdir -p $install/usr/doc $fs/usr |
pascal@25616 | 36 cp $src/README.md $install/usr/doc |
pascal@25616 | 37 cp -a $install/usr/bin $fs/usr |
pascal@25616 | 38 } |
pascal@25647 | 39 |
pascal@25647 | 40 # Post install command for Tazpkg. |
pascal@25647 | 41 post_install() |
pascal@25647 | 42 { |
pascal@25647 | 43 fmt="binfmt_misc" |
pascal@25647 | 44 proc="/proc/sys/fs/binfmt_misc" |
pascal@25647 | 45 exe=":EMU2:E::exe::/usr/bin/emu2:" |
pascal@25647 | 46 com=":EMU2:E::com::/usr/bin/emu2:" |
pascal@25647 | 47 cat > /tmp/runcom$$ <<EOT |
pascal@25647 | 48 [ ! -e $proc/register ] && modprobe $fmt && mount -t $fmt $fmt $proc |
pascal@25647 | 49 echo "$exe" >$proc/register |
pascal@25647 | 50 echo "$com" >$proc/register |
pascal@25647 | 51 EOT |
pascal@25647 | 52 rc="$1/etc/init.d/local.sh" |
pascal@25647 | 53 grep -q "$com" $rc || cat /tmp/runcom$$ >> $rc |
pascal@25647 | 54 [ -n "$1" ] || . /tmp/runcom$$ |
pascal@25647 | 55 rm -f /tmp/runcom$$ |
pascal@25647 | 56 } |
pascal@25647 | 57 |
pascal@25647 | 58 # Pre remove command for Tazpkg. |
pascal@25647 | 59 pre_remove() |
pascal@25647 | 60 { |
pascal@25647 | 61 echo -1 > /proc/sys/fs/binfmt_misc/EMU2 |
pascal@25647 | 62 sed -i '/binfmt_misc/{NN;/EMU2:E::com/d}' "$1/etc/init.d/local.sh" |
pascal@25647 | 63 } |