summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorAnes Belfodil2019-12-04 11:51:39 -0500
committerAnes Belfodil2019-12-04 11:51:39 -0500
commit15521614aa74ae78bc22740b179698aa765a49b0 (patch)
treebb5a392c025f7e1bab5775b38546d55e687eeb11 /PKGBUILD
parent33a86b6e0cd6a1368e278218cf6bcb549aef1925 (diff)
downloadaur-15521614aa74ae78bc22740b179698aa765a49b0.tar.gz
Delegate binfmt responsibility to binfmt-qemu-static package
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD78
1 files changed, 5 insertions, 73 deletions
diff --git a/PKGBUILD b/PKGBUILD
index a9f939fe5220..fd528430f484 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,14 +2,14 @@ _pkgname=qemu-user-static
pkgdesc='A generic and open source machine emulator, statically linked'
pkgver=4.1
pkgadditver=1+b4
-pkgrel=1
+pkgrel=2
pkgname=$_pkgname-bin
arch=('x86_64' 'i686' 'aarch64')
url="http://wiki.qemu.org"
license=('GPL2' 'LGPL2.1')
-depends=()
-makedepends=('perl')
+depends=('binfmt-qemu-static')
+makedepends=()
provides=("$_pkgname" "qemu-user")
conflicts=("$_pkgname" "qemu-user")
@@ -30,11 +30,9 @@ fi
source=(
"$_debsrc::http://ftp.debian.org/debian/pool/main/q/qemu/$_debsrc"
- "qemu.binfmt" # http://src.fedoraproject.org/rpms/qemu/raw/master/f/qemu.binfmt
)
sha256sums=(
"$_csum"
- '0c1e998022f3306946cd66678f363b10d93b1309c5bbc9f0e6064080a3b604f9'
)
prepare() {
@@ -45,80 +43,14 @@ prepare() {
build() {
cd build
tar -xJf ../data.tar.xz -C .
- create_binfmts
}
package() {
cd build
mkdir -p "$pkgdir"/usr/bin/
- mkdir -p "$pkgdir"/usr/share/man/man1
- mkdir -p "$pkgdir"/usr/lib/binfmt.d
-
cp usr/bin/qemu-*-static "$pkgdir"/usr/bin/
- cp usr/lib/binfmt.d/qemu-*-static.conf "$pkgdir"/usr/lib/binfmt.d/
- cp usr/share/man/man1/qemu-*-static.1.gz "$pkgdir"/usr/share/man/man1/
-}
-
-create_binfmts() {
- rm -Rf usr/lib/binfmt.d
- mkdir -p usr/lib/binfmt.d
-
- # Qemu upstream now has a script to create the binfmt
- # configurations, in ./scripts/qemu-binfmt-conf.sh. We
- # should switch to it, rather than parsing the old
- # Fedora configuration manually.
- for i in \
- aarch64 \
- alpha \
- armeb \
- arm \
- cris \
- i386 \
- i486 \
- m68k \
- microblazeel \
- microblaze \
- mips64el \
- mips64 \
- mipsel \
- mips \
- ppc64abi32 \
- ppc64le \
- ppc64 \
- ppc \
- s390x \
- sh4eb \
- sh4 \
- sparc32plus \
- sparc64 \
- sparc \
- x86_64; do
-
- # Skip emulator of target machine (and dependents)
- if [ "$CARCH" = "$i" ]; then
- continue
- elif [ "$CARCH" = "x86_64" ]; then
- if [ "$i" = "i386" ] ||
- [ "$i" = "i486" ] ||
- [ "$i" = "x86_64" ]; then
- continue
- fi
- elif [ "$CARCH" = "i686" ]; then
- if [ "$i" = "i386" ] ||
- [ "$i" = "i486" ]; then
- continue
- fi
- fi
-
- CFG=$(grep "^:qemu-$i:" "${srcdir}/qemu.binfmt" | tr -d '\n')
- if [ -z "$CFG" ]; then
- continue
- fi
-
- echo -E -n "$CFG" >"usr/lib/binfmt.d/qemu-$i-static.conf"
- perl -i -p -e "s/bin\/qemu-([^:]+):\$/bin\/qemu-\1-static:F/" \
- "usr/lib/binfmt.d/qemu-$i-static.conf"
- done
+ mkdir -p "$pkgdir"/usr/share/man/man1
+ cp usr/share/man/man1/qemu-*-static.1.gz "$pkgdir"/usr/share/man/man1/
}