wok-next annotate dev86/receipt @ rev 21727

created recipe for vbindiff
author Hans-G?nter Theisgen
date Sat Nov 21 14:32:44 2020 +0100 (2020-11-21)
parents 917cbaa57ad2
children
rev   line source
al@20463 1 # SliTaz package receipt v2.
pascal@1720 2
pascal@1720 3 PACKAGE="dev86"
pascal@18094 4 VERSION="0.16.21"
pascal@1720 5 CATEGORY="development"
al@20463 6 SHORT_DESC="Linux 8086 development environment"
pascal@1720 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@14801 8 LICENSE="GPL2"
pascal@1720 9 WEB_SITE="http://www.debath.co.uk/"
pascal@1720 10
al@19663 11 TARBALL="$PACKAGE-$VERSION.tar.gz"
al@19663 12 WGET_URL="$GITHUB/lkundrak/dev86/tarball/v$VERSION"
al@19663 13
al@19663 14 BUILD_DEPENDS="coreutils-file-output-full" # for `cat -v`
al@21020 15 SPLIT="elksemu $PACKAGE"
al@20628 16 case $ARCH in
al@20628 17 # elksemu isn't supported on x86-64, see:
al@20628 18 # /usr/include/sys/vm86.h:24:3: error: #error This header is unsupported on x86-64.
al@20628 19 x86_64) unset SPLIT;;
al@20628 20 esac
pascal@18094 21
al@20463 22 compile_rules() {
pascal@19284 23 sed -i 's|/usr/man|/usr/share/man|' man/Makefile
pascal@19284 24 sed -i 's|REFIX)/man|REFIX)/share/man|' Makefile */Makefile
al@20628 25 make -j1 PREFIX=/usr &&
al@21020 26 make -j1 DIST=$install install || return 1
al@20628 27
al@20628 28 install -Dm755 $stuff/com2exe $install/usr/bin/com2exe
pascal@1720 29 }
pascal@1720 30
al@20463 31 genpkg_rules() {
al@20463 32 case $PACKAGE in
al@20628 33 elksemu)
al@20628 34 copy elksemu
al@20628 35 CAT="system-tools|Embedded Linux Kernel Subset emulator"
al@20628 36 TAGS="virtual 8086 vm86"
al@20628 37 ;;
al@20463 38 dev86)
al@20628 39 copy @std @dev @rm
al@20463 40 TAGS="compiler C assembler 8086"
al@20463 41 ;;
al@20463 42 esac
pascal@1720 43 }
pascal@1720 44
al@20463 45 post_install_dev86() {
pascal@18094 46 [ "$1" ] && return
pascal@18094 47 register=/proc/sys/fs/binfmt_misc/register
al@20463 48 [ -f $register ] || modprobe binfmt_misc 2>/dev/null || true
pascal@18094 49 [ -f $register ] && cat > $register <<EOT
pascal@11651 50 :i86-elks:M::\x01\x03\x20\x00:\xff\xff\xff\x83:/usr/bin/elksemu:
pascal@11651 51 EOT
al@19663 52 true
pascal@11651 53 }
al@20463 54
al@20463 55 post_install_elksemu() {
al@20463 56 fmt="binfmt_misc"
al@20463 57 proc="/proc/sys/fs/binfmt_misc"
al@20463 58 cat > /tmp/runelks$$ <<EOT
al@20463 59 [ ! -e $proc/register ] && modprobe $fmt && mount -t $fmt $fmt $proc
al@20463 60 echo ':i86-elks:M::\x01\x03\x20\x00:\xff\xff\xff\x83:/usr/bin/elksemu:' >$proc/register
al@20463 61 EOT
al@20463 62 rc="$1/etc/init.d/local.sh"
al@20463 63 grep -q ':i86-elks:M:' $rc || cat /tmp/runelks$$ >> $rc
al@20463 64 [ -n "$1" ] || . /tmp/runelks$$
al@20463 65 rm -f /tmp/runelks$$
al@20463 66 }
al@20463 67
al@20463 68 pre_remove_elksemu() {
al@20463 69 echo -1 > /proc/sys/fs/binfmt_misc/i86-elks
al@20463 70 sed -i '/binfmt_misc/{N;/:i86-elks:M:/d}' "$1/etc/init.d/local.sh"
al@20463 71 }