|
12 | 12 | %define supported_platform 0 |
13 | 13 | %endif |
14 | 14 |
|
15 | | -# Default to skipping autoreconf. Distros can change just this one line |
16 | | -# (or provide a command-line override) if they backport any patches that |
17 | | -# touch configure.ac or Makefile.am. |
18 | | -%{!?enable_autotools:%global enable_autotools 0} |
19 | | - |
20 | 15 | # The hypervisor drivers that run in libvirtd |
21 | 16 | %define with_qemu 0%{!?_without_qemu:1} |
22 | 17 | %define with_lxc 0%{!?_without_lxc:1} |
|
203 | 198 | # compiler warning into errors without being worried about frequent |
204 | 199 | # changes in reported warnings |
205 | 200 | %if 0%{?rhel} |
206 | | - %define enable_werror --enable-werror |
| 201 | + %define enable_werror -Dwerror=true |
207 | 202 | %else |
208 | | - %define enable_werror --disable-werror |
| 203 | + %define enable_werror -Dwerror=false |
209 | 204 | %endif |
210 | 205 |
|
211 | 206 | %if 0%{?rhel} == 7 |
@@ -257,18 +252,15 @@ Requires: libvirt-libs = %{version}-%{release} |
257 | 252 |
|
258 | 253 | # All build-time requirements. Run-time requirements are |
259 | 254 | # listed against each sub-RPM |
260 | | -%if 0%{?enable_autotools} |
261 | | -BuildRequires: autoconf |
262 | | -BuildRequires: automake |
263 | 255 | BuildRequires: gettext-devel |
264 | | -BuildRequires: libtool |
265 | | -%endif |
266 | 256 | %if 0%{?rhel} == 7 |
267 | 257 | BuildRequires: python36-docutils |
268 | 258 | %else |
269 | 259 | BuildRequires: python3-docutils |
270 | 260 | %endif |
271 | 261 | BuildRequires: gcc |
| 262 | +BuildRequires: meson >= 0.54.0 |
| 263 | +BuildRequires: ninja-build |
272 | 264 | BuildRequires: make |
273 | 265 | BuildRequires: git |
274 | 266 | %if 0%{?fedora} || 0%{?rhel} > 7 |
@@ -1006,219 +998,209 @@ exit 1 |
1006 | 998 | %endif |
1007 | 999 |
|
1008 | 1000 | %if %{with_qemu} |
1009 | | - %define arg_qemu --with-qemu |
| 1001 | + %define arg_qemu -Ddriver_qemu=enabled |
1010 | 1002 | %else |
1011 | | - %define arg_qemu --without-qemu |
| 1003 | + %define arg_qemu -Ddriver_qemu=disabled |
1012 | 1004 | %endif |
1013 | 1005 |
|
1014 | 1006 | %if %{with_openvz} |
1015 | | - %define arg_openvz --with-openvz |
| 1007 | + %define arg_openvz -Ddriver_openvz=enabled |
1016 | 1008 | %else |
1017 | | - %define arg_openvz --without-openvz |
| 1009 | + %define arg_openvz -Ddriver_openvz=disabled |
1018 | 1010 | %endif |
1019 | 1011 |
|
1020 | 1012 | %if %{with_lxc} |
1021 | | - %define arg_lxc --with-lxc |
1022 | | - %define arg_login_shell --with-login-shell |
| 1013 | + %define arg_lxc -Ddriver_lxc=enabled |
| 1014 | + %define arg_login_shell -Dlogin_shell=enabled |
1023 | 1015 | %else |
1024 | | - %define arg_lxc --without-lxc |
1025 | | - %define arg_login_shell --without-login-shell |
| 1016 | + %define arg_lxc -Ddriver_lxc=disabled |
| 1017 | + %define arg_login_shell -Dlogin_shell=disabled |
1026 | 1018 | %endif |
1027 | 1019 |
|
1028 | 1020 | %if %{with_vbox} |
1029 | | - %define arg_vbox --with-vbox |
| 1021 | + %define arg_vbox -Ddriver_vbox=enabled |
1030 | 1022 | %else |
1031 | | - %define arg_vbox --without-vbox |
| 1023 | + %define arg_vbox -Ddriver_vbox=disabled |
1032 | 1024 | %endif |
1033 | 1025 |
|
1034 | 1026 | %if %{with_libxl} |
1035 | | - %define arg_libxl --with-libxl |
| 1027 | + %define arg_libxl -Ddriver_libxl=enabled |
1036 | 1028 | %else |
1037 | | - %define arg_libxl --without-libxl |
| 1029 | + %define arg_libxl -Ddriver_libxl=disabled |
1038 | 1030 | %endif |
1039 | 1031 |
|
1040 | 1032 | %if %{with_esx} |
1041 | | - %define arg_esx --with-esx |
| 1033 | + %define arg_esx -Ddriver_esx=enabled |
1042 | 1034 | %else |
1043 | | - %define arg_esx --without-esx |
| 1035 | + %define arg_esx -Ddriver_esx=disabled |
1044 | 1036 | %endif |
1045 | 1037 |
|
1046 | 1038 | %if %{with_hyperv} |
1047 | | - %define arg_hyperv --with-hyperv |
| 1039 | + %define arg_hyperv -Ddriver_hyperv=enabled |
1048 | 1040 | %else |
1049 | | - %define arg_hyperv --without-hyperv |
| 1041 | + %define arg_hyperv -Ddriver_hyperv=disabled |
1050 | 1042 | %endif |
1051 | 1043 |
|
1052 | 1044 | %if %{with_vmware} |
1053 | | - %define arg_vmware --with-vmware |
| 1045 | + %define arg_vmware -Ddriver_vmware=enabled |
1054 | 1046 | %else |
1055 | | - %define arg_vmware --without-vmware |
| 1047 | + %define arg_vmware -Ddriver_vmware=disabled |
1056 | 1048 | %endif |
1057 | 1049 |
|
1058 | 1050 | %if %{with_storage_rbd} |
1059 | | - %define arg_storage_rbd --with-storage-rbd |
| 1051 | + %define arg_storage_rbd -Dstorage_rbd=enabled |
1060 | 1052 | %else |
1061 | | - %define arg_storage_rbd --without-storage-rbd |
| 1053 | + %define arg_storage_rbd -Dstorage_rbd=disabled |
1062 | 1054 | %endif |
1063 | 1055 |
|
1064 | 1056 | %if %{with_storage_sheepdog} |
1065 | | - %define arg_storage_sheepdog --with-storage-sheepdog |
| 1057 | + %define arg_storage_sheepdog -Dstorage_sheepdog=enabled |
1066 | 1058 | %else |
1067 | | - %define arg_storage_sheepdog --without-storage-sheepdog |
| 1059 | + %define arg_storage_sheepdog -Dstorage_sheepdog=disabled |
1068 | 1060 | %endif |
1069 | 1061 |
|
1070 | 1062 | %if %{with_storage_gluster} |
1071 | | - %define arg_storage_gluster --with-storage-gluster |
| 1063 | + %define arg_storage_gluster -Dstorage_gluster=enabled |
1072 | 1064 | %else |
1073 | | - %define arg_storage_gluster --without-storage-gluster |
| 1065 | + %define arg_storage_gluster -Dstorage_gluster=disabled |
1074 | 1066 | %endif |
1075 | 1067 |
|
1076 | 1068 | %if %{with_storage_zfs} |
1077 | | - %define arg_storage_zfs --with-storage-zfs |
| 1069 | + %define arg_storage_zfs -Dstorage_zfs=enabled |
1078 | 1070 | %else |
1079 | | - %define arg_storage_zfs --without-storage-zfs |
| 1071 | + %define arg_storage_zfs -Dstorage_zfs=disabled |
1080 | 1072 | %endif |
1081 | 1073 |
|
1082 | 1074 | %if %{with_numactl} |
1083 | | - %define arg_numactl --with-numactl |
| 1075 | + %define arg_numactl -Dnumactl=enabled |
1084 | 1076 | %else |
1085 | | - %define arg_numactl --without-numactl |
| 1077 | + %define arg_numactl -Dnumactl=disabled |
1086 | 1078 | %endif |
1087 | 1079 |
|
1088 | 1080 | %if %{with_numad} |
1089 | | - %define arg_numad --with-numad |
| 1081 | + %define arg_numad -Dnumad=enabled |
1090 | 1082 | %else |
1091 | | - %define arg_numad --without-numad |
| 1083 | + %define arg_numad -Dnumad=disabled |
1092 | 1084 | %endif |
1093 | 1085 |
|
1094 | 1086 | %if %{with_fuse} |
1095 | | - %define arg_fuse --with-fuse |
| 1087 | + %define arg_fuse -Dfuse=enabled |
1096 | 1088 | %else |
1097 | | - %define arg_fuse --without-fuse |
| 1089 | + %define arg_fuse -Dfuse=disabled |
1098 | 1090 | %endif |
1099 | 1091 |
|
1100 | 1092 | %if %{with_sanlock} |
1101 | | - %define arg_sanlock --with-sanlock |
| 1093 | + %define arg_sanlock -Dsanlock=enabled |
1102 | 1094 | %else |
1103 | | - %define arg_sanlock --without-sanlock |
| 1095 | + %define arg_sanlock -Dsanlock=disabled |
1104 | 1096 | %endif |
1105 | 1097 |
|
1106 | 1098 | %if %{with_firewalld} |
1107 | | - %define arg_firewalld --with-firewalld |
| 1099 | + %define arg_firewalld -Dfirewalld=enabled |
1108 | 1100 | %else |
1109 | | - %define arg_firewalld --without-firewalld |
| 1101 | + %define arg_firewalld -Dfirewalld=disabled |
1110 | 1102 | %endif |
1111 | 1103 |
|
1112 | 1104 | %if %{with_firewalld_zone} |
1113 | | - %define arg_firewalld_zone --with-firewalld-zone |
| 1105 | + %define arg_firewalld_zone -Dfirewalld_zone=enabled |
1114 | 1106 | %else |
1115 | | - %define arg_firewalld_zone --without-firewalld-zone |
| 1107 | + %define arg_firewalld_zone -Dfirewalld_zone=disabled |
1116 | 1108 | %endif |
1117 | 1109 |
|
1118 | 1110 | %if %{with_wireshark} |
1119 | | - %define arg_wireshark --with-wireshark-dissector |
| 1111 | + %define arg_wireshark -Dwireshark_dissector=enabled |
1120 | 1112 | %else |
1121 | | - %define arg_wireshark --without-wireshark-dissector |
| 1113 | + %define arg_wireshark -Dwireshark_dissector=disabled |
1122 | 1114 | %endif |
1123 | 1115 |
|
1124 | 1116 | %if %{with_storage_iscsi_direct} |
1125 | | - %define arg_storage_iscsi_direct --with-storage-iscsi-direct |
| 1117 | + %define arg_storage_iscsi_direct -Dstorage_iscsi_direct=enabled |
1126 | 1118 | %else |
1127 | | - %define arg_storage_iscsi_direct --without-storage-iscsi-direct |
| 1119 | + %define arg_storage_iscsi_direct -Dstorage_iscsi_direct=disabled |
1128 | 1120 | %endif |
1129 | 1121 |
|
1130 | 1122 | %define when %(date +"%%F-%%T") |
1131 | 1123 | %define where %(hostname) |
1132 | 1124 | %define who %{?packager}%{!?packager:Unknown} |
1133 | | -%define arg_packager --with-packager="%{who}, %{when}, %{where}" |
1134 | | -%define arg_packager_version --with-packager-version="%{release}" |
| 1125 | +%define arg_packager -Dpackager="%{who}, %{when}, %{where}" |
| 1126 | +%define arg_packager_version -Dpackager_version="%{release}" |
1135 | 1127 |
|
1136 | | -%define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux" |
| 1128 | +%define arg_selinux_mount -Dselinux_mount="/sys/fs/selinux" |
1137 | 1129 |
|
1138 | 1130 | # place macros above and build commands below this comment |
1139 | 1131 |
|
1140 | 1132 | export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) |
1141 | 1133 |
|
1142 | | -%if 0%{?enable_autotools} |
1143 | | - autoreconf -if |
1144 | | -%endif |
1145 | | - |
1146 | | -rm -f po/stamp-po |
1147 | | - |
1148 | | -%define _configure ../configure |
1149 | | -mkdir %{_vpath_builddir} |
1150 | | -cd %{_vpath_builddir} |
1151 | | - |
1152 | | -%configure --enable-dependency-tracking \ |
1153 | | - --with-runstatedir=%{_rundir} \ |
| 1134 | +%meson \ |
| 1135 | + -Drunstatedir=%{_rundir} \ |
1154 | 1136 | %{?arg_qemu} \ |
1155 | 1137 | %{?arg_openvz} \ |
1156 | 1138 | %{?arg_lxc} \ |
1157 | 1139 | %{?arg_vbox} \ |
1158 | 1140 | %{?arg_libxl} \ |
1159 | | - --with-sasl \ |
1160 | | - --with-polkit \ |
1161 | | - --with-libvirtd \ |
| 1141 | + -Dsasl=enabled \ |
| 1142 | + -Dpolkit=enabled \ |
| 1143 | + -Ddriver_libvirtd=enabled \ |
1162 | 1144 | %{?arg_esx} \ |
1163 | 1145 | %{?arg_hyperv} \ |
1164 | 1146 | %{?arg_vmware} \ |
1165 | | - --without-vz \ |
1166 | | - --without-bhyve \ |
1167 | | - --with-remote-default-mode=legacy \ |
1168 | | - --with-interface \ |
1169 | | - --with-network \ |
1170 | | - --with-storage-fs \ |
1171 | | - --with-storage-lvm \ |
1172 | | - --with-storage-iscsi \ |
| 1147 | + -Ddriver_vz=disabled \ |
| 1148 | + -Ddriver_bhyve=disabled \ |
| 1149 | + -Dremote_default_mode=legacy \ |
| 1150 | + -Ddriver_interface=enabled \ |
| 1151 | + -Ddriver_network=enabled \ |
| 1152 | + -Dstorage_fs=enabled \ |
| 1153 | + -Dstorage_lvm=enabled \ |
| 1154 | + -Dstorage_iscsi=enabled \ |
1173 | 1155 | %{?arg_storage_iscsi_direct} \ |
1174 | | - --with-storage-scsi \ |
1175 | | - --with-storage-disk \ |
1176 | | - --with-storage-mpath \ |
| 1156 | + -Dstorage_scsi=enabled \ |
| 1157 | + -Dstorage_disk=enabled \ |
| 1158 | + -Dstorage_mpath=enabled \ |
1177 | 1159 | %{?arg_storage_rbd} \ |
1178 | 1160 | %{?arg_storage_sheepdog} \ |
1179 | 1161 | %{?arg_storage_gluster} \ |
1180 | 1162 | %{?arg_storage_zfs} \ |
1181 | | - --without-storage-vstorage \ |
| 1163 | + -Dstorage_vstorage=disabled \ |
1182 | 1164 | %{?arg_numactl} \ |
1183 | 1165 | %{?arg_numad} \ |
1184 | | - --with-capng \ |
| 1166 | + -Dcapng=enabled \ |
1185 | 1167 | %{?arg_fuse} \ |
1186 | | - --with-netcf \ |
1187 | | - --with-selinux \ |
| 1168 | + -Dnetcf=enabled \ |
| 1169 | + -Dselinux=enabled \ |
1188 | 1170 | %{?arg_selinux_mount} \ |
1189 | | - --without-apparmor \ |
1190 | | - --without-hal \ |
1191 | | - --with-udev \ |
1192 | | - --with-yajl \ |
| 1171 | + -Dapparmor=disabled \ |
| 1172 | + -Dsecdriver_apparmor=disabled \ |
| 1173 | + -Dhal=disabled \ |
| 1174 | + -Dudev=enabled \ |
| 1175 | + -Dyajl=enabled \ |
1193 | 1176 | %{?arg_sanlock} \ |
1194 | | - --with-libpcap \ |
1195 | | - --with-macvtap \ |
1196 | | - --with-audit \ |
1197 | | - --with-dtrace \ |
1198 | | - --with-driver-modules \ |
| 1177 | + -Dlibpcap=enabled \ |
| 1178 | + -Dmacvtap=enabled \ |
| 1179 | + -Daudit=enabled \ |
| 1180 | + -Ddtrace=enabled \ |
1199 | 1181 | %{?arg_firewalld} \ |
1200 | 1182 | %{?arg_firewalld_zone} \ |
1201 | 1183 | %{?arg_wireshark} \ |
1202 | | - --without-pm-utils \ |
1203 | | - --with-nss-plugin \ |
| 1184 | + -Dpm_utils=disabled \ |
| 1185 | + -Dnss=enabled \ |
1204 | 1186 | %{arg_packager} \ |
1205 | 1187 | %{arg_packager_version} \ |
1206 | | - --with-qemu-user=%{qemu_user} \ |
1207 | | - --with-qemu-group=%{qemu_group} \ |
1208 | | - --with-tls-priority=%{tls_priority} \ |
| 1188 | + -Dqemu_user=%{qemu_user} \ |
| 1189 | + -Dqemu_group=%{qemu_group} \ |
| 1190 | + -Dtls_priority=%{tls_priority} \ |
1209 | 1191 | %{?enable_werror} \ |
1210 | | - --enable-expensive-tests \ |
1211 | | - --with-init-script=systemd \ |
| 1192 | + -Dexpensive_tests=enabled \ |
| 1193 | + -Dinit_script=systemd \ |
1212 | 1194 | %{?arg_login_shell} |
1213 | | -make %{?_smp_mflags} V=1 |
| 1195 | + |
| 1196 | +%meson_build |
1214 | 1197 |
|
1215 | 1198 | %install |
1216 | 1199 | rm -fr %{buildroot} |
1217 | 1200 |
|
1218 | 1201 | export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) |
1219 | 1202 |
|
1220 | | -cd %{_vpath_builddir} |
1221 | | -%make_install %{?_smp_mflags} SYSTEMD_UNIT_DIR=%{_unitdir} V=1 |
| 1203 | +%meson_install |
1222 | 1204 |
|
1223 | 1205 | rm -f $RPM_BUILD_ROOT%{_libdir}/*.la |
1224 | 1206 | rm -f $RPM_BUILD_ROOT%{_libdir}/*.a |
@@ -1299,12 +1281,7 @@ mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \ |
1299 | 1281 | %endif |
1300 | 1282 |
|
1301 | 1283 | %check |
1302 | | -cd %{_vpath_builddir} |
1303 | | -if ! make %{?_smp_mflags} check VIR_TEST_DEBUG=1 |
1304 | | -then |
1305 | | - cat tests/test-suite.log || true |
1306 | | - exit 1 |
1307 | | -fi |
| 1284 | +VIR_TEST_DEBUG=1 %meson_test --no-suite syntax-check |
1308 | 1285 |
|
1309 | 1286 | %post libs |
1310 | 1287 | %if 0%{?rhel} == 7 |
@@ -1511,7 +1488,7 @@ exit 0 |
1511 | 1488 |
|
1512 | 1489 | %files docs |
1513 | 1490 | %doc AUTHORS ChangeLog NEWS.rst README README.rst |
1514 | | -%doc %{_vpath_builddir}/libvirt-docs/* |
| 1491 | +%doc libvirt-docs/* |
1515 | 1492 |
|
1516 | 1493 | %files daemon |
1517 | 1494 |
|
@@ -1884,7 +1861,7 @@ exit 0 |
1884 | 1861 | %config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests |
1885 | 1862 | %attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh |
1886 | 1863 |
|
1887 | | -%files libs -f %{_vpath_builddir}/%{name}.lang |
| 1864 | +%files libs -f %{name}.lang |
1888 | 1865 | %license COPYING COPYING.LESSER |
1889 | 1866 | %config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf |
1890 | 1867 | %config(noreplace) %{_sysconfdir}/libvirt/libvirt-admin.conf |
|
0 commit comments