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