Accepting request 227675 from home:bfrogers:branches:Virtualization
Spec file cleanups and git script improvements. OBS-URL: https://build.opensuse.org/request/show/227675 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=196
This commit is contained in:
parent
a90d1af56a
commit
25cfc8f4ce
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 24 15:45:00 UTC 2014 - brogers@suse.com
|
||||||
|
|
||||||
|
- Improve update_git.sh to not change files in OBS if the file
|
||||||
|
remains unchanged
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Mar 24 09:41:42 UTC 2014 - afaerber@suse.de
|
Mon Mar 24 09:41:42 UTC 2014 - afaerber@suse.de
|
||||||
|
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Mar 26 21:09:34 UTC 2014 - brogers@suse.com
|
||||||
|
|
||||||
|
- Tiddy up qemu.spec a bit: white space, line length, use macros
|
||||||
|
as appropriate
|
||||||
|
- Improve update_git.sh to not change files in OBS if the file
|
||||||
|
remains unchanged
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Mar 26 14:16:39 UTC 2014 - afaerber@suse.de
|
Wed Mar 26 14:16:39 UTC 2014 - afaerber@suse.de
|
||||||
|
|
||||||
|
23
qemu.spec
23
qemu.spec
@ -131,7 +131,7 @@ BuildRequires: libpng-devel
|
|||||||
BuildRequires: libpulse-devel
|
BuildRequires: libpulse-devel
|
||||||
BuildRequires: libtool
|
BuildRequires: libtool
|
||||||
%if 0%{?suse_version} > 1310
|
%if 0%{?suse_version} > 1310
|
||||||
BuildRequires: libusb
|
BuildRequires: libusb-devel
|
||||||
%endif
|
%endif
|
||||||
BuildRequires: libvdeplug3-devel
|
BuildRequires: libvdeplug3-devel
|
||||||
%if 0%{?suse_version} > 1220
|
%if 0%{?suse_version} > 1220
|
||||||
@ -200,7 +200,11 @@ Recommends: qemu-ksm = %{version}
|
|||||||
Suggests: qemu-lang
|
Suggests: qemu-lang
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%define firmware_files {acpi-dsdt.aml bios.bin q35-acpi-dsdt.aml sgabios.bin vgabios.bin vgabios-cirrus.bin vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin optionrom/linuxboot.bin optionrom/multiboot.bin optionrom/kvmvapic.bin pxe-e1000.rom pxe-pcnet.rom pxe-ne2k_pci.rom pxe-rtl8139.rom pxe-eepro100.rom pxe-virtio.rom}
|
%define built_firmware_files {acpi-dsdt.aml bios.bin bios-256k.bin \
|
||||||
|
q35-acpi-dsdt.aml sgabios.bin vgabios.bin vgabios-cirrus.bin \
|
||||||
|
vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin optionrom/linuxboot.bin \
|
||||||
|
optionrom/multiboot.bin optionrom/kvmvapic.bin pxe-e1000.rom pxe-pcnet.rom \
|
||||||
|
pxe-ne2k_pci.rom pxe-rtl8139.rom pxe-eepro100.rom pxe-virtio.rom}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
QEMU is an extremely well-performing CPU emulator that allows you to
|
QEMU is an extremely well-performing CPU emulator that allows you to
|
||||||
@ -491,7 +495,7 @@ This package provides a service file for starting and stopping KSM.
|
|||||||
|
|
||||||
%if %{build_x86_fw_from_source}
|
%if %{build_x86_fw_from_source}
|
||||||
# as a safeguard, delete the firmware files that we intend to build
|
# as a safeguard, delete the firmware files that we intend to build
|
||||||
for i in %firmware_files
|
for i in %built_firmware_files
|
||||||
do
|
do
|
||||||
rm -f pc-bios/$i
|
rm -f pc-bios/$i
|
||||||
done
|
done
|
||||||
@ -501,6 +505,7 @@ done
|
|||||||
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
|
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
|
||||||
--libdir=%_libdir \
|
--libdir=%_libdir \
|
||||||
--libexecdir=%_libexecdir \
|
--libexecdir=%_libexecdir \
|
||||||
|
--localstatedir=%_localstatedir \
|
||||||
--extra-cflags="%{optflags}" \
|
--extra-cflags="%{optflags}" \
|
||||||
--disable-strip \
|
--disable-strip \
|
||||||
--enable-system --disable-linux-user \
|
--enable-system --disable-linux-user \
|
||||||
@ -556,10 +561,10 @@ make %{?_smp_mflags} V=1
|
|||||||
|
|
||||||
# Firmware
|
# Firmware
|
||||||
%if %{build_x86_fw_from_source}
|
%if %{build_x86_fw_from_source}
|
||||||
make --no-print-directory -C roms bios
|
make -C roms bios
|
||||||
make --no-print-directory -C roms seavgabios
|
make -C roms seavgabios
|
||||||
make --no-print-directory -C roms pxerom
|
make -C roms pxerom
|
||||||
make --no-print-directory -C roms sgabios
|
make -C roms sgabios
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@ -577,9 +582,9 @@ cat > %{buildroot}%{_bindir}/qemu-kvm << 'EOF'
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
%ifarch %s390x
|
%ifarch %s390x
|
||||||
exec /usr/bin/qemu-system-s390x -machine accel=kvm "$@"
|
exec %{_bindir}/qemu-system-s390x -machine accel=kvm "$@"
|
||||||
%else
|
%else
|
||||||
exec /usr/bin/qemu-system-x86_64 -machine accel=kvm "$@"
|
exec %{_bindir}/qemu-system-x86_64 -machine accel=kvm "$@"
|
||||||
%endif
|
%endif
|
||||||
EOF
|
EOF
|
||||||
chmod 755 %{buildroot}%{_bindir}/qemu-kvm
|
chmod 755 %{buildroot}%{_bindir}/qemu-kvm
|
||||||
|
23
qemu.spec.in
23
qemu.spec.in
@ -93,7 +93,7 @@ BuildRequires: libpng-devel
|
|||||||
BuildRequires: libpulse-devel
|
BuildRequires: libpulse-devel
|
||||||
BuildRequires: libtool
|
BuildRequires: libtool
|
||||||
%if 0%{?suse_version} > 1310
|
%if 0%{?suse_version} > 1310
|
||||||
BuildRequires: libusb
|
BuildRequires: libusb-devel
|
||||||
%endif
|
%endif
|
||||||
BuildRequires: libvdeplug3-devel
|
BuildRequires: libvdeplug3-devel
|
||||||
%if 0%{?suse_version} > 1220
|
%if 0%{?suse_version} > 1220
|
||||||
@ -162,7 +162,11 @@ Recommends: qemu-ksm = %{version}
|
|||||||
Suggests: qemu-lang
|
Suggests: qemu-lang
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%define firmware_files {acpi-dsdt.aml bios.bin q35-acpi-dsdt.aml sgabios.bin vgabios.bin vgabios-cirrus.bin vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin optionrom/linuxboot.bin optionrom/multiboot.bin optionrom/kvmvapic.bin pxe-e1000.rom pxe-pcnet.rom pxe-ne2k_pci.rom pxe-rtl8139.rom pxe-eepro100.rom pxe-virtio.rom}
|
%define built_firmware_files {acpi-dsdt.aml bios.bin bios-256k.bin \
|
||||||
|
q35-acpi-dsdt.aml sgabios.bin vgabios.bin vgabios-cirrus.bin \
|
||||||
|
vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin optionrom/linuxboot.bin \
|
||||||
|
optionrom/multiboot.bin optionrom/kvmvapic.bin pxe-e1000.rom pxe-pcnet.rom \
|
||||||
|
pxe-ne2k_pci.rom pxe-rtl8139.rom pxe-eepro100.rom pxe-virtio.rom}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
QEMU is an extremely well-performing CPU emulator that allows you to
|
QEMU is an extremely well-performing CPU emulator that allows you to
|
||||||
@ -415,7 +419,7 @@ PATCH_EXEC
|
|||||||
|
|
||||||
%if %{build_x86_fw_from_source}
|
%if %{build_x86_fw_from_source}
|
||||||
# as a safeguard, delete the firmware files that we intend to build
|
# as a safeguard, delete the firmware files that we intend to build
|
||||||
for i in %firmware_files
|
for i in %built_firmware_files
|
||||||
do
|
do
|
||||||
rm -f pc-bios/$i
|
rm -f pc-bios/$i
|
||||||
done
|
done
|
||||||
@ -425,6 +429,7 @@ done
|
|||||||
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
|
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
|
||||||
--libdir=%_libdir \
|
--libdir=%_libdir \
|
||||||
--libexecdir=%_libexecdir \
|
--libexecdir=%_libexecdir \
|
||||||
|
--localstatedir=%_localstatedir \
|
||||||
--extra-cflags="%{optflags}" \
|
--extra-cflags="%{optflags}" \
|
||||||
--disable-strip \
|
--disable-strip \
|
||||||
--enable-system --disable-linux-user \
|
--enable-system --disable-linux-user \
|
||||||
@ -480,10 +485,10 @@ make %{?_smp_mflags} V=1
|
|||||||
|
|
||||||
# Firmware
|
# Firmware
|
||||||
%if %{build_x86_fw_from_source}
|
%if %{build_x86_fw_from_source}
|
||||||
make --no-print-directory -C roms bios
|
make -C roms bios
|
||||||
make --no-print-directory -C roms seavgabios
|
make -C roms seavgabios
|
||||||
make --no-print-directory -C roms pxerom
|
make -C roms pxerom
|
||||||
make --no-print-directory -C roms sgabios
|
make -C roms sgabios
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@ -501,9 +506,9 @@ cat > %{buildroot}%{_bindir}/qemu-kvm << 'EOF'
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
%ifarch %s390x
|
%ifarch %s390x
|
||||||
exec /usr/bin/qemu-system-s390x -machine accel=kvm "$@"
|
exec %{_bindir}/qemu-system-s390x -machine accel=kvm "$@"
|
||||||
%else
|
%else
|
||||||
exec /usr/bin/qemu-system-x86_64 -machine accel=kvm "$@"
|
exec %{_bindir}/qemu-system-x86_64 -machine accel=kvm "$@"
|
||||||
%endif
|
%endif
|
||||||
EOF
|
EOF
|
||||||
chmod 755 %{buildroot}%{_bindir}/qemu-kvm
|
chmod 755 %{buildroot}%{_bindir}/qemu-kvm
|
||||||
|
@ -16,11 +16,25 @@ GIT_BRANCH=opensuse-2.0
|
|||||||
GIT_UPSTREAM_TAG=v2.0.0-rc0
|
GIT_UPSTREAM_TAG=v2.0.0-rc0
|
||||||
QEMU_TMP=/dev/shm/qemu-tmp
|
QEMU_TMP=/dev/shm/qemu-tmp
|
||||||
|
|
||||||
# clean up
|
restore_file_to_package() {
|
||||||
|
# If the processed file matches the previous one, move the previous
|
||||||
|
# one back in place, otherwise add the processed file.
|
||||||
|
|
||||||
|
if cmp -s "$1" saved."$1"; then
|
||||||
|
osc mv --force saved."$1" "$1"
|
||||||
|
else
|
||||||
|
osc add "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# save files in case they remain unchanged
|
||||||
if [ -e 0001-* ]; then
|
if [ -e 0001-* ]; then
|
||||||
osc rm --force 0*
|
for i in 0*; do
|
||||||
|
osc mv $i saved.$i
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
rm -f qemu.spec qemu-linux-user.spec
|
osc mv qemu.spec saved.qemu.spec
|
||||||
|
osc mv qemu-linux-user.spec saved.qemu-linux-user.spec
|
||||||
|
|
||||||
# fetch all patches
|
# fetch all patches
|
||||||
rm -rf $QEMU_TMP
|
rm -rf $QEMU_TMP
|
||||||
@ -41,13 +55,14 @@ cd "$OSCDIR"
|
|||||||
rm -rf $QEMU_TMP
|
rm -rf $QEMU_TMP
|
||||||
|
|
||||||
# cut off file name after 40 bytes, so we work around git version differences
|
# cut off file name after 40 bytes, so we work around git version differences
|
||||||
# while at it, also remove the signature
|
# while at it, also remove the signature.
|
||||||
for i in 0*; do
|
for i in 0*; do
|
||||||
PATCHNAME=${i%.patch}
|
PATCHNAME=${i%.patch}
|
||||||
PATCHNAME=${i:0:40}.patch
|
PATCHNAME=${i:0:40}.patch
|
||||||
head -n $(expr $(wc -l $i | cut -d ' ' -f 1) - 3) $i > "$PATCHNAME.tmp"
|
head -n $(expr $(wc -l $i | cut -d ' ' -f 1) - 3) $i > "$PATCHNAME.tmp"
|
||||||
rm "$i"
|
rm "$i"
|
||||||
mv "$PATCHNAME.tmp" "$PATCHNAME"
|
mv "$PATCHNAME.tmp" "$PATCHNAME"
|
||||||
|
restore_file_to_package "$PATCHNAME"
|
||||||
done
|
done
|
||||||
|
|
||||||
# we have all patches as files now - generate the spec files!
|
# we have all patches as files now - generate the spec files!
|
||||||
@ -70,5 +85,12 @@ for package in qemu qemu-linux-user; do
|
|||||||
fi
|
fi
|
||||||
done < $package.spec.in > $package.spec
|
done < $package.spec.in > $package.spec
|
||||||
done
|
done
|
||||||
osc add 0*
|
|
||||||
|
restore_file_to_package qemu.spec
|
||||||
|
restore_file_to_package qemu-linux-user.spec
|
||||||
|
|
||||||
|
# remove any remaining saved files
|
||||||
|
if [ -e saved.* ]; then
|
||||||
|
osc rm --force saved.*
|
||||||
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user