[packages/qemu] build binfmt.d for qemu-user-static

glen glen at pld-linux.org
Mon Oct 17 20:33:49 CEST 2016


commit e14b0c246dbd61ae2048139fd3cf2cf459ab9d2d
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Sep 27 23:13:23 2016 +0300

    build binfmt.d for qemu-user-static

 qemu.spec | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/qemu.spec b/qemu.spec
index 87bcc5d..69d65b9 100644
--- a/qemu.spec
+++ b/qemu.spec
@@ -972,7 +972,12 @@ for i in dummy \
 	qemu-sh4eb \
 ; do
 	test $i = dummy && continue
-	grep /$i:\$ %{SOURCE2} > $RPM_BUILD_ROOT/usr/lib/binfmt.d/$i.conf
+	grep /$i:\$ %{SOURCE2} > $RPM_BUILD_ROOT/usr/lib/binfmt.d/$i-dynamic.conf
+
+	%if %{with user_static}
+	grep /$i:\$ %{SOURCE2} > $RPM_BUILD_ROOT/usr/lib/binfmt.d/$i-static.conf
+	%{__sed} -i -e "s/$i/$i-static/" $RPM_BUILD_ROOT/usr/lib/binfmt.d/$i-static.conf
+	%endif
 done < %{SOURCE2}
 
 # packaged as %doc
@@ -1035,6 +1040,12 @@ fi
 %postun user
 %systemd_service_restart systemd-binfmt.service
 
+%post user-static
+%systemd_service_restart systemd-binfmt.service
+
+%postun user-static
+%systemd_service_restart systemd-binfmt.service
+
 %post guest-agent
 %systemd_reload
 
@@ -1129,7 +1140,7 @@ fi
 
 %files user
 %defattr(644,root,root,755)
-/usr/lib/binfmt.d/qemu-*.conf
+/usr/lib/binfmt.d/qemu-*-dynamic.conf
 %attr(755,root,root) %{_bindir}/qemu-aarch64
 %attr(755,root,root) %{_bindir}/qemu-alpha
 %attr(755,root,root) %{_bindir}/qemu-arm
@@ -1163,6 +1174,7 @@ fi
 %if %{with user_static}
 %files user-static
 %defattr(644,root,root,755)
+/usr/lib/binfmt.d/qemu-*-static.conf
 %attr(755,root,root) %{_bindir}/qemu-aarch64-static
 %attr(755,root,root) %{_bindir}/qemu-alpha-static
 %attr(755,root,root) %{_bindir}/qemu-arm-static
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/qemu.git/commitdiff/e14b0c246dbd61ae2048139fd3cf2cf459ab9d2d



More information about the pld-cvs-commit mailing list