Package qemu: Specfile

   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
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
# vim: set ft=spec
# vim600: set fdm=marker:

# {{{ macros define
%define _unpackaged_files_terminate_build 1
%def_disable edk2_cross

%def_enable user_static

%def_enable sdl
%def_enable curses
%def_enable vnc
%def_enable vnc_sasl
%def_enable vnc_jpeg
%def_enable vnc_png
%def_enable xkbcommon
%def_disable vde
%def_enable alsa
%def_enable pulseaudio
%def_enable oss
%def_disable jack
%def_enable aio
%def_enable io_uring
%def_enable blobs
%def_enable smartcard
%def_enable libusb
%def_enable usb_redir
%def_enable vhost_crypto
%def_enable vhost_net
%def_enable vhost_scsi
%def_enable vhost_vsock
%def_enable vhost_user_fs
%def_enable opengl
%def_enable guest_agent
%def_enable tools
%def_enable spice
%def_enable libiscsi
%ifarch %ix86 %arm %mips32 ppc
%def_disable rbd
%else
%def_enable rbd
%endif
%def_enable libnfs
%def_enable zstd
%def_enable seccomp
%def_enable glusterfs
%def_enable gtk
%def_disable gtk_gl
%def_enable gnutls
%def_enable nettle
%def_disable gcrypt
%def_enable virglrenderer
%def_enable tpm
%def_enable libssh
%def_enable live_block_migration
%ifnarch armh
%def_enable numa
%else
%def_disable numa
%endif
%def_disable tcmalloc
%def_disable jemalloc
%def_enable replication
%def_enable rdma
%def_enable lzo
%def_enable snappy
%def_enable bzip2
%def_disable lzfse
%def_disable xen
%def_enable mpath
%def_enable libxml2
%def_disable libpmem
%def_enable libudev
%def_enable libdaxctl
%def_disable brlapi

%define power64 ppc64 ppc64p7 ppc64le
%define mips32 mips mipsel mipsr6 mipsr6el
%define mips64 mips64 mips64el mips64r6 mips64r6el
%define mips_arch %mips32 %mips64

%ifarch %ix86
%global kvm_package system-x86
%def_enable qemu_kvm
%endif
%ifarch x86_64
%global kvm_package system-x86
%def_enable qemu_kvm
%endif
%ifarch %power64
%global kvm_package   system-ppc
%def_enable qemu_kvm
%endif
%ifarch s390x
%global kvm_package   system-s390x
%endif
%ifarch armh
%global kvm_package   system-arm
%def_enable qemu_kvm
%endif
%ifarch aarch64
%global kvm_package   system-aarch64
%def_enable qemu_kvm
%endif
%ifarch riscv64
%global kvm_package   system-riscv
%def_enable qemu_kvm
%endif
%ifarch %mips_arch
%global kvm_package   system-mips
%endif

%def_enable have_kvm

%define audio_drv_list %{?_enable_oss:oss} %{?_enable_alsa:alsa} %{?_enable_sdl:sdl} %{?_enable_pulseaudio:pa} %{?_enable_jack:jack}
%define block_drv_list curl dmg %{?_enable_glusterfs:gluster} %{?_enable_libiscsi:iscsi} %{?_enable_libnfs:nfs} %{?_enable_rbd:rbd} %{?_enable_libssh:ssh}
%define ui_list %{?_enable_gtk:gtk} %{?_enable_curses:curses} %{?_enable_sdl:sdl} %{?_enable_opengl:opengl}
%define ui_spice_list %{?_enable_spice:app core}
%define device_usb_list redirect smartcard
%define device_display_list virtio-gpu-pci %{?_enable_virglrenderer:virtio-gpu} virtio-vga
%define qemu_arches aarch64 alpha arm avr cris hppa m68k microblaze mips moxie nios2 or1k ppc riscv rx s390x sh4 sparc tricore x86 xtensa

%global _group vmusers
%global rulenum 90
%global _libexecdir /usr/libexec
%global _localstatedir /var
%global firmwarepath /usr/share/qemu:/usr/share/seabios:/usr/share/seavgabios:/usr/share/ipxe:/usr/share/ipxe.efi

# }}}

Name: qemu
Version: 5.2.0
Release: alt6

Summary: QEMU CPU Emulator
License: BSD-2-Clause AND BSD-3-Clause AND GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
Group: Emulators
Url: https://www.qemu.org
# git://git.qemu.org/qemu.git
Source0: %name-%version.tar
Source100: keycodemapdb.tar
Source101: berkeley-testfloat-3.tar
Source102: berkeley-softfloat-3.tar
Source2: qemu-kvm.control.in
Source4: qemu-kvm.rules
# qemu-kvm back compat wrapper
Source5: qemu-kvm.sh
# guest agent service
Source8: qemu-guest-agent.rules
Source9: qemu-guest-agent.service
Source10: qemu-guest-agent.init
Source11: qemu-ga.sysconfig
# /etc/qemu/bridge.conf
Source12: bridge.conf

Patch: qemu-alt.patch

