summaryrefslogtreecommitdiff
path: root/binfmt-qemu-static-all-arch/PKGBUILD
blob: ce877d730c1e3fdd55eca7acf478c0e8f81d11d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Michael Taboada <michael@2mb.solutions>

# ist alles absichtlich nicht any ohne ELF Dateien

pkgname=binfmt-qemu-static-all-arch
pkgver=20220117
pkgrel=1
pkgdesc="Register qemu-static interpreters for various binary formats - all archetectures, intelligently removing the current archetecture"
arch=('armv5' 'armv6h' 'armv7h' 'aarch64' 'i686' 'pentium4' 'x86_64')
url="http://www.freedesktop.org/software/systemd/man/binfmt.d.html"
license=('GPL')
optdepends=('qemu-user-static')
provides=('binfmt-qemu-static')
conflicts=('binfmt-qemu-static')
source=("qemu-binfmt-conf-$pkgver.sh::https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh")
sha512sums=('e8ea38fadbdd7d2a3735da1a757a615575356c3b87e70059a60b6213a113fcdfa0a467b81d5703e35ca2be48295af21d817af347a53d5ebd7bf582816dfba1bd')

build() {
  mkdir build
  chmod +x "qemu-binfmt-conf-$pkgver.sh"
  HOST_ARCH="$CARCH" "./qemu-binfmt-conf-$pkgver.sh" --systemd ALL --exportdir "$srcdir/build" --qemu-path /usr/bin --qemu-suffix -static
  cat build/* \
  | sed 's/$/CF/' \
  > qemu-static.conf
}

package() {
  install -Dm 644 "$srcdir/qemu-static.conf" "$pkgdir/usr/lib/binfmt.d/qemu-static.conf"
  case $CARCH in
    arm* | aarch64) sed -i "/qemu-arm/d" "$pkgdir/usr/lib/binfmt.d/qemu-static.conf" ;&
    aarch64) sed -i "/qemu-aarch64/d" "$pkgdir/usr/lib/binfmt.d/qemu-static.conf" ;;
    i686 | x86_64) sed -i "/qemu-i386/d" "$pkgdir/usr/lib/binfmt.d/qemu-static.conf" ;  sed -i "/qemu-x86_64/d" "$pkgdir/usr/lib/binfmt.d/qemu-static.conf" ;;
    *) sed -i "/$CARCH/d" "$pkgdir/usr/lib/binfmt.d/qemu-static.conf" ;;
  esac
}

# vim:set ts=2 sw=2 et: