aboutsummaryrefslogtreecommitdiffstats
path: root/main/qemu
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-06-26 16:19:57 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2016-06-27 11:18:18 +0000
commitdf5391682cccc4241cb447723725bda11aeccc13 (patch)
tree399f4c1b006d23b757a3ebfe924a5d545f442304 /main/qemu
parent41e38db75810a3d58005c6f1f3745e117c5011a6 (diff)
downloadaports-df5391682cccc4241cb447723725bda11aeccc13.tar.bz2
aports-df5391682cccc4241cb447723725bda11aeccc13.tar.xz
main/qemu: improve abuild, simplify splitting of subsystems etc.
Diffstat (limited to 'main/qemu')
-rw-r--r--main/qemu/APKBUILD34
1 files changed, 19 insertions, 15 deletions
diff --git a/main/qemu/APKBUILD b/main/qemu/APKBUILD
index 6824403bc4..66e379f190 100644
--- a/main/qemu/APKBUILD
+++ b/main/qemu/APKBUILD
@@ -101,8 +101,7 @@ _subsystems="
x86_64
"
for _sub in $_subsystems; do
- subpackages="$subpackages $pkgname-$_sub:${_sub//-/_}"
- eval "${_sub//-/_}() { _subsys $_sub; }"
+ subpackages="$subpackages $pkgname-$_sub:_subsys"
done
case "$CARCH" in
@@ -210,10 +209,13 @@ build() {
package() {
cd "$builddir"/build
+
make DESTDIR="$pkgdir" install || return 1
+ paxmark -m "$pkgdir"/usr/bin/qemu-system-* || return 1
+
install -Dm644 "$srcdir"/80-kvm.rules \
"$pkgdir"/lib/udev/rules.d/80-kvm.rules || return 1
- paxmark -m "$pkgdir"/usr/bin/qemu-system-* || return 1
+
gzip "$pkgdir"/usr/share/man/man1/*
gzip "$pkgdir"/usr/share/man/man8/*
@@ -230,12 +232,13 @@ package() {
}
_subsys() {
- pkgdesc="Qemu ${1/-/ } emulator"
+ local name=${1:-"${subpkgname#$pkgname-}"}
+ pkgdesc="Qemu ${name/-/ } emulator"
depends="qemu"
options=""
mkdir -p "$subpkgdir"/usr/bin
- mv "$pkgdir"/usr/bin/qemu-$1 "$subpkgdir"/usr/bin/ || return 1
+ mv "$pkgdir"/usr/bin/qemu-$name "$subpkgdir"/usr/bin/
}
img() {
@@ -246,19 +249,19 @@ img() {
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/qemu-img \
"$pkgdir"/usr/bin/qemu-io \
- "$subpkgdir"/usr/bin/
+ "$subpkgdir"/usr/bin/ || return 1
- # we exploit the fact that -img subpackage are created last
+ # We exploit the fact that -img subpackage are created last
# and check that we done have new systems that belongs in
- # subpackage
- local _bins= _ret=0
- for i in "$pkgdir"/usr/bin/qemu-system-*; do
- if [ -r "$i" ]; then
- error "Please create a subpackage for ${i##*/}"
- _ret=1
+ # subpackage.
+ local path= retval=0
+ for path in "$pkgdir"/usr/bin/qemu-system-*; do
+ if [ -r "$path" ]; then
+ error "Please create a subpackage for ${path##*/}"
+ retval=1
fi
done
- return $_ret
+ return $retval
}
guest() {
@@ -266,7 +269,8 @@ guest() {
options=""
mkdir -p "$subpkgdir"/usr/bin
- mv "$pkgdir"/usr/bin/qemu-ga "$subpkgdir"/usr/bin/
+ mv "$pkgdir"/usr/bin/qemu-ga "$subpkgdir"/usr/bin/ || return 1
+
install -Dm755 "$srcdir"/$pkgname-guest-agent.initd \
"$subpkgdir"/etc/init.d/$pkgname-guest-agent || return 1
install -Dm644 "$srcdir"/$pkgname-guest-agent.confd \