%set_verify_elf_method fhs=relaxed
%add_verify_elf_skiplist %_datadir/%name/*
%add_findreq_skiplist %_datadir/%name/*

Requires: %name-system = %EVR
Requires: %name-user = %EVR

BuildRequires(pre): rpm-build-python3
BuildRequires: meson >= 0.55.0
BuildRequires: glibc-devel-static zlib-devel-static glib2-devel-static libpcre-devel-static libattr-devel-static
BuildRequires: glib2-devel >= 2.48 libgio-devel
BuildRequires: makeinfo perl-devel python3-module-sphinx
BuildRequires: libcap-ng-devel
BuildRequires: libxfs-devel
BuildRequires: zlib-devel libcurl-devel libpci-devel glibc-kernheaders
BuildRequires: ipxe-roms-qemu >= 1:20161208-alt1.git26050fd seavgabios seabios >= 1.7.4-alt2 libfdt-devel >= 1.5.0.0.20.2431 qboot
BuildRequires: libpixman-devel >= 0.21.8
BuildRequires: python3-devel
%{?_enable_sdl:BuildRequires: libSDL2-devel}
%{?_enable_curses:BuildRequires: libncursesw-devel}
%{?_enable_alsa:BuildRequires: libalsa-devel}
%{?_enable_pulseaudio:BuildRequires: libpulseaudio-devel}
%{?_enable_jack:BuildRequires: libjack-devel}
%{?_enable_vnc_sasl:BuildRequires: libsasl2-devel}
%{?_enable_vnc_jpeg:BuildRequires: libjpeg-devel}
%{?_enable_vnc_png:BuildRequires: libpng-devel}
%{?_enable_xkbcommon:BuildRequires: libxkbcommon-devel}
%{?_enable_vde:BuildRequires: libvde-devel}
%{?_enable_aio:BuildRequires: libaio-devel}
%{?_enable_io_uring:BuildRequires: liburing-devel}
%{?_enable_spice:BuildRequires: libspice-server-devel >= 0.12.5 spice-protocol >= 0.12.3}
BuildRequires: libuuid-devel
%{?_enable_smartcard:BuildRequires: libcacard-devel >= 2.5.1}
%{?_enable_usb_redir:BuildRequires: libusbredir-devel >= 0.5}
%{?_enable_opengl:BuildRequires: libepoxy-devel libgbm-devel}
%{?_enable_guest_agent:BuildRequires: glib2-devel >= 2.38}
%{?_enable_rbd:BuildRequires: ceph-devel}
%{?_enable_libiscsi:BuildRequires: libiscsi-devel >= 1.9.0}
%{?_enable_libnfs:BuildRequires: libnfs-devel >= 1.9.3}
%{?_enable_zstd:BuildRequires: libzstd-devel >= 1.4.0}
%{?_enable_seccomp:BuildRequires: libseccomp-devel >= 2.3.0}
%{?_enable_glusterfs:BuildRequires: pkgconfig(glusterfs-api)}
%{?_enable_gtk:BuildRequires: libgtk+3-devel >= 3.22.0 libvte3-devel >= 0.32.0}
%{?_enable_gnutls:BuildRequires: libgnutls-devel >= 3.1.18}
%{?_enable_nettle:BuildRequires: libnettle-devel >= 2.7.1}
%{?_enable_gcrypt:BuildRequires: libgcrypt-devel >= 1.5.0}
BuildRequires: libpam-devel
BuildRequires: libtasn1-devel
BuildRequires: libslirp-devel
%{?_enable_virglrenderer:BuildRequires: pkgconfig(virglrenderer)}
%{?_enable_libssh:BuildRequires: libssh-devel}
%{?_enable_libusb:BuildRequires: libusb-devel >= 1.0.13}
%{?_enable_rdma:BuildRequires: rdma-core-devel}
%{?_enable_numa:BuildRequires: libnuma-devel}
%{?_enable_tcmalloc:BuildRequires: libgperftools-devel}
%{?_enable_jemalloc:BuildRequires: libjemalloc-devel}
%{?_enable_lzo:BuildRequires: liblzo2-devel}
%{?_enable_snappy:BuildRequires: libsnappy-devel}
%{?_enable_bzip2:BuildRequires: bzlib-devel}
%{?_enable_lzfse:BuildRequires: liblzfse-devel}
%{?_enable_xen:BuildRequires: libxen-devel}
%{?_enable_mpath:BuildRequires: libudev-devel libmultipath-devel}
%{?_enable_libxml2:BuildRequires: libxml2-devel}
%{?_enable_libpmem:BuildRequires: libpmem-devel}
%{?_enable_libudev:BuildRequires: libudev-devel}
%{?_enable_libdaxctl:BuildRequires: libdaxctl-devel}
# used by some linux user impls
BuildRequires: libdrm-devel

%global requires_all_modules         \
Requires: %name-block-curl = %EVR    \
Requires: %name-block-dmg = %EVR     \
%{?_enable_glusterfs:Requires: %name-block-gluster = %EVR}  \
%{?_enable_libiscsi:Requires: %name-block-iscsi = %EVR}     \
%{?_enable_libnfs:Requires: %name-block-nfs = %EVR}         \
%{?_enable_rbd:Requires: %name-block-rbd = %EVR}            \
%{?_enable_libssh:Requires: %name-block-ssh = %EVR}         \
%{?_enable_alsa:Requires: %name-audio-alsa = %EVR}          \
%{?_enable_oss:Requires: %name-audio-oss = %EVR}            \
%{?_enable_pulseaudio:Requires: %name-audio-pa = %EVR}      \
%{?_enable_jack:Requires: %name-audio-jack = %EVR}          \
%{?_enable_sdl:Requires: %name-audio-sdl = %EVR}            \
%{?_enable_spice:Requires: %name-audio-spice = %EVR}        \
%{?_enable_curses:Requires: %name-ui-curses = %EVR}         \
%{?_enable_spice:Requires: %name-ui-spice-app = %EVR}       \
%{?_enable_spice:Requires: %name-ui-spice-core = %EVR}      \
%{?_enable_spice:Requires: %name-device-display-qxl = %EVR} \
Requires: %name-device-display-virtio-gpu-pci = %EVR        \
Requires: %name-device-display-virtio-vga = %EVR            \
%{?_enable_virglrenderer:Requires: %name-device-display-virtio-gpu = %EVR} \
%{?_enable_brlapi:Requires: %name-char-baum = %EVR}         \
%{?_enable_spice:Requires: %name-char-spice = %EVR}         \
Requires: %name-device-usb-redirect = %EVR                  \
Requires: %name-device-usb-smartcard = %EVR

##%%{?_enable_opengl:Requires: %name-ui-opengl = %EVR}         \
##%%{?_enable_opengl:Requires: %name-ui-egl-headless = %EVR}   \
##%%{?_enable_gtk:Requires: %name-ui-gtk = %EVR}        \
##%%{?_enable_sdl:Requires: %name-ui-sdl = %EVR}

%description
QEMU is a fast processor emulator using dynamic translation to achieve
good emulation speed.  QEMU has two operating modes:

* Full system emulation.  In this mode, QEMU emulates a full system
  (for example a PC), including a processor and various peripherials.
  It can be used to launch different Operating Systems without rebooting
  the PC or to debug system code.

* User mode emulation.  In this mode, QEMU can launch Linux processes
  compiled for one CPU on another CPU.  It can be used to launch the
  Wine Windows API emulator or to ease cross-compilation and
  cross-debugging.

As QEMU requires no host kernel patches to run, it is very safe and easy
to use.

%package common
Summary: QEMU CPU Emulator - common files
Group: Emulators
BuildArch: noarch
Requires(pre): control >= 0.7.2
Requires(pre): shadow-utils sysvinit-utils
Requires: %name-img = %EVR
Requires: ipxe-roms-qemu

%description common
QEMU is a fast processor emulator using dynamic translation to achieve
good emulation speed.
This package contains common files for qemu.

%package system
Summary: QEMU CPU Emulator - full system emulation
Group: Emulators
BuildArch: noarch
Requires: %name-common = %EVR
Requires: %name-tools = %EVR
Conflicts: %name-img < %EVR
%{expand:%(for i in %qemu_arches; do echo Requires: %%name-system-$i = %%EVR; done)}

%description system
Full system emulation.  In this mode, QEMU emulates a full system
(for example a PC), including a processor and various peripherials.
It can be used to launch different Operating Systems without rebooting
the PC or to debug system code.

%if_enabled have_kvm
%package kvm
Summary: QEMU metapackage for KVM support
Group: Emulators
Requires: qemu-%kvm_package = %EVR
Requires: qemu-kvm-core = %EVR

%description kvm
This is a meta-package that provides a qemu-system-<arch> package for native
architectures where kvm can be enabled. For example, in an x86 system, this
will install qemu-system-x86

%package kvm-core
Summary: QEMU metapackage for KVM support
Group: Emulators
Requires: qemu-%kvm_package-core = %EVR

%description kvm-core
This is a meta-package that provides a qemu-system-<arch>-core package
for native architectures where kvm can be enabled. For example, in an
x86 system, this will install qemu-system-x86-core
%endif

%package user
Summary: QEMU CPU Emulator - user mode emulation
Group: Emulators
Requires: %name-common = %EVR
%{expand:%(for i in %qemu_arches; do echo Requires: %%name-user-$i = %%EVR; done)}

%description user
User mode emulation.  In this mode, QEMU can launch Linux processes
compiled for one CPU on another CPU.  It can be used to launch the
Wine Windows API emulator or to ease cross-compilation and
cross-debugging.

%package user-binfmt
Summary: QEMU user mode emulation of qemu targets
Group: Emulators
Requires: %name-user = %EVR
# qemu-user-binfmt + qemu-user-static both provide binfmt rules
Conflicts: %name-user-static-binfmt
Conflicts: %name-user < 2.10.1-alt1
%{expand:%(for i in %qemu_arches; do echo Requires: %%name-user-binfmt-$i = %%EVR; done)}

%description user-binfmt
QEMU is a generic and open source processor emulator which achieves a good
emulation speed by using dynamic translation.

This package provides the user mode emulation of qemu targets

%package user-static
Summary: QEMU user mode emulation of qemu targets static build
Group: Emulators
Requires: %name-aux = %EVR
%{expand:%(for i in %qemu_arches; do echo Requires: %%name-user-static-$i = %%EVR; done)}

%description user-static
QEMU is a generic and open source processor emulator which achieves a good
emulation speed by using dynamic translation.

This package provides the user mode emulation of qemu targets built as
static binaries

%package user-static-binfmt
Summary: QEMU user mode emulation of qemu targets static build
Group: Emulators
Requires: %name-user-static
Conflicts: %name-user-binfmt
Conflicts: %name-user < 2.10.1-alt1
Provides: %name-user-binfmt_misc = %EVR
Obsoletes: %name-user-binfmt_misc < %EVR
%{expand:%(for i in %qemu_arches; do echo Requires: %%name-user-static-binfmt-$i = %%EVR; done)}

%description user-static-binfmt
QEMU is a generic and open source processor emulator which achieves a good
emulation speed by using dynamic translation.

This package provides the user mode emulation of qemu targets

%global do_package_user() \
%%package %%{1}-%%{2} \
Summary: QEMU CPU Emulator - %%{1}-%%{2} mode emulation \
Group: Emulators \
%%{?3} %%{?4} \
%%{?5} %%{?6} \
%%description %%{1}-%%{2} \
User mode emulation.  In this mode, QEMU can launch Linux processes \
compiled for one CPU on another CPU. \
%%files %%{1}-%%{2} -f %%{1}-%%{2}.list

%{expand:%(for i in %qemu_arches; do echo %%do_package_user user $i Requires: qemu-common; done)}
%{expand:%(for i in %qemu_arches; do echo %%do_package_user user-binfmt $i Requires: qemu-user-$i Conflicts: qemu-user-static-binfmt-$i; done)}

%if_enabled user_static
%{expand:%(for i in %qemu_arches; do echo %%do_package_user user-static $i; done)}
%{expand:%(for i in %qemu_arches; do echo %%do_package_user user-static-binfmt $i Requires: qemu-user-static-$i Conflicts: qemu-user-binfmt-$i; done)}
%endif

%package img
Summary: QEMU command line tool for manipulating disk images
Group: Emulators
Provides: qemu-kvm-img
Obsoletes: qemu-kvm-img < %EVR
Requires: %name-aux = %EVR

%description img
This package provides a command line tool for manipulating disk images

%package tools
Summary: Tools for QEMU
Group: Emulators
Requires: %name-img = %EVR
Requires: %name-aux = %EVR
Conflicts: %name-system < 2.11.0-alt2

%description tools
This package contains various QEMU related tools, including a bridge helper,
a virtfs helper.

%global do_package_block() \
%%package block-%%{1} \
Summary: QEMU %%{1} block driver \
Group: Emulators \
Requires: %%name-common = %%EVR \
\
%%description block-%%{1} \
This package provides the additional %%{1} block driver for QEMU. \
\
%%files block-%%{1} \
%%_libdir/qemu/block-%%{1}*.so

%{expand:%(for i in %block_drv_list; do echo %%do_package_block $i; done)}

%global do_package_audio() \
%%package audio-%%{1} \
Summary: QEMU %%{1} audio driver \
Group: Emulators \
Requires: %%name-common = %%EVR \
\
%%description audio-%%{1} \
This package provides the additional %%{1} audio driver for QEMU. \
\
%%files audio-%%{1} \
%%_libdir/qemu/audio-%%{1}.so

%{expand:%(for i in %audio_drv_list spice; do echo %%do_package_audio $i; done)}

%global do_package_ui() \
%%package ui-%%{1} \
Summary: QEMU %%{1} UI driver \
Group: Emulators \
Requires: %%name-common = %%EVR \
%%if %%{1} == gtk \
Requires: %%name-ui-opengl = %%EVR \
%%endif \
%%if %%{1} == sdl \
Requires: %%name-ui-opengl = %%EVR \
%%endif \
\
%%description ui-%%{1} \
This package provides the additional %%{1} UI for QEMU. \
\
%%files ui-%%{1} \
%%_libdir/qemu/ui-%%{1}.so

%{expand:%(for i in %ui_list; do echo %%do_package_ui $i; done)}

%global do_package_ui_spice() \
%%package ui-spice-%%{1} \
Summary: QEMU spice-%%{1} UI driver \
Group: Emulators \
Requires: %%name-common = %%EVR \
%%if %%{1} == "core" \
Requires: %%name-ui-opengl = %%EVR \
%%endif \
%%if %%{1} == "app" \
Requires: %%name-ui-spice-core = %%EVR \
Requires: %%name-char-spice = %%EVR \
%%endif \
\
%%description ui-spice-%%{1} \
This package provides the additional %%{1} UI for QEMU. \
\
%%files ui-spice-%%{1} \
%%_libdir/qemu/ui-spice-%%{1}.so

%{expand:%(for i in %ui_spice_list; do echo %%do_package_ui_spice $i; done)}

%package  ui-egl-headless
Summary: QEMU EGL headless driver
Group: Emulators
Requires: %name-common = %EVR
Requires: %name-ui-opengl = %EVR

%description ui-egl-headless
This package provides the additional egl-headless UI for QEMU.

%package device-display-qxl
Summary: QEMU QXL display device
Group: Emulators
Requires: %name-common = %EVR
Requires: %name-ui-spice-core = %EVR

%description device-display-qxl
This package provides the QXL display device for QEMU.

%global do_package_device_display() \
%%package device-display-%%{1} \
Summary: QEMU display-%%{1} device \
Group: Emulators \
Requires: %%name-common = %%EVR \
\
%%description device-display-%%{1} \
This package provides the additional device display-%%{1} for QEMU. \
\
%%files device-display-%%{1} \
%%_libdir/qemu/hw-display-%%{1}.so

%{expand:%(for i in %device_display_list; do echo %%do_package_device_display $i; done)}

%global do_package_device_usb() \
%%package device-usb-%%{1} \
Summary: QEMU usb-%%{1} device \
Group: Emulators \
Requires: %%name-common = %%EVR \
\
%%description device-usb-%%{1} \
This package provides the additional device usb-%%{1} for QEMU. \
\
%%files device-usb-%%{1} \
%%_libdir/qemu/hw-usb-%%{1}.so

%{expand:%(for i in %device_usb_list; do echo %%do_package_device_usb $i; done)}

%package char-baum
Summary: QEMU Baum chardev driver
Group: Emulators
Requires: %name-common = %EVR

%description char-baum
This package provides the Baum chardev driver for QEMU.

%package char-spice
Summary: QEMU spice chardev driver
Group: Emulators
Requires: %name-common = %EVR
Requires: %name-ui-spice-core = %EVR

%description char-spice
This package provides the spice chardev driver for QEMU.

%package guest-agent
Summary: QEMU guest agent
Group: Emulators
Requires: %name-aux = %EVR

%description guest-agent
QEMU is a generic and open source processor emulator which achieves a good
emulation speed by using dynamic translation.

This package provides an agent to run inside guests, which communicates
with the host over a virtio-serial channel named "org.qemu.guest_agent.0"

This package does not need to be installed on the host OS.

%package doc
Summary: User documentation for %name
Group: Documentation
BuildArch: noarch
Requires: %name-aux = %EVR

%description doc
User documentation for %name

%package aux
Summary: QEMU auxiliary package
Group: Emulators
BuildArch: noarch

%description aux
QEMU is a generic and open source processor emulator which achieves
good emulation speed by using dynamic translation.

This is an auxiliary package.

%global do_package_system() \
%%package system-%%{1} \
Summary: QEMU system emulator for %%{1} \
Group: Emulators \
Requires: %%name-system-%%{1}-core = %%EVR \
%%requires_all_modules \
%%description system-%%{1} \
This package provides the system emulator for %%{1}. \
%%files system-%%{1} \
\
%%package system-%%{1}-core \
Summary: QEMU system emulator for %%{1} \
Group: Emulators \
Requires: %%name-common = %%EVR \
Conflicts: %%name-system < 2.10.1-alt1 \
\
%%if %%{1} == x86 \
Requires: seabios >= 1.7.4-alt2 seavgabios edk2-ovmf libseccomp >= 2.2.3 qboot \
%%endif \
%%if %%{1} == aarch64 \
Requires: edk2-aarch64 \
%%endif \
%%if %%{1} == ppc \
Requires: seavgabios \
%%endif \
\
%%description system-%%{1}-core \
This package provides the system emulator for %%{1}. \
%%files system-%%{1}-core \
\
%%if %%{1} == x86 \
%%_bindir/qemu-system-i386 \
%%_man1dir/qemu-system-i386.1* \
%%_datadir/%%name/bios* \
%%_datadir/%%name/sgabios.bin \
%%_datadir/%%name/linuxboot* \
%%_datadir/%%name/multiboot.bin \
%%_datadir/%%name/kvmvapic.bin \
%%_datadir/%%name/pvh.bin \
%%endif \
\
%%if %%{1} == alpha \
%%_datadir/%%name/palcode-clipper \
%%endif \
\
%%if %%{1} == arm \
%%_datadir/%%name/npcm7xx_bootrom.bin \
%%endif \
\
%%if %%{1} == hppa \
%%_datadir/%%name/hppa-firmware.img \
%%endif \
\
%%if %%{1} == microblaze \
%%_datadir/%%name/petalogix*.dtb \
%%endif \
\
%%if %%{1} == s390x \
%%_datadir/%%name/s390-*.img \
%%endif \
\
%%if %%{1} == sparc \
%%_datadir/%%name/QEMU* \
%%_datadir/%%name/openbios-sparc* \
%%endif \
\
%%if %%{1} == ppc \
%%_datadir/%%name/bamboo.dtb \
%%_datadir/%%name/canyonlands.dtb \
%%_datadir/%%name/qemu_vga.ndrv \
%%_datadir/%%name/skiboot.lid \
%%_datadir/%%name/u-boot* \
%%_datadir/%%name/openbios-ppc \
%%_datadir/%%name/slof.bin \
%%endif \
\
%%if %%{1} == riscv \
%%_datadir/%%name/opensbi* \
%%endif \
\
%%_bindir/qemu-system-%%{1}* \
%%_man1dir/qemu-system-%%{1}*

%{expand:%(for i in %qemu_arches; do echo %%do_package_system $i; done)}

%prep
%setup

tar -xf %SOURCE100 -C ui/keycodemapdb --strip-components 1
tar -xf %SOURCE101 -C tests/fp/berkeley-testfloat-3 --strip-components 1
tar -xf %SOURCE102 -C tests/fp/berkeley-softfloat-3 --strip-components 1

%patch -p1
cp -f %SOURCE2 qemu-kvm.control.in

%build
export CFLAGS="%optflags"
# --build-id option is used for giving info to the debug packages.
export extraldflags="-Wl,--build-id"
export buildldflags="VL_LDFLAGS=-Wl,--build-id"

run_configure() {
# non-GNU configure
    ../configure \
	--disable-git-update \
	--prefix=%prefix \
	--sysconfdir=%_sysconfdir \
	--libdir=%_libdir \
	--mandir=%_mandir \
	--libexecdir=%_libexecdir \
	--localstatedir=%_localstatedir \
	--with-pkgversion=%name-%version-%release \
	--disable-werror \
	--disable-debug-tcg \
	--disable-sparse \
	--disable-strip \
	--firmwarepath=%firmwarepath \
	 "$@"
}

%if_enabled user_static
mkdir build-static
pushd build-static
# non-GNU configure
run_configure \
	--static \
	--enable-user \
	--enable-linux-user \
	--enable-attr \
	--enable-tcg \
	--extra-ldflags="$extraldflags -Wl,-Ttext-segment=0x60000000" \
	--audio-drv-list="" \
	--disable-auth-pam \
	--disable-avx2 \
	--disable-avx512f \
	--disable-blobs \
	--disable-bochs \
	--disable-brlapi \
	--disable-bsd-user \
	--disable-bzip2 \
	--disable-cap-ng \
	--disable-capstone \
	--disable-cloop \
	--disable-cocoa \
	--disable-crypto-afalg \
	--disable-curl \
	--disable-curses \
	--disable-debug-info \
	--disable-debug-mutex \
	--disable-debug-tcg \
	--disable-dmg \
	--disable-docs \
	--disable-fdt \
	--disable-gcrypt \
	--disable-glusterfs \
	--disable-gnutls \
	--disable-gtk \
	--disable-guest-agent \
	--disable-guest-agent-msi \
	--disable-hax \
	--disable-hvf \
	--disable-iconv \
	--disable-jemalloc \
	--disable-keyring \
	--disable-kvm \
	--disable-libdaxctl \
	--disable-libiscsi \
	--disable-libnfs \
	--disable-libpmem \
	--disable-libssh \
	--disable-libudev \
	--disable-libusb \
	--disable-libxml2 \
	--disable-linux-aio \
	--disable-linux-io-uring \
	--disable-live-block-migration \
	--disable-lzfse \
	--disable-lzo \
	--disable-membarrier \
	--disable-modules \
	--disable-mpath \
	--disable-netmap \
	--disable-nettle \
	--disable-numa \
	--disable-opengl \
	--disable-parallels \
	--disable-pie \
	--disable-pvrdma \
	--disable-qcow1 \
	--disable-qed \
	--disable-qom-cast-debug \
	--disable-rbd \
	--disable-rdma \
	--disable-replication \
	--disable-rng-none \
	--disable-sdl \
	--disable-sdl-image \
	--disable-seccomp \
	--disable-sheepdog \
	--disable-slirp \
	--disable-smartcard \
	--disable-snappy \
	--disable-sparse \
	--disable-spice \
	--disable-system \
	--disable-tcmalloc \
	--disable-tools \
	--disable-tpm \
	--disable-usb-redir \
	--disable-vde \
	--disable-vdi \
	--disable-vhost-crypto \
	--disable-vhost-kernel \
	--disable-vhost-net \
	--disable-vhost-scsi \
	--disable-vhost-user \
	--disable-vhost-vdpa \
	--disable-vhost-vsock \
	--disable-vhost-user-fs \
	--disable-virglrenderer \
	--disable-virtfs \
	--disable-vnc \
	--disable-vnc-jpeg \
	--disable-vnc-png \
	--disable-vnc-sasl \
	--disable-vte \
	--disable-vvfat \
	--disable-whpx \
	--disable-xen \
	--disable-xen-pci-passthrough \
	--disable-xfsctl \
	--disable-xkbcommon \
	--disable-zstd \
	--without-default-devices

# Please do not touch this
sed -i "/cpu_get_model/ {
N
N
/return / s,any,cortex-a8,
}" ../linux-user/arm/target_elf.h

%make_build V=1 $buildldflags

%if_with arm
mv qemu-arm qemu-armh

sed -i '/return / s,cortex-a8,cortex-a53,' ../linux-user/arm/target_elf.h
%make_build V=1 $buildldflags
mv qemu-arm qemu-aarch64

exit 0

sed -i '/return / s,cortex-a53,any,' ../linux-user/arm/target_elf.h
%make_build V=1 $buildldflags
%endif

popd
%endif

# Build for non-static qemu-*
mkdir build-dynamic
pushd build-dynamic
# non-GNU configure
run_configure \
	--enable-system \
	--enable-kvm \
	--enable-user \
	--enable-linux-user \
	--enable-pie \
	--enable-modules \
	%{?_enable_sdl:--enable-sdl} \
	%{?_disable_curses:--disable-curses} \
	%{subst_enable vnc} \
	%{?_enable_gtk:--enable-gtk --enable-vte} \
	%{?_disable_vnc_tls:--disable-vnc-tls} \
	%{?_disable_vnc_sasl:--disable-vnc-sasl} \
	%{?_disable_vnc_jpeg:--disable-vnc-jpeg} \
	%{?_disable_vnc_png:--disable-vnc-png} \
	%{?_disable_xkbcommon:--disable-xkbcommon} \
	%{?_disable_vde:--disable-vde} \
	%{?_disable_aio:--disable-linux-aio} \
	%{?_disable_io_uring:--disable-linux-io-uring} \
	%{?_disable_blobs: --disable-blobs} \
	%{subst_enable spice} \
	--audio-drv-list="%audio_drv_list" \
	%{subst_enable brlapi} \
	--enable-curl \
	%{subst_enable virglrenderer} \
	%{subst_enable tpm} \
	%{subst_enable xen} \
	%{?_enable_vhost_crypto:--enable-vhost-crypto} \
	%{?_enable_vhost_net:--enable-vhost-net} \
	%{?_enable_vhost_scsi:--enable-vhost-scsi } \
	%{?_enable_vhost_vsock:--enable-vhost-vsock} \
	%{?_enable_vhost_user_fs:--enable-vhost-user-fs} \
	--enable-slirp=system \
	%{subst_enable smartcard} \
	%{subst_enable libusb} \
	%{?_enable_usb_redir:--enable-usb-redir} \
	%{subst_enable opengl} \
	%{subst_enable zstd} \
	%{subst_enable seccomp} \
	%{subst_enable libiscsi} \
	%{subst_enable rbd} \
	%{subst_enable libnfs} \
	%{subst_enable glusterfs} \
	%{subst_enable libxml2} \
	%{subst_enable libssh} \
	%{?_enable_live_block_migration:--enable-live-block-migration} \
	%{subst_enable rdma} \
	%{subst_enable gnutls} \
	%{subst_enable nettle} \
	%{subst_enable gcrypt} \
	%{subst_enable numa} \
	%{subst_enable tcmalloc} \
	%{subst_enable jemalloc} \
	%{subst_enable replication} \
	%{subst_enable lzo} \
	%{subst_enable snappy} \
	%{subst_enable bzip2} \
	%{subst_enable lzfse} \
	%{?_disable_guest_agent:--disable-guest-agent} \
	%{subst_enable tools} \
	%{subst_enable libpmem} \
	%{subst_enable libdaxctl} \
	--enable-xkbcommon \
	--extra-ldflags="$extraldflags" \
	--disable-xen

%make_build V=1 $buildldflags
popd

sed -i 's/@GROUP@/%_group/g' qemu-kvm.control.in

%install
%define docdir %_docdir/%name-%version

%if_enabled user_static
pushd build-static
%makeinstall_std
# Rename all QEMU user emulators to have a -static suffix
for src in %buildroot%_bindir/qemu-*
do
  mv $src $src.static
done

for f in %buildroot%_bindir/qemu-*.static; do
    [ -f "$f" ]
    symlink="${f%%.static}-static"
    ln -sfr "$f" "$symlink"
done
popd
%endif

pushd build-dynamic
%makeinstall_std
popd
mv %buildroot%_docdir/qemu %buildroot%docdir
install -D -p -m0644 -t %buildroot%docdir README.rst COPYING COPYING.LIB LICENSE
for emu in %buildroot%_bindir/qemu-system-*; do
    ln -sf qemu.1.xz %buildroot%_man1dir/$(basename $emu).1.xz
done

%if_enabled qemu_kvm
install -m 0755 %SOURCE5 %buildroot%_bindir/qemu-kvm
ln -r -s %buildroot%_bindir/qemu-kvm %buildroot%_bindir/kvm
ln -r -s %buildroot%_bindir/qemu-kvm %buildroot%_bindir/qemu
ln -sf qemu.1.xz %buildroot%_man1dir/qemu-kvm.1.xz
%endif

rm -f %buildroot%_bindir/check-*
rm -f %buildroot%_sysconfdir/udev/rules.d/*

install -D -m 0644 %SOURCE4 %buildroot%_sysconfdir/udev/rules.d/%rulenum-%name-kvm.rules
install -D -m 0755 %name-kvm.control.in %buildroot%_controldir/kvm

# Install qemu-guest-agent service and udev rules
install -D -m 0644 %SOURCE8 %buildroot%_udevrulesdir/%rulenum-%name-guest-agent.rules
install -D -m 0644 %SOURCE9 %buildroot%_unitdir/%name-guest-agent.service
install -D -m 0755 %SOURCE10 %buildroot%_initdir/%name-guest-agent
install -D -m 0644 %SOURCE11 %buildroot%_sysconfdir/sysconfig/qemu-ga
mkdir -p %buildroot%_sysconfdir/%name/fsfreeze-hook.d
install -D -m 0755 scripts/qemu-guest-agent/fsfreeze-hook %buildroot%_sysconfdir/%name/
install -D -m 0644 scripts/qemu-guest-agent/fsfreeze-hook.d/*.sample %buildroot%_sysconfdir/%name/fsfreeze-hook.d/
mkdir -p %buildroot%_logdir
touch %buildroot%_logdir/qga-fsfreeze-hook.log

# Install qemu-pr-helper service
install -m 0644 contrib/systemd/qemu-pr-helper.service %buildroot%_unitdir/qemu-pr-helper.service
install -m 0644 contrib/systemd/qemu-pr-helper.socket %buildroot%_unitdir/qemu-pr-helper.socket
# Install rules to use the bridge helper with libvirt's virbr0
install -m 0644 %SOURCE12 %buildroot%_sysconfdir/%name

%if_enabled vnc_sasl
install -D -p -m 0644 qemu.sasl %buildroot%_sysconfdir/sasl2/%name.conf
%endif

%find_lang %name

# todo: build new openbios and SLOF
# Provided by package openbios
#rm -f %buildroot%_datadir/%name/openbios*
# Provided by package SLOF
#rm -f %buildroot%_datadir/%name/slof.bin
# Provided by package ipxe
rm -f %buildroot%_datadir/%name/pxe*rom
rm -f %buildroot%_datadir/%name/efi*rom
# Provided by package seavgabios
rm -f %buildroot%_datadir/%name/vgabios*bin
# Provided by package seabios
rm -f %buildroot%_datadir/%name/bios.bin
rm -f %buildroot%_datadir/%name/bios-256k.bin
rm -f %buildroot%_datadir/%name/bios-microvm.bin
# Provided by package sgabios
#rm -f %buildroot%_datadir/%name/sgabios.bin
# Provided by package qboot
rm -f %buildroot%_datadir/%name/qboot.rom
# Provided by package edk2
rm %buildroot%_datadir/%name/edk2-*
rm %buildroot%_datadir/%name/firmware/*

rm %buildroot%_datadir/%name/qemu-nsis.bmp


# the pxe ipxe images will be symlinks to the images on
# /usr/share/ipxe, as QEMU doesn't know how to look
# for other paths, yet.

for rom in e1000 ne2k_pci pcnet rtl8139 virtio eepro100 e1000e vmxnet3 ; do
  ln -r -s %buildroot%_datadir/ipxe/pxe-${rom}.rom %buildroot%_datadir/%name/pxe-${rom}.rom
  ln -r -s %buildroot%_datadir/ipxe.efi/efi-${rom}.rom %buildroot%_datadir/%name/efi-${rom}.rom
done

for bios in vgabios vgabios-cirrus vgabios-qxl vgabios-stdvga vgabios-vmware vgabios-virtio vgabios-ramfb vgabios-bochs-display vgabios-ati ; do
  ln -r -s %buildroot%_datadir/seavgabios/${bios}.bin %buildroot%_datadir/%name/${bios}.bin
done

ln -r -s %buildroot%_datadir/seabios/{bios,bios-256k,bios-microvm}.bin %buildroot%_datadir/%name/
ln -r -s %buildroot%_datadir/qboot/bios.bin %buildroot%_datadir/%name/qboot.rom

mkdir -p %buildroot%_binfmtdir
./scripts/qemu-binfmt-conf.sh --systemd ALL --exportdir %buildroot%_binfmtdir --qemu-path %_bindir

# Drop qemu-mipsn32*.conf -- see https://bugzilla.altlinux.org/39619
rm -rf %buildroot%_binfmtdir/*mipsn32*

for f in %buildroot%_binfmtdir/*.conf; do
    [ -f "$f" ]
    dynamic="${f%%.conf}-dynamic.conf"
    mv "$f" "$dynamic"
%if_enabled user_static
    static="${f%%.conf}-static.conf"
    sed 's/:$/.static:F/' < "$dynamic" > "$static"
%endif
done

# files list
for i in %qemu_arches; do
    find %buildroot%_bindir/qemu-$i* \
        -type f \( ! -name "*static" ! -name "*-system-*" \) |
        sed -e 's#%{buildroot}##' |
        sort -u > user-$i.list

    find %buildroot%_binfmtdir/qemu-$i* \
        -type f \( -name "*dynamic.conf" \) |
        sed -e 's#%{buildroot}##' |
        sort -u > user-binfmt-$i.list

%if_enabled user_static
    find %buildroot%_bindir/qemu-$i* \
        \( -name "*static" \) |
        sed -e 's#%{buildroot}##' |
        sort -u > user-static-$i.list

    find %buildroot%_binfmtdir/qemu-$i* \
        -type f \( -name "*static.conf" \) |
        sed -e 's#%{buildroot}##' |
        sort -u > user-static-binfmt-$i.list

%endif
done

echo "%_bindir/qemu-i386" >> user-x86.list
echo "%_bindir/qemu-i386.static" >> user-static-x86.list
echo "%_bindir/qemu-i386-static" >> user-static-x86.list

%ifnarch %ix86 x86_64
echo "%_binfmtdir/qemu-i386-dynamic.conf" >> user-binfmt-x86.list
echo "%_binfmtdir/qemu-i386-static.conf" >> user-static-binfmt-x86.list
echo "%_binfmtdir/qemu-i486-dynamic.conf" >> user-binfmt-x86.list
echo "%_binfmtdir/qemu-i486-static.conf" >> user-static-binfmt-x86.list
%endif

%check
# Disabled on aarch64 where it fails with several errors.  Will
# investigate and fix when we have access to real hardware

%define archs_skip_tests aarch64
%def_enable archs_ignore_test_failures

%ifnarch %archs_skip_tests

%if_enabled archs_ignore_test_failures
%make V=1 check ||:
%else
%make V=1 check
%endif # archs_ignore_test_failures

%endif # archs_skip_tests

%pre common
%_sbindir/groupadd -r -f %_group
if [ -f %_controldir/qemu-kvm ];then
%pre_control qemu-kvm
mv -f /var/run/control/qemu-kvm /var/run/control/kvm
else
%pre_control kvm
fi

%post common
%post_control -s vmusers kvm

%files
%files common
%dir %_datadir/%name
%_desktopdir/qemu.desktop
%_iconsdir/hicolor/*/apps/*
%_datadir/%name/keymaps
%_datadir/%name/trace-events-all
%_datadir/%name/*.rom
%_datadir/%name/vgabios*.bin
%dir %_datadir/%name/firmware
%_man1dir/%name.1*
%_sysconfdir/udev/rules.d/%rulenum-%name-kvm.rules
%_controldir/*
%if_enabled vnc_sasl
%config(noreplace) %_sysconfdir/sasl2/%name.conf
%endif
%_man7dir/qemu-block-drivers.*
%_man7dir/qemu-ga-ref.*
%_man7dir/qemu-qmp-ref.*
%_man7dir/qemu-cpu-models.*

%files system -f %name.lang

%if_enabled have_kvm
%files kvm
%files kvm-core
%if_enabled qemu_kvm
%_bindir/qemu
%_bindir/qemu-kvm
%_bindir/kvm
%_man1dir/qemu-kvm.1*
%endif
%endif

%files user
%files user-binfmt

%if_enabled user_static
%files user-static
%files user-static-binfmt
%endif

%files img
%_bindir/qemu-img
%_bindir/qemu-io
%_bindir/qemu-nbd
%_man1dir/qemu-img.1*
%_man8dir/qemu-nbd.8*

%files tools
%_libexecdir/virtfs-proxy-helper
%_man1dir/virtfs-proxy-helper.*
%attr(4710,root,vmusers) %_libexecdir/qemu-bridge-helper
%if_enabled virglrenderer
%_libexecdir/vhost-user-gpu
%_datadir/%name/vhost-user/50-qemu-gpu.json
%endif
%_libexecdir/virtiofsd
%_man1dir/virtiofsd.*
%_datadir/qemu/vhost-user/50-qemu-virtiofsd.json
%_bindir/qemu-storage-daemon
%if_enabled mpath
%_bindir/qemu-pr-helper
%_unitdir/qemu-pr-helper.service
%_unitdir/qemu-pr-helper.socket
%_man8dir/qemu-pr-helper.*
%endif
%_bindir/elf2dmp
%_bindir/qemu-edid
%_bindir/qemu-keymap
%config(noreplace) %_sysconfdir/%name/bridge.conf

%if_enabled opengl
%files ui-egl-headless
%_libdir/qemu/ui-egl-headless.so
%endif

%if_enabled brlapi
%files char-baum
%_libdir/qemu/chardev-baum.so
%endif

%if_enabled spice
%files char-spice
%_libdir/qemu/chardev-spice.so

%files device-display-qxl
%_libdir/qemu/hw-display-qxl.so
%endif

%files guest-agent
%_bindir/qemu-ga
%_man8dir/qemu-ga.8*
%_udevrulesdir/%rulenum-%name-guest-agent.rules
%_unitdir/%name-guest-agent.service
%_initdir/%name-guest-agent
%config(noreplace) %_sysconfdir/sysconfig/qemu-ga
%_sysconfdir/%name/fsfreeze-hook
%dir %_sysconfdir/%name/fsfreeze-hook.d
%config(noreplace) %_sysconfdir/%name/fsfreeze-hook.d/*
%ghost %_logdir/qga-fsfreeze-hook.log

%files doc
%docdir/
%exclude %docdir/LICENSE

%files aux
%dir %_sysconfdir/%name
%dir %docdir/
%docdir/LICENSE

%changelog
* Tue May 04 2021 Alexey Shabalin <shaba@altlinux.org> 5.2.0-alt6
- backport to p9 (ALT #39996)
- Fixed execute fsfreeze hook (ALT #37000)

* Mon Apr 12 2021 Ivan A. Melnikov <iv@altlinux.org> 5.2.0-alt5
- Move qemu-user-static text segment to 0x60000000 (ALT #39178)
- Drop qemu-aux dependency from qemu-user-static (ALT #39815)
- Drop qemu-mipsn32*.conf from binfmt config packages (ALT #39619)

* Mon Feb 01 2021 Andrew A. Vasilyev <andy@altlinux.org> 5.2.0-alt4
- Add the Kunpeng-920 CPU model.

* Sun Jan 17 2021 Alexey Shabalin <shaba@altlinux.org> 5.2.0-alt3
- Switch bios-microvm.bin from qboot to seabios
- Package /usr/share/qemu/firmware dir
- Define firmware path as --firmwarepath for configure

* Thu Jan 14 2021 Ivan A. Melnikov <iv@altlinux.org> 5.2.0-alt2
- fix elf loading in qemu-user (altbug #39141)
- restore special CPU selection for ARM qemu-user-static

* Thu Dec 24 2020 Alexey Shabalin <shaba@altlinux.org> 4.2.1-alt4
- Fixes: CVE-2020-25723

* Tue Dec 22 2020 Alexey Shabalin <shaba@altlinux.org> 4.2.1-alt3
- Add ipxe-roms-qemu to requires for all arches

* Tue Dec 15 2020 Alexey Shabalin <shaba@altlinux.org> 5.2.0-alt1
- 5.2.0 (Fixes: CVE-2020-14364)
- Drop ivshmem-tools package
- Drop lm32 and unicore32 arches
- Add new packages:
  + qemu-audio-spice
  + qemu-char-spice
  + qemu-display-virtio-gpu-pci
  + qemu-display-virtio-vga
  + qemu-display-virtio-gpu
  + qemu-ui-spice-core
  + qemu-ui-opengl
  + qemu-ui-egl-headless

* Tue Nov 17 2020 Alexey Shabalin <shaba@altlinux.org> 4.2.1-alt2
- Fixes: CVE-2020-15863, CVE-2020-24352, CVE-2020-14364

* Thu Aug 13 2020 Alexey Shabalin <shaba@altlinux.org> 5.1.0-alt1
- 5.1.0 (Fixes: CVE-2020-13253, CVE-2020-13754, CVE-2020-10761, CVE-2020-13800, CVE-2020-10717)

* Mon Jul 06 2020 Alexey Shabalin <shaba@altlinux.org> 4.2.1-alt1
- 4.2.1 (Fixes: CVE-2020-1983, CVE-2020-10761, CVE-2020-1711, CVE-2020-13800, CVE-2020-11869, CVE-2020-13361)

* Thu Apr 30 2020 Alexey Shabalin <shaba@altlinux.org> 5.0.0-alt1
- 5.0.0 (Fixes: VE-2018-12617, CVE-2020-1711)
- drop bluez support
- build emulator for RX

* Sun Apr  5 2020 Nikita Ermakov <arei@altlinux.org> 4.2.0-alt3
- Fix FP context saving in RISC-V target.

* Thu Feb 27 2020 Alexey Shabalin <shaba@altlinux.org> 4.2.0-alt2
- Arithmetic error in EDID generation fixed (boyarsh@)

* Mon Dec 16 2019 Alexey Shabalin <shaba@altlinux.org> 4.2.0-alt1
- 4.2.0

* Mon Dec 09 2019 Alexey Shabalin <shaba@altlinux.org> 4.1.1-alt1
- 4.1.1

* Fri Aug 16 2019 Alexey Shabalin <shaba@altlinux.org> 4.1.0-alt1
- 4.1.0

* Thu Aug 15 2019 Alexey Shabalin <shaba@altlinux.org> 4.0.0-alt5
- change back suffix .static for binaries in user-static package

* Sun Aug 11 2019 Alexey Shabalin <shaba@altlinux.org> 4.0.0-alt4
- change suffix from .static to -static for binaries in user-static package (ALT #37083)

* Fri Aug 09 2019 Nikita Ermakov <arei@altlinux.org> 4.0.0-alt3
- fix to handle variably sized SIOCGSTAMP with new kernels.

* Mon Jun 03 2019 Gleb F-Malinovskiy <glebfm@altlinux.org> 4.0.0-alt2
- qemu-kvm: fixed armh and aarch64 support.
- Added ppc* architectures support.
- Updated BR: libfdt-devel minimal version.

* Fri May 31 2019 Alexey Shabalin <shaba@altlinux.org> 4.0.0-alt1
- 4.0.0
- define md-clear CPUID bit
  (fixes: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091)

* Fri Feb 22 2019 Alexey Shabalin <shaba@altlinux.org> 3.1.0-alt2
- disable support ceph on 32-bit arch

* Thu Dec 13 2018 Alexey Shabalin <shaba@altlinux.org> 3.1.0-alt1
- 3.1.0

* Tue Dec 11 2018 Ilfat Aminov <aminov@altlinux.org> 3.0.0-alt4
- Enable OpenGL support

* Tue Nov 20 2018 Lenar Shakirov <snejok@altlinux.ru> 3.0.0-alt3
- qemu-kvm.sh fixed on i?86 systems

* Thu Sep 13 2018 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt2
- disable vde support

* Wed Aug 15 2018 Alexey Shabalin <shaba@altlinux.org> 3.0.0-alt1
- 3.0.0

* Wed Jul 11 2018 Alexey Shabalin <shaba@altlinux.ru> 2.12.0-alt2
- rebuilt against libnfs.so.12
- set arch for qemu-kvm,qemu-user-binfmt,qemu-user-static-binfmt packages

* Fri Apr 27 2018 Alexey Shabalin <shaba@altlinux.ru> 2.12.0-alt1
- 2.12.0
- use python3 for build
- generate binfmt configs with qemu-binfmt-conf.sh
- build all supported arch targets (riscv too)
- new packages:
  + qemu-audio-alsa
  + qemu-audio-oss
  + qemu-audio-pa
  + qemu-audio-sdl
  + qemu-ui-curses
  + qemu-ui-gtk
  + qemu-ui-sdl

* Fri Feb 16 2018 Alexey Shabalin <shaba@altlinux.ru> 2.11.1-alt1
- 2.11.1
- This update contains new functionality needed to enable mitigations
  for Spectre/Meltdown (CVE-2017-5715)
- fixes for potential host DoS attacks via VGA devices (CVE-2018-5683)
  and VNC clients (CVE-2017-15124)
- revert define MAX_RESERVED_VA for arm

* Wed Jan 31 2018 Alexey Shabalin <shaba@altlinux.ru> 2.11.0-alt2
- backport patch for fix configure test memfd
- add support fsfreeze-hook for qemu guest agent
- move helpers from system to tools package

* Wed Dec 20 2017 Alexey Shabalin <shaba@altlinux.ru> 2.11.0-alt1
- 2.11.0

* Thu Nov 02 2017 Gleb F-Malinovskiy <glebfm@altlinux.org> 2.10.1-alt3
- Enabled support of *attr syscalls in qemu-user static binaries.

* Fri Oct 13 2017 Alexey Shabalin <shaba@altlinux.ru> 2.10.1-alt2
- fixed qemu-kvm for armh and aarch64 (sbolshakov@)
- disable numa for armh (sbolshakov@)

* Tue Oct 10 2017 Alexey Shabalin <shaba@altlinux.ru> 2.10.1-alt1
- 2.10.1
- package arm flavour, with defaults to aarch64
- build without tcmalloc
- split system package to arch subpackages
- build block transports as modules and package to separated packages
- build with OpenRisc32,NIOS2,Xtensa emulator
- rename package qemu-user-binfmt_misc to qemu-user-static
- add qemu-user-binfmt and qemu-user-static-binfmt packages with configs in /lib/binfmt.d

* Fri Sep 01 2017 Alexey Shabalin <shaba@altlinux.ru> 2.10.0-alt1
- 2.10.0
- build with SDL2

* Wed Jun 28 2017 Yuri N. Sedunov <aris@altlinux.org> 2.9.0-alt1.1
- rebuild against libnfs.so.11

* Fri Apr 21 2017 Alexey Shabalin <shaba@altlinux.ru> 2.9.0-alt1
- 2.9.0

* Wed Dec 21 2016 Alexey Shabalin <shaba@altlinux.ru> 2.8.0-alt1
- 2.8.0
- enable xen support

* Sat Oct 01 2016 Alexey Shabalin <shaba@altlinux.ru> 2.6.2-alt1
- 2.6.2

* Tue Sep 06 2016 Alexey Shabalin <shaba@altlinux.ru> 2.6.1-alt1
- 2.6.1
- fixed CVE-2016-4439,CVE-2016-4441,CVE-2016-4952

* Fri May 13 2016 Alexey Shabalin <shaba@altlinux.ru> 2.6.0-alt1
- 2.6.0
- fixed CVE-2015-8558,CVE-2015-8619,CVE-2016-1981,CVE-2016-3710,CVE-2016-3712
- move virtfs-proxy-helper and qemu-bridge-helper to from qemu-img to qemu-system
- ignore test failures for check
- add vhost-net manage to control
- disable xen support

* Tue Apr 12 2016 Denis Medvedev <nbr@altlinux.org> 2.5.0-alt2
- Fixed linking.

* Fri Dec 18 2015 Alexey Shabalin <shaba@altlinux.ru> 2.5.0-alt1
- 2.5.0
- add tilegx arch
- build with jemalloc support
- libcacard is now a standalone project
- build with virgl support
- build with seccomp support
- add ivshmem-tools package
- add qemu-guest-agent sysv script

* Thu Nov 05 2015 Alexey Shabalin <shaba@altlinux.ru> 2.4.1-alt1
- 2.4.1

* Fri Oct 02 2015 Alexey Shabalin <shaba@altlinux.ru> 2.4.0.1-alt1
- 2.4.0.1
- build without gtk3 ui

* Thu Jun 25 2015 Alexey Shabalin <shaba@altlinux.ru> 2.3.0-alt5
- Fixes a crash during image compression (RH#1214855)

* Wed Jun 24 2015 Alexey Shabalin <shaba@altlinux.ru> 2.3.0-alt4
- add requires edk2-ovmf

* Mon Jun 15 2015 Alexey Shabalin <shaba@altlinux.ru> 2.3.0-alt3
- add aarch64-softmmu to target_list_system
- fixed CVE-2015-4037, CVE-2015-3209

* Thu May 14 2015 Alexey Shabalin <shaba@altlinux.ru> 2.3.0-alt2
- fixed CVE-2015-3456

* Tue Apr 28 2015 Alexey Shabalin <shaba@altlinux.ru> 2.3.0-alt1
- 2.3.0
- build with ceph, xfsctl, libnfs, glusterfs support

* Tue Dec 16 2014 Alexey Shabalin <shaba@altlinux.ru> 2.2.0-alt1
- 2.2.0

* Tue Sep 30 2014 Alexey Shabalin <shaba@altlinux.ru> 2.1.2-alt1
- 2.1.2

* Thu Sep 11 2014 Alexey Shabalin <shaba@altlinux.ru> 2.1.1-alt1
- 2.1.1

* Mon Aug 04 2014 Alexey Shabalin <shaba@altlinux.ru> 2.1.0-alt1
- 2.1.0

* Fri Apr 25 2014 Alexey Shabalin <shaba@altlinux.ru> 2.0.0-alt2
- fixed migration from older versions (ALT#30033)
- fixed build on arm

* Fri Apr 18 2014 Alexey Shabalin <shaba@altlinux.ru> 2.0.0-alt1
- 2.0.0
- build aarch64-linux-user
- enable support libusb (ALT#29981)
- add condition for libnfs, but disable (need libnfs package)
- enable quorum support
- enable xen support
- enable lzo and snappy support
- enable build with cris,microblaze,sh4 build
- add binfmt config

* Tue Dec 10 2013 Alexey Shabalin <shaba@altlinux.ru> 1.7.0-alt3
- rebuild with new libiscsi

* Mon Dec 02 2013 Alexey Shabalin <shaba@altlinux.ru> 1.7.0-alt2
- fixed %%post and %%preun common package

* Thu Nov 28 2013 Alexey Shabalin <shaba@altlinux.ru> 1.7.0-alt1
- 1.7.0

* Fri Oct 11 2013 Alexey Shabalin <shaba@altlinux.ru> 1.6.1-alt1
- 1.6.1 (fixed CVE-2013-4344)
- drop qemu-kvm service

* Fri Aug 16 2013 Alexey Shabalin <shaba@altlinux.ru> 1.6.0-alt1
- 1.6.0
- build with rdma support

* Fri Aug 09 2013 Alexey Shabalin <shaba@altlinux.ru> 1.5.2-alt2
- switch from vgabios to seavgabios

* Mon Jul 29 2013 Alexey Shabalin <shaba@altlinux.ru> 1.5.2-alt1
- 1.5.2
- fixed CVE-2013-2231

* Thu Jul 04 2013 Alexey Shabalin <shaba@altlinux.ru> 1.5.1-alt1
- 1.5.1

* Tue May 21 2013 Alexey Shabalin <shaba@altlinux.ru> 1.5.0-alt1
- 1.5.0
- build with libssh2
- build with tpm
- build with gtk3 ui

* Mon May 06 2013 Alexey Shabalin <shaba@altlinux.ru> 1.4.1-alt1
- 1.4.1

* Tue Apr 16 2013 Fr. Br. George <george@altlinux.ru> 1.4.0-alt1.1
- Fix test (FC patch)

* Mon Feb 18 2013 Alexey Shabalin <shaba@altlinux.ru> 1.4.0-alt1
- 1.4.0

* Mon Dec 24 2012 Ivan Ovcherenko <asdus@altlinux.org> 1.2.0-alt3
- Rebuild with Flattened Device Tree support.

* Fri Nov 02 2012 Dmitry V. Levin <ldv@altlinux.org> 1.2.0-alt2
- Introduced -aux subpackage, updated interpackage dependencies.

* Fri Oct 05 2012 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.2.0-alt1.1
- Rebuilt with libpng15

* Mon Sep 10 2012 Alexey Shabalin <shaba@altlinux.ru> 1.2.0-alt1
- 1.2.0

* Thu Aug 30 2012 Dmitry V. Levin <ldv@altlinux.org> 1.1.0-alt5
- Use upstreamed version of the getdents emulation fix,
  to ease further merges.

* Fri Aug 17 2012 Dmitry V. Levin <ldv@altlinux.org> 1.1.0-alt4
- Fixed emulation of getdents.

* Thu Aug 09 2012 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.1.0-alt3
- binfmt_misc: package two arm flavours, with defaults to armv5 and armv7

* Wed Jul 25 2012 Alexey Shabalin <shaba@altlinux.ru> 1.1.0-alt2
- reverted make check

* Fri Jul 20 2012 Alexey Shabalin <shaba@altlinux.ru> 1.1.0-alt1
- git snapshot of stable-1.1 branch (b7093f294c330c4db789c077dac9d8611e4f8ee0)
- add systemd unit files
- split qemu-guest agent package

* Mon Mar 05 2012 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.0.1-alt2
- change arm defaults to convenient values

* Thu Mar 01 2012 Alexey Shabalin <shaba@altlinux.ru> 1.0.1-alt1
- 1.0.1
- enable libiscsi support

* Fri Dec 02 2011 Alexey Shabalin <shaba@altlinux.ru> 1.0-alt1
- 1.0
- add usb-redir support
- enable spice for i686
- enable compile alpha

* Thu Oct 13 2011 Alexey Shabalin <shaba@altlinux.ru> 0.15.1-alt1
- 0.15.1

* Thu Aug 11 2011 Alexey Shabalin <shaba@altlinux.ru> 0.15.0-alt1
- 0.15.0
- disable compile alpha
- enable compile s390x, lm32, unicore32
- enable smartcard support
- enable compile guest agent

* Mon May 16 2011 Alexey Shabalin <shaba@altlinux.ru> 0.14.1-alt1
- 0.14.1

* Wed Mar 02 2011 Alexey Shabalin <shaba@altlinux.ru> 0.14.0-alt4
- enable pulseaudio support

* Mon Feb 28 2011 Alexey Shabalin <shaba@altlinux.ru> 0.14.0-alt3
- enable SDL support
- disable pulseaudio support

* Fri Feb 25 2011 Alexey Shabalin <shaba@altlinux.ru> 0.14.0-alt2
- add udev rules,control rules, init script for load kvm kernel module (import from qemu-kvm package)
- drop alternatives for qemu-img
- add doc subpackage
- move man and locales to common subpackage
- use roms and bioses from another packages: vgabios,seabios,gpxe-roms-qemu
- disable SDL support

* Wed Feb 16 2011 Alexey Shabalin <shaba@altlinux.ru> 0.14.0-alt1
- 0.14.0 release

* Fri Feb 04 2011 Alexey Shabalin <shaba@altlinux.ru> 0.14.0-alt0.rc0
- 0.14.0-rc0

* Wed Jan 19 2011 Alexey Shabalin <shaba@altlinux.ru> 0.13.50-alt1
- snapshot 5677903453
- add alternatives for qemu-system-%ix86
- add img subpackage, add alternatives for qemu-img and other
- cleanup attr
- add spice support for x86_64 only
- add libalsa-devel to buildreq for alsa support
- add vnc-jpeg and vnc-png support
- add adlib and hda soundcards
- build without esound support
- add libpci-devel to buildreq
- fix bluez buildreq
- drop non devel library from buildreq
- install config for sasl
- fix install /etc/qemu/*.conf
- qemu-common package as noarch

* Thu Jan 14 2010 Kirill A. Shutemov <kas@altlinux.org> 0.12.1-alt1
- v0.12.1-31-g49a3aaa
- Fix NULL pointer dereference on handling -chardev socket

* Mon Dec 14 2009 Kirill A. Shutemov <kas@altlinux.org> 0.11.92-alt1
- v0.12.0-rc2-3-g910628f
- UUID support enabled

* Sat Sep 19 2009 Kirill A. Shutemov <kas@altlinux.org> 0.11.50-alt6
- Fix building binfmt_misc binaries

* Sat Sep 19 2009 Kirill A. Shutemov <kas@altlinux.org> 0.11.50-alt5
- v0.11.0-rc0-867-gdbf9580
- Do not set uname for linux-user targets
- Use %%check section for tests

* Tue Sep 08 2009 Kirill A. Shutemov <kas@altlinux.org> 0.11.50-alt4
- v0.11.0-rc0-799-g2637c75
- Compile alpha, m68k, mips and sparc support by default
- Enable Linux AIO
- Enalbe unit tests
- Review configure options
- Update URL
- Update PIE patches

* Tue Sep 01 2009 Kirill A. Shutemov <kas@altlinux.org> 0.11.50-alt3
- Disable IO thread to fix KVM support

* Tue Sep 01 2009 Kirill A. Shutemov <kas@altlinux.org> 0.11.50-alt2
- fix building on x86_64

* Fri Aug 21 2009 Kirill A. Shutemov <kas@altlinux.org> 0.11.50-alt1
- updated to v0.11.0-rc0-564-g757506d
  + no KQEMU support any more
  + fixes CVE-2008-0928 (ALT #20010)
  + keyboard works fine without -k (ALT #15774)
  + framebuffer works fine with -kernel (ALT #11324)
- build linux-user targets as PIE and drop link hack
- enable KVM support
- enable curl support
- enable IO thread
- enable VNC SASL support
- enable bluez support

* Thu Feb 19 2009 Kirill A. Shutemov <kas@altlinux.ru> 0.9.1-alt11
- svn 20090219
- add hack to implement CLONE_CHILD_CLEARTID
- enable more audio drivers and cards
- enable curses support
- enable vde support
- enable VNC TLS support

* Sun Dec 14 2008 Kirill A. Shutemov <kas@altlinux.ru> 0.9.1-alt10
- svn 20081214
  + no need in gcc3 any more
- fixes for mmap() related code

* Mon Oct 13 2008 Kirill A. Shutemov <kas@altlinux.ru> 0.9.1-alt9
- svn 20081013
- fix mmap(), mremap() and shmat() syscalls on 64-bit host with
  32-bit targets

* Fri Oct 10 2008 Kirill A. Shutemov <kas@altlinux.ru> 0.9.1-alt8
- rename binaries in package qemu-user-binfmt_misc back to *.static
  to make them compatible with hasher

* Fri Oct 10 2008 Kirill A. Shutemov <kas@altlinux.ru> 0.9.1-alt7
- svn 20081010
  + some changes merged to upstream
- enable/disable binfmt_misc support at compile time
- fix and cleanup system v ipc syscalls
- fix getdents* syscalls
- fix fstatat64()/newfstatat() syscalls
- implement readahead() syscall
- revert some legacy changes

* Sun Sep 14 2008 Kirill A. Shutemov <kas@altlinux.ru> 0.9.1-alt6
- Fix building with glibc-kernheaders-2.6.27-alt1

* Mon Sep 08 2008 Kirill A. Shutemov <kas@altlinux.ru> 0.9.1-alt5
- svn 20080908
- Implement futimesat() syscall
- binfmt-misc-friendly:
  + Use auxv to find out binary file descriptor
- ioctl:
  + Implement ioctls MTIOCTOP, MTIOCGET and MTIOCPOS

* Sun Aug 31 2008 Kirill A. Shutemov <kas@altlinux.ru> 0.9.1-alt4
- 0.9.1 + svn 20080831
- Add option -binfmt-misc-friendly to user emulators

* Fri Aug 29 2008 Kirill A. Shutemov <kas@altlinux.ru> 0.9.1-alt3
- fix building on i586
- implement fstatat64() syscall

* Sat Aug 23 2008 Kirill A. Shutemov <kas@altlinux.ru> 0.9.1-alt2
- 0.9.1 + svn 20080829
  + CVE-2008-2004
  + Brand new "Tiny Code Generator" by Fabrice Bellard
  + A lot of changes
- Review all changes and patches cleanup
- fix vfork(2) implementation
- Build only x86, arm and ppc architectures by default

* Tue Jan 29 2008 Kirill A. Shutemov <kas@altlinux.ru> 0.9.1-alt1.cvs20080127
- 0.9.1 + cvs 20080127
- fix-syscalls--iovec
  + do not stop iovec conversion on iov_base == NULL if iov_len is 0
- fix-signals
  + do not show message on uncaught target signal

* Sun Nov 25 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0.cvs20071124-alt15
- cvs 20071124
- fix-syscalls--getgroups:
  + getgroups: return total number of supplementary group IDs for the
    process if size == 0

* Sat Nov 24 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0.cvs20071123-alt14
- cvs 20071123
- fix-cpu-copy:
  + Handle cpu_model in copy_cpu()

* Mon Nov 19 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0.cvs20071119-alt13
- cvs 20071119
- Branch based git repo
- Fix execve syscall
- Build all targets
- adlib: include missed header
- Cleanup configure options
- Drop obsoleted/unsupported patches:
  + qemu-0.6.2-alt-hdtrans.patch
  + qemu-0.7.0-sigaltstackhack.patch
  + qemu-0.9.0-alt-alpha_syscall_nr.patch
  + qemu-0.9.0-alt-arm_syscall_nr.patch
  + qemu-0.9.0-alt-i386_syscall_nr.patch
  + qemu-0.9.0-alt-m68k_syscall_nr.patch
  + qemu-0.9.0-alt-ppc64_syscall_nr.patch
  + qemu-0.9.0-alt-ppc_syscall_nr.patch
  + qemu-0.9.0-alt-qvm86.patch
  + qemu-0.9.0-alt-sh4_syscall_nr.patch
  + qemu-0.9.0-alt-sparc64_syscall_nr.patch
  + qemu-0.9.0-alt-sparc_syscall_nr.patch
  + qemu-0.9.0-alt-syscall_cleanup.patch
  + qemu-0.9.0-disk-scsi.patch
  + qemu-0.9.0-vmware_vga-fix.patch

* Thu Oct 25 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0.cvs20070917-alt12
- cvs 20070917
- Added qemu-0.9.0-alt-shm.patch
  + Add shm* syscalls
- Sync patches with new version
- Update qemu-0.9.0-security.patch
  + part of fix is in the upsteam
- qemu-0.9.0-alt-alpha_syscall_nr.patch, qemu-0.9.0-alt-ppc64_syscall_nr.patch
  + sync syscall numbers with kernel
- Drop qemu-0.9.0-alt-statfs.patch
  + fixed in upstream

* Fri Aug 24 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0.cvs20070607-alt11
- qemu-arm: uname -m => armv4l/armv4b
- fix path(): return NULL if NULL passed

* Fri Jun 08 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0.cvs20070607-alt10
- cvs 20070607
- qemu-0.8.2-nptl.patch -> qemu-0.9.0-nptl.patch, qemu-0.9.0-disk-scsi.patch:
  + rejection fix
- Drop qemu-0.9.0-alt-mips_syscall_nr.patch
  + in the upstream now
- Update qemu-0.9.0-alt-sem.patch and qemu-0.9.0-alt-sem.patch
  + part of this patches is in the upstream now

* Mon May 21 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0.cvs20070420-alt9
- Added qemu-0.9.0-alt-getgroups.patch
  + trivial fix
- Moved qemu-0.9.0-sem.patch -> qemu-0.9.0-alt-sem.patch:
  + Fix do_semctl
  + Added standalone syscalls semget, semop, semctl
- Moved qemu-0.9.0-msgop.patch -> qemu-0.9.0-alt-sem.patch
  + Added standalone syscalls msg*
- Dropped qemu-0.9.0-efault.patch

* Tue Apr 03 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0.cvs20070420-alt8
- cvs 20070420
- Added qemu-0.9.0-security.patch:
  + CVE-2007-1320, CVE-2007-1321, CVE-2007-1322, CVE-2007-1323, CVE-2007-1366
- Added qemu-0.9.0-sb16-fix.patch:
  + Fix infinite loop in the SB16 driver
- Disable building alpha emulation due build error
- Update qemu-0.8.2-nptl.patch
  + Fix cpu_env list corruption by disabling CLONE_VM when doing CLONE_VFORK.
    This is a hack to avoid segfault on vfork.
- Added qemu-0.9.0-nptl-update.patch:
  + implemented/fixed several nptl-related syscalls
  + Fix build on i586
- Added qemu-0.9.0-vmware_vga-fix.patch:
  + Disable -vmwarevga acceleration code for now (missing range checks)
- Fix bug #11363
  + rename qemu to qemu-system-i386
  + add symlink qemu to qemu-system-%%_target_os
- Added qemu-0.8.2-deb-tls-ld.patch
  + Fix segfault of user mode qemu on ix86
- Updated qemu-0.9.0-alt-path.patch
  + content of emulation dir can change
  + some refactoring
- Added qemu-0.9.0-alt-arm-eabi-pread-pwrite.patch:
  + pread and pwrite syscall fix for ARM EABI guest
- Added qemu-0.9.0-alt-statfs.patch
  + fix statfs syscall bug
- Updated qemu-0.9.0-alt-i386-user-fix.patch
  + fix qemu-i386 on x86 host
- Update qemu-0.8.2-alt-qvm86.patch -> qemu-0.9.0-alt-qvm86.patch:
  + rejection fexed
- Updated qemu-0.9.0-disk-scsi.patch
  + rejection fixed
- Update qemu-0.9.0-alt-syscall_cleanup.patch:
  + rejection fixed

* Sun Mar 25 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0.cvs20070324-alt7
- cvs 20070324
- Sync syscall numbers with linux-2.6.21-rc4
- Update linux-user/syscall.c:
  + build fix
  + cleaup
- Dropped Debian's patches
- Added qemu-0.9.0-alt-i386-user-fix.patch:
  + fix SIGSEGV in qemu-i386 (by Sergey Vlasov aka vsu@)
- Added qemu-0.9.0-efault.patch:
  + fix returning EFAULT from syscalls
- Added qemu-0.9.0-msgop.patch:
  + fix msg* syscalls
- Added qemu-0.9.0-sem.patch:
  + fix sem* syscalls
- Dropped qemu-0.9.0-alt-fcntl64-fix.patch:
  + in upstream now

* Tue Mar 20 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0.cvs20070320-alt6
- cvs 20070320
- Dropped 43_arm_cpustate.patch,
  qemu-0.9.0-alt-syscall-getsockname-fix.patch,
  qemu-0.9.0-alt-syscalls-clock.patch,
  qemu-0.9.0-alt-syscalls-recv-and-recvfrom-fix.patch:
  + fixed in upstream now
- Updated qemu-0.9.0-alt-makefile.patch, qemu-0.9.0-disk-scsi.patch:
  + fix rejections
- Updated qemu-0.9.0-alt-fcntl64-fix.patch:
  + pass host flag to fcntl instead target flag
- Renamed qemu-0.8.2-alt-path.patch -> qemu-0.9.0-alt-path.patch
- Updated qemu-0.9.0-alt-path.patch:
  + fix memory leak by caching
- Spec cleap

* Fri Mar 09 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0.cvs20070304-alt5
- fix fcntl64 syscal: used TARGET_F_*64 instead F_*64
- cdrom name fixed
- option -disk scsi,type=cdrom fixed (bug #11010)

* Sun Mar 04 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0.cvs20070304-alt4
- cvs snapshot
- fix order of ide devices(bug #11004)
- drop mdk patches
- user gcc 3.4 for building(bug #11006)
- fix sigfault
- spec cleanup

* Thu Mar 01 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0-alt3
- cdrom option fixed(bug #10971)
- syscall clock_gettime rewritten
- syscall clock_getres added
- syscalls getsockname, recv and recvfrom fixed

* Wed Feb 28 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0-alt2
- scsi disk support added

* Thu Feb 15 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0-alt1
- lock_user_string used for mount syscall

* Wed Feb 07 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0-alt0.3
- requires fixed
- docs is in package qemu-common now
- description and summary fixed
- alsa enabled
- spec cleanup

* Wed Feb 07 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0-alt0.2
- mandriva patches updated
- fix realpath() crash again (by vsu@)

* Tue Feb 06 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.9.0-alt0.1
- 0.9.0
- separate into four packages: qemu, softmmu, user, user-static
- spec cleanup
- patches updated

* Mon Feb 05 2007 Kirill A. Shutemov <kas@altlinux.ru> 0.8.2-alt1.2
- fix crash with -fstack-protector due to wrong realpath() usage
- patches reorganized, debian patches added
- qemu-0.8.2-alt-path.patch fixed
- qemu-arm: uname -m => armv5l/armv5b
- qemu-0.8.2-alt-mmap.patch added
- support msg* and sem* syscalls
- name for static version: qemu-<arch>.static

* Thu Dec 14 2006 Kirill A. Shutemov <kas@altlinux.ru> 0.8.2-alt1.1
- build static version of qemu-arm
- patches for qemu-arm and other linux mode emulators

* Wed Aug 23 2006 Alexey Tourbin <at@altlinux.ru> 0.8.2-alt1
- 0.8.0 -> 0.8.2
- sync madriva patches 0.8.2-1mdv2007.0
- removed kernel-source-kqemu from here, which should be packaged
  separately because of its non-free status
- added support for /dev/qvm86

* Wed Dec 21 2005 Kachalov Anton <mouse@altlinux.ru> 0.8.0-alt1
- 0.8.0

* Tue Sep 20 2005 Kachalov Anton <mouse@altlinux.ru> 0.7.2-alt1
- 0.7.2
- Updated Kqemu to 0.7.2

* Thu Aug 04 2005 Kachalov Anton <mouse@altlinux.ru> 0.7.1-alt1
- 0.7.1
- Updated:
  * Kqemu to 0.7.1-1
  * GTK support

* Thu Jun 23 2005 Kachalov Anton <mouse@altlinux.ru> 0.7.0-alt2
- Added:
  * GTK support (-use-gtk option)
  * Distribution permission from Fabrice Bellard to Kqemu

* Fri Apr 29 2005 Kachalov Anton <mouse@altlinux.ru> 0.7.0-alt1
- 0.7.0
- Kqemu support

* Mon Nov 29 2004 Kachalov Anton <mouse@altlinux.ru> 0.6.2-alt1
- Snapshot of 23-28 Nov 2004
- LARGE disk fix (actual for NT4, win2k, winXP)

* Fri Nov 26 2004 Kachalov Anton <mouse@altlinux.ru> 0.6.1-alt1
- 0.6.1

* Sun Oct 17 2004 Alexey Tourbin <at@altlinux.ru> 0.6.0-alt1
- initial revision