diff --git a/0001-lvm-Add-missing-attribute-to-bd_lvm_pvdata_copy-in-L.patch b/0001-lvm-Add-missing-attribute-to-bd_lvm_pvdata_copy-in-L.patch deleted file mode 100644 index 05c376cf1735e07df3822215e33d6cda56834875..0000000000000000000000000000000000000000 --- a/0001-lvm-Add-missing-attribute-to-bd_lvm_pvdata_copy-in-L.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 93b0a8881790097e2b4c3116fe9af38f237fb8cc Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Tue, 2 Jun 2020 16:15:18 +0200 -Subject: [PATCH 167/193] lvm: Add missing attribute to bd_lvm_pvdata_copy in - LVM DBUs plugin - ---- - src/plugins/lvm-dbus.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c -index 222597b..454fc78 100644 ---- a/src/plugins/lvm-dbus.c -+++ b/src/plugins/lvm-dbus.c -@@ -100,6 +100,7 @@ BDLVMPVdata* bd_lvm_pvdata_copy (BDLVMPVdata *data) { - new_data->pv_name = g_strdup (data->pv_name); - new_data->pv_uuid = g_strdup (data->pv_uuid); - new_data->pv_free = data->pv_free; -+ new_data->pv_size = data->pv_size; - new_data->pe_start = data->pe_start; - new_data->vg_name = g_strdup (data->vg_name); - new_data->vg_uuid = g_strdup (data->vg_uuid); --- -1.8.3.1 - diff --git a/0002-module.c-Fix-error-message-when-loading-module-witho.patch b/0002-module.c-Fix-error-message-when-loading-module-witho.patch deleted file mode 100644 index 773bde9323f1656f67cb4de4f67cece0e79a4f6e..0000000000000000000000000000000000000000 --- a/0002-module.c-Fix-error-message-when-loading-module-witho.patch +++ /dev/null @@ -1,37 +0,0 @@ -From be58ebe20fd9fdfc2db7bdd99a55eff835cef23a Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Wed, 10 Jun 2020 14:31:15 +0200 -Subject: [PATCH 184/193] module.c: Fix error message when loading module - without options - -Lets avoid error messages like "Failed to load the module 'kvdo' -with options '(null)'". ---- - src/utils/module.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/src/utils/module.c b/src/utils/module.c -index 988f603..eb3f765 100644 ---- a/src/utils/module.c -+++ b/src/utils/module.c -@@ -167,9 +167,14 @@ gboolean bd_utils_load_kernel_module (const gchar *module_name, const gchar *opt - ret = kmod_module_probe_insert_module (mod, KMOD_PROBE_FAIL_ON_LOADED, - options, NULL, NULL, NULL); - if (ret < 0) { -- g_set_error (error, BD_UTILS_MODULE_ERROR, BD_UTILS_MODULE_ERROR_FAIL, -- "Failed to load the module '%s' with options '%s': %s", -- module_name, options, strerror_l (-ret, c_locale)); -+ if (options) -+ g_set_error (error, BD_UTILS_MODULE_ERROR, BD_UTILS_MODULE_ERROR_FAIL, -+ "Failed to load the module '%s' with options '%s': %s", -+ module_name, options, strerror_l (-ret, c_locale)); -+ else -+ g_set_error (error, BD_UTILS_MODULE_ERROR, BD_UTILS_MODULE_ERROR_FAIL, -+ "Failed to load the module '%s': %s", -+ module_name, strerror_l (-ret, c_locale)); - kmod_module_unref (mod); - kmod_unref (ctx); - freelocale (c_locale); --- -1.8.3.1 - diff --git a/0003-lvm-Fix-checking-for-LVM-VDO-dependencies.patch b/0003-lvm-Fix-checking-for-LVM-VDO-dependencies.patch deleted file mode 100644 index cfc55efa853cb9c2b91629476c02386b85e16b38..0000000000000000000000000000000000000000 --- a/0003-lvm-Fix-checking-for-LVM-VDO-dependencies.patch +++ /dev/null @@ -1,28 +0,0 @@ -From dff4f13d20e7371cd55df7aab7a1800c41e3d39b Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Mon, 29 Jun 2020 14:40:57 +0200 -Subject: [PATCH 188/193] lvm: Fix checking for LVM VDO dependencies - -We also need to check for the LVM tools availability when checking -for BD_LVM_TECH_VDO availability. ---- - src/plugins/lvm.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c -index 32ad55c..2bd7782 100644 ---- a/src/plugins/lvm.c -+++ b/src/plugins/lvm.c -@@ -329,7 +329,8 @@ gboolean bd_lvm_is_tech_avail (BDLVMTech tech, guint64 mode, GError **error) { - return TRUE; - case BD_LVM_TECH_VDO: - return check_features (&avail_features, FEATURES_VDO_MASK, features, FEATURES_LAST, &deps_check_lock, error) && -- check_module_deps (&avail_module_deps, MODULE_DEPS_VDO_MASK, module_deps, MODULE_DEPS_LAST, &deps_check_lock, error); -+ check_module_deps (&avail_module_deps, MODULE_DEPS_VDO_MASK, module_deps, MODULE_DEPS_LAST, &deps_check_lock, error) && -+ check_deps (&avail_deps, DEPS_LVM_MASK, deps, DEPS_LAST, &deps_check_lock, error); - default: - /* everything is supported by this implementation of the plugin */ - return check_deps (&avail_deps, DEPS_LVM_MASK, deps, DEPS_LAST, &deps_check_lock, error); --- -1.8.3.1 - diff --git a/0004-lvm-dbus-Fix-memory-leak-in-bd_lvm_cache_attach.patch b/0004-lvm-dbus-Fix-memory-leak-in-bd_lvm_cache_attach.patch deleted file mode 100644 index 7eda3b243e8d1f3c1066a40a387790f1a51d983f..0000000000000000000000000000000000000000 --- a/0004-lvm-dbus-Fix-memory-leak-in-bd_lvm_cache_attach.patch +++ /dev/null @@ -1,25 +0,0 @@ -From c9e76261bc52cf2360ee7f43dcdfedfa7149b30e Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Tue, 30 Jun 2020 16:05:47 +0200 -Subject: [PATCH 189/193] lvm-dbus: Fix memory leak in bd_lvm_cache_attach - ---- - src/plugins/lvm-dbus.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c -index fa19d1a..327969d 100644 ---- a/src/plugins/lvm-dbus.c -+++ b/src/plugins/lvm-dbus.c -@@ -3274,6 +3274,8 @@ gboolean bd_lvm_cache_attach (const gchar *vg_name, const gchar *data_lv, const - lv_id = g_strdup_printf ("%s/%s", vg_name, cache_pool_lv); - - call_lvm_obj_method_sync (lv_id, CACHE_POOL_INTF, "CacheLv", params, NULL, extra, TRUE, error); -+ g_free (lv_id); -+ g_free (lv_obj_path); - return ((*error) == NULL); - } - --- -1.8.3.1 - diff --git a/0005-lvm-Fix-memory-leak-bd_lvm_cache_create_cached_lv.patch b/0005-lvm-Fix-memory-leak-bd_lvm_cache_create_cached_lv.patch deleted file mode 100644 index fe1c9d12afc41a9dbbae9e6ad74e5012facef4e6..0000000000000000000000000000000000000000 --- a/0005-lvm-Fix-memory-leak-bd_lvm_cache_create_cached_lv.patch +++ /dev/null @@ -1,24 +0,0 @@ -From d9e8b2d43c84a664aa6a9b498047a865a1a38225 Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Tue, 30 Jun 2020 16:06:01 +0200 -Subject: [PATCH 190/193] lvm: Fix memory leak bd_lvm_cache_create_cached_lv - ---- - src/plugins/lvm.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c -index 0aae9ac..bec7656 100644 ---- a/src/plugins/lvm.c -+++ b/src/plugins/lvm.c -@@ -2475,6 +2475,7 @@ gboolean bd_lvm_cache_create_cached_lv (const gchar *vg_name, const gchar *lv_na - - success = bd_lvm_lvcreate (vg_name, lv_name, data_size, NULL, slow_pvs, NULL, error); - if (!success) { -+ g_free (name); - g_prefix_error (error, "Failed to create the data LV: "); - bd_utils_report_finished (progress_id, (*error)->message); - return FALSE; --- -1.8.3.1 - diff --git a/0006-fs-Fix-return-values-in-bd_fs_ntfs_get_info.patch b/0006-fs-Fix-return-values-in-bd_fs_ntfs_get_info.patch deleted file mode 100644 index 0f7f8ea739eec37d020ef9c858205a5bed658b1f..0000000000000000000000000000000000000000 --- a/0006-fs-Fix-return-values-in-bd_fs_ntfs_get_info.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 90b119f3026af68e2478450c7a71ed0fe68a9cbc Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Tue, 11 Aug 2020 18:00:57 +0200 -Subject: [PATCH 07/15] fs: Fix return values in bd_fs_ntfs_get_info - ---- - src/plugins/fs/ntfs.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/plugins/fs/ntfs.c b/src/plugins/fs/ntfs.c -index fdd959a..b406f41 100644 ---- a/src/plugins/fs/ntfs.c -+++ b/src/plugins/fs/ntfs.c -@@ -253,7 +253,7 @@ BDFSNtfsInfo* bd_fs_ntfs_get_info (const gchar *device, GError **error) { - g_autofree gchar* mountpoint = NULL; - - if (!check_deps (&avail_deps, DEPS_NTFSCLUSTER_MASK, deps, DEPS_LAST, &deps_check_lock, error)) -- return FALSE; -+ return NULL; - - mountpoint = bd_fs_get_mountpoint (device, error); - if (mountpoint != NULL) { -@@ -270,7 +270,7 @@ BDFSNtfsInfo* bd_fs_ntfs_get_info (const gchar *device, GError **error) { - success = bd_utils_exec_and_capture_output (args, NULL, &output, error); - if (!success) - /* error is already populated */ -- return FALSE; -+ return NULL; - - ret = g_new0 (BDFSNtfsInfo, 1); - lines = g_strsplit (output, "\n", 0); -@@ -283,7 +283,7 @@ BDFSNtfsInfo* bd_fs_ntfs_get_info (const gchar *device, GError **error) { - g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_PARSE, "Failed to parse NTFS file system information"); - g_strfreev (lines); - bd_fs_ntfs_info_free (ret); -- return FALSE; -+ return NULL; - } - - /* extract data from something like this: "bytes per volume : 998240256" */ -@@ -297,7 +297,7 @@ BDFSNtfsInfo* bd_fs_ntfs_get_info (const gchar *device, GError **error) { - g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_PARSE, "Failed to parse NTFS file system information"); - g_strfreev (lines); - bd_fs_ntfs_info_free (ret); -- return FALSE; -+ return NULL; - } - - /* extract data from something like this: "bytes of free space : 992759808" */ --- -1.8.3.1 - diff --git a/0007-fs-Fix-return-values-in-bd_fs_xfs_get_info.patch b/0007-fs-Fix-return-values-in-bd_fs_xfs_get_info.patch deleted file mode 100644 index 165f074093ec3f9b4b1ad0626c567347d11fbc93..0000000000000000000000000000000000000000 --- a/0007-fs-Fix-return-values-in-bd_fs_xfs_get_info.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 63f5df1992b15c1d6a442f2d392fa3b92ecf7b92 Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Tue, 11 Aug 2020 18:04:58 +0200 -Subject: [PATCH 08/15] fs: Fix return values in bd_fs_xfs_get_info - ---- - src/plugins/fs/xfs.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/plugins/fs/xfs.c b/src/plugins/fs/xfs.c -index b8b4bbe..d28ce72 100644 ---- a/src/plugins/fs/xfs.c -+++ b/src/plugins/fs/xfs.c -@@ -274,7 +274,7 @@ BDFSXfsInfo* bd_fs_xfs_get_info (const gchar *device, GError **error) { - if (!success) { - /* error is already populated */ - bd_fs_xfs_info_free (ret); -- return FALSE; -+ return NULL; - } - - lines = g_strsplit (output, "\n", 0); -@@ -288,7 +288,7 @@ BDFSXfsInfo* bd_fs_xfs_get_info (const gchar *device, GError **error) { - g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_PARSE, "Failed to parse xfs file system information"); - g_strfreev (lines); - bd_fs_xfs_info_free (ret); -- return FALSE; -+ return NULL; - } - - /* extract data from something like this: "data = bsize=4096 blocks=262400, imaxpct=25" */ -@@ -305,7 +305,7 @@ BDFSXfsInfo* bd_fs_xfs_get_info (const gchar *device, GError **error) { - g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_PARSE, "Failed to parse xfs file system information"); - g_strfreev (lines); - bd_fs_xfs_info_free (ret); -- return FALSE; -+ return NULL; - } - while (isdigit (*val_start) || isspace(*val_start)) - val_start++; -@@ -318,7 +318,7 @@ BDFSXfsInfo* bd_fs_xfs_get_info (const gchar *device, GError **error) { - g_set_error (error, BD_FS_ERROR, BD_FS_ERROR_PARSE, "Failed to parse xfs file system information"); - g_strfreev (lines); - bd_fs_xfs_info_free (ret); -- return FALSE; -+ return NULL; - } - g_strfreev (lines); - --- -1.8.3.1 - diff --git a/libblockdev-2.28.tar.gz b/libblockdev-2.28.tar.gz deleted file mode 100644 index fe1a980d63e85c2e38fa4b02211354f23fcadff3..0000000000000000000000000000000000000000 Binary files a/libblockdev-2.28.tar.gz and /dev/null differ diff --git a/libblockdev-3.0.4.tar.gz b/libblockdev-3.0.4.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8644904777529ba67a958143dc5f1c0640530e3c Binary files /dev/null and b/libblockdev-3.0.4.tar.gz differ diff --git a/libblockdev.spec b/libblockdev.spec index a413e215a4f3756b822449dfc2efec13eaf35881..9fe7ae2b6e6b3dcd5b73341bbe7049e142df583c 100644 --- a/libblockdev.spec +++ b/libblockdev.spec @@ -1,127 +1,538 @@ -# dmraid is deprecated -%define configure_opts --without-dmraid - -Name: libblockdev -Version: 2.28 -Release: 3 -Summary: libblockdev is a C library supporting GObject introspection for manipulation of block devices -License: LGPLv2+ -URL: https://github.com/storaged-project/libblockdev -Source0: https://github.com/storaged-project/libblockdev/releases/download/%{version}-1/%{name}-%{version}.tar.gz - -Patch1: 0001-lvm-Add-missing-attribute-to-bd_lvm_pvdata_copy-in-L.patch -Patch2: 0002-module.c-Fix-error-message-when-loading-module-witho.patch -Patch3: 0003-lvm-Fix-checking-for-LVM-VDO-dependencies.patch -Patch4: 0004-lvm-dbus-Fix-memory-leak-in-bd_lvm_cache_attach.patch -Patch5: 0005-lvm-Fix-memory-leak-bd_lvm_cache_create_cached_lv.patch -Patch6: 0006-fs-Fix-return-values-in-bd_fs_ntfs_get_info.patch -Patch7: 0007-fs-Fix-return-values-in-bd_fs_xfs_get_info.patch - -BuildRequires: make glib2-devel libyaml-devel libbytesize-devel parted-devel libuuid-devel ndctl-devel device-mapper-devel -BuildRequires: device-mapper-devel systemd-devel nss-devel volume_key-devel >= 0.3.9-7 libblkid-devel libmount-devel -BuildRequires: cryptsetup-devel kmod-devel libxslt glib2-doc gtk-doc python3-devel gobject-introspection-devel -BuildRequires: autoconf-archive -Requires: btrfs-progs device-mapper device-mapper-multipath lvm2 mdadm -Requires: device-mapper-persistent-data lvm2-dbusd >= 2.02.156 ndctl gdisk util-linux - -Provides: %{name}-utils%{?_isa} %{name}-utils -Obsoletes: %{name}-utils < %{version} -Provides: %{name}-btrfs%{?_isa} %{name}-btrfs -Obsoletes: %{name}-btrfs < %{version} -Provides: %{name}-crypto%{?_isa} %{name}-crypto -Obsoletes: %{name}-crypto < %{version} -Provides: %{name}-dm%{?_isa} %{name}-dm -Obsoletes: %{name}-dm < %{version} -Provides: %{name}-fs%{?_isa} %{name}-fs -Obsoletes: %{name}-fs < %{version} -Provides: %{name}-kbd%{?_isa} %{name}-kbd -Obsoletes: %{name}-kbd < %{version} -Provides: %{name}-vdo%{?_isa} %{name}-vdo -Obsoletes: %{name}-vdo < %{version} -Provides: %{name}-loop%{?_isa} %{name}-loop -Obsoletes: %{name}-loop < %{version} -Provides: %{name}-lvm%{?_isa} %{name}-lvm -Obsoletes: %{name}-lvm < %{version} -Provides: %{name}-lvm-dbus%{?_isa} %{name}-lvm-dbus -Obsoletes: %{name}-lvm-dbus < %{version} -Provides: %{name}-mdraid%{?_isa} %{name}-mdraid -Obsoletes: %{name}-mdraid < %{version} -Provides: %{name}-mpath%{?_isa} %{name}-mpath -Obsoletes: %{name}-mpath < %{version} -Provides: %{name}-nvdimm%{?_isa} %{name}-nvdimm -Obsoletes: %{name}-nvdimm < %{version} -Provides: %{name}-part%{?_isa} %{name}-part -Obsoletes: %{name}-part < %{version} -Provides: %{name}-swap%{?_isa} %{name}-swap -Obsoletes: %{name}-swap < %{version} -Provides: %{name}-plugins-all%{?_isa} %{name}-plugins-all -Obsoletes: %{name}-plugins-all < %{version} +%define with_python3 1 +%define with_gtk_doc 1 +%define with_btrfs 1 +%define with_crypto 1 +%define with_dm 1 +%define with_loop 1 +%define with_lvm 1 +%define with_lvm_dbus 1 +%define with_mdraid 1 +%define with_mpath 1 +%define with_swap 1 +%define with_part 1 +%define with_fs 1 +%define with_nvdimm 1 +%define with_gi 1 +%define with_escrow 1 +%define with_tools 1 +%define with_nvme 1 + +%if %{with_btrfs} != 1 +%define btrfs_copts --without-btrfs +%endif +%if %{with_crypto} != 1 +%define crypto_copts --without-crypto +%else +%if %{with_escrow} != 1 +%define crypto_copts --without-escrow +%endif +%endif +%if %{with_dm} != 1 +%define dm_copts --without-dm +%endif +%if %{with_loop} != 1 +%define loop_copts --without-loop +%endif +%if %{with_lvm} != 1 +%define lvm_copts --without-lvm +%endif +%if %{with_lvm_dbus} != 1 +%define lvm_dbus_copts --without-lvm_dbus +%endif +%if %{with_mdraid} != 1 +%define mdraid_copts --without-mdraid +%endif +%if %{with_mpath} != 1 +%define mpath_copts --without-mpath +%endif +%if %{with_swap} != 1 +%define swap_copts --without-swap +%endif +%if %{with_part} != 1 +%define part_copts --without-part +%endif +%if %{with_fs} != 1 +%define fs_copts --without-fs +%endif +%if %{with_nvdimm} != 1 +%define nvdimm_copts --without-nvdimm +%endif +%if %{with_tools} != 1 +%define tools_copts --without-tools +%endif +%if %{with_gi} != 1 +%define gi_copts --disable-introspection +%endif +%if %{with_nvme} != 1 +%define nvme_copts --without-nvme +%endif + +%define configure_opts %{?python3_copts} %{?lvm_dbus_copts} %{?btrfs_copts} %{?crypto_copts} %{?dm_copts} %{?loop_copts} %{?lvm_copts} %{?lvm_dbus_copts} %{?mdraid_copts} %{?mpath_copts} %{?swap_copts} %{?part_copts} %{?fs_copts} %{?nvdimm_copts} %{?tools_copts} %{?gi_copts} %{?nvme_copts} + +Name: libblockdev +Version: 3.0.4 +Release: 1 +Summary: libblockdev is a C library supporting GObject introspection for manipulation of block devices +License: LGPLv2+ +URL: https://github.com/storaged-project/libblockdev +Source0: %{url}/releases/download/%{version}-1/%{name}-%{version}.tar.gz + +BuildRequires: make +BuildRequires: glib2-devel +%if %{with_gi} +BuildRequires: gobject-introspection-devel +%endif +%if %{with_python3} +BuildRequires: python3-devel +%endif +%if %{with_gtk_doc} +BuildRequires: gtk-doc +%endif +BuildRequires: glib2-doc +BuildRequires: autoconf-archive + +# obsolete removed subpackages to allow upgrades +Provides: libblockdev-kbd = %{version}-%{release} +Obsoletes: libblockdev-kbd < %{version}-%{release} +Provides: libblockdev-vdo = %{version}-%{release} +Obsoletes: libblockdev-vdo < %{version}-%{release} + +Requires: %{name}-utils%{?_isa} = %{version}-%{release} %description -libblockdev is a C library supporting GObject introspection for manipulation of block devices. -It has a plugin-based architecture where each technology (like LVM, Btrfs, MD RAID, Swap,...) is implemented in a separate plugin, -possibly with multiple implementations (e.g. using LVM CLI or the new LVM DBus API). +The libblockdev is a C library with GObject introspection support that can be +used for doing low-level operations with block devices like setting up LVM, +BTRFS, LUKS or MD RAID. The library uses plugins (LVM, BTRFS,...) and serves as +a thin wrapper around its plugins' functionality. All the plugins, however, can +be used as standalone libraries. One of the core principles of libblockdev is +that it is stateless from the storage configuration's perspective (e.g. it has +no information about VGs when creating an LV). %package devel -Summary: Libraries and header files for libblockdev +Summary: Development files for libblockdev Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: glib2-devel device-mapper-devel xfsprogs dosfstools systemd-devel - -Provides: %{name}-btrfs-devel%{?_isa} %{name}-btrfs-devel -Obsoletes: %{name}-btrfs-devel < %{version} -Provides: %{name}-crypto-devel%{?_isa} %{name}-crypto-devel -Obsoletes: %{name}-crypto-devel < %{version} -Provides: %{name}-dm-devel%{?_isa} %{name}-dm-devel -Obsoletes: %{name}-dm-devel < %{version} -Provides: %{name}-fs-devel%{?_isa} %{name}-fs-devel -Obsoletes: %{name}-fs-devel < %{version} -Provides: %{name}-kbd-devel%{?_isa} %{name}-kbd-devel -Obsoletes: %{name}-kbd-devel < %{version} -Provides: %{name}-loop-devel%{?_isa} %{name}-loop-devel -Obsoletes: %{name}-loop-devel < %{version} -Provides: %{name}-lvm-devel%{?_isa} %{name}-lvm-devel -Obsoletes: %{name}-lvm-devel < %{version} -Provides: %{name}-lvm-dbus-devel%{?_isa} %{name}-lvm-dbus-devel -Obsoletes: %{name}-lvm-dbus-devel < %{version} -Provides: %{name}-mdraid-devel%{?_isa} %{name}-mdraid-devel -Obsoletes: %{name}-mdraid-devel < %{version} -Provides: %{name}-mpath-devel%{?_isa} %{name}-mpath-devel -Obsoletes: %{name}-mpath-devel < %{version} -Provides: %{name}-nvdimm-devel%{?_isa} %{name}-nvdimm-devel -Obsoletes: %{name}-nvdimm-devel < %{version} -Provides: %{name}-part-devel%{?_isa} %{name}-part-devel -Obsoletes: %{name}-part-devel < %{version} -Provides: %{name}-swap-devel%{?_isa} %{name}-swap-devel -Obsoletes: %{name}-swap-devel < %{version} -Provides: %{name}-vdo-devel%{?_isa} %{name}-vdo-devel -Obsoletes: %{name}-vdo-devel < %{version} -Provides: %{name}-utils-devel%{?_isa} %{name}-utils-devel -Obsoletes: %{name}-utils-devel < %{version} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +# obsolete removed devel subpackages to allow upgrades +Provides: libblockdev-kbd-devel = %{version}-%{release} +Obsoletes: libblockdev-kbd-devel < %{version}-%{release} +Provides: libblockdev-vdo-devel = %{version}-%{release} +Obsoletes: libblockdev-vdo-devel < %{version}-%{release} %description devel -Libraries and header files for a set for utils(libblockdev,libblockdev-btrfs,libblockdev-crypto, -libblockdev-dm,libblockdev-fs,libblockdev-kbd,libblockdev-loop,libblockdev-lvm, -libblockdev-lvm-dbus,libblockdev-mdraid,libblockdev-mpath,libblockdev-nvdimm,libblockdev-part, -libblockdev-swap,libblockdev-utils,libblockdev-vdo +This package contains header files and pkg-config files needed for development +with the libblockdev library. + +%if %{with_python3} +%package -n python3-blockdev +Summary: Python3 gobject-introspection bindings for libblockdev +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: python3-gobject-base +Requires: python3-bytesize +%{?python_provide:%python_provide python3-blockdev} + +%description -n python3-blockdev +This package contains enhancements to the gobject-introspection bindings for +libblockdev in Python3. +%endif + +%package utils +BuildRequires: kmod-devel +Summary: A library with utility functions for the libblockdev library + +%description utils +The libblockdev-utils is a library providing utility functions used by the +libblockdev library and its plugins. + +%package utils-devel +Summary: Development files for libblockdev-utils +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: glib2-devel +%description utils-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-utils library. + + +%if %{with_btrfs} +%package btrfs +BuildRequires: libbytesize-devel +Summary: The BTRFS plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: btrfs-progs + +%description btrfs +The libblockdev library plugin (and in the same time a standalone library) +providing the BTRFS-related functionality. + +%package btrfs-devel +Summary: Development files for the libblockdev-btrfs plugin/library +Requires: %{name}-btrfs%{?_isa} = %{version}-%{release} +Requires: glib2-devel +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} + +%description btrfs-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-btrfs plugin/library. +%endif + + +%if %{with_crypto} +%package crypto +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +BuildRequires: cryptsetup-devel >= 2.3.0 +BuildRequires: libblkid-devel +BuildRequires: keyutils-libs-devel + +%if %{with_escrow} +BuildRequires: volume_key-devel >= 0.3.9-7 +BuildRequires: nss-devel +%endif + +Summary: The crypto plugin for the libblockdev library + +%description crypto +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to encrypted devices (LUKS). + +%package crypto-devel +Summary: Development files for the libblockdev-crypto plugin/library +Requires: %{name}-crypto%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description crypto-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-crypto plugin/library. +%endif + + +%if %{with_dm} +%package dm +BuildRequires: device-mapper-devel +BuildRequires: systemd-devel +Summary: The Device Mapper plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: device-mapper + +%description dm +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to Device Mapper. + +%package dm-devel +Summary: Development files for the libblockdev-dm plugin/library +Requires: %{name}-dm%{?_isa} = %{version}-%{release} +Requires: glib2-devel +Requires: device-mapper-devel +Requires: systemd-devel +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} + +%description dm-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-dm plugin/library. +%endif + + +%if %{with_fs} +%package fs +BuildRequires: libblkid-devel +BuildRequires: libmount-devel +BuildRequires: libuuid-devel +BuildRequires: e2fsprogs-devel +Summary: The FS plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} + +%description fs +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to operations with file systems. + +%package fs-devel +Summary: Development files for the libblockdev-fs plugin/library +Requires: %{name}-fs%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description fs-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-fs plugin/library. +%endif + + +%if %{with_loop} +%package loop +Summary: The loop plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} + +%description loop +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to loop devices. + +%package loop-devel +Summary: Development files for the libblockdev-loop plugin/library +Requires: %{name}-loop%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description loop-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-loop plugin/library. +%endif + + +%if %{with_lvm} +%package lvm +BuildRequires: device-mapper-devel +Summary: The LVM plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: lvm2 + +%description lvm +The libblockdev library plugin (and in the same time a standalone library) +providing the LVM-related functionality. + +%package lvm-devel +Summary: Development files for the libblockdev-lvm plugin/library +Requires: %{name}-lvm%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description lvm-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-lvm plugin/library. +%endif + +%if %{with_lvm_dbus} +%package lvm-dbus +BuildRequires: device-mapper-devel +Summary: The LVM plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: lvm2-dbusd >= 2.02.156 + +%description lvm-dbus +The libblockdev library plugin (and in the same time a standalone library) +providing the LVM-related functionality utilizing the LVM DBus API. + +%package lvm-dbus-devel +Summary: Development files for the libblockdev-lvm-dbus plugin/library +Requires: %{name}-lvm-dbus%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description lvm-dbus-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-lvm-dbus plugin/library. +%endif + + +%if %{with_mdraid} +%package mdraid +BuildRequires: libbytesize-devel +Summary: The MD RAID plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: mdadm + +%description mdraid +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to MD RAID. + +%package mdraid-devel +Summary: Development files for the libblockdev-mdraid plugin/library +Requires: %{name}-mdraid%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description mdraid-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-mdraid plugin/library. +%endif + + +%if %{with_mpath} +%package mpath +BuildRequires: device-mapper-devel +Summary: The multipath plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Recommends: device-mapper-multipath + +%description mpath +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to multipath devices. + +%package mpath-devel +Summary: Development files for the libblockdev-mpath plugin/library +Requires: %{name}-mpath%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description mpath-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-mpath plugin/library. +%endif + +%if %{with_nvdimm} +%package nvdimm +BuildRequires: ndctl-devel +BuildRequires: libuuid-devel +Summary: The NVDIMM plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: ndctl + +%description nvdimm +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to operations with NVDIMM devices. + +%package nvdimm-devel +Summary: Development files for the libblockdev-nvdimm plugin/library +Requires: %{name}-nvdimm%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description nvdimm-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-nvdimm plugin/library. +%endif + + +%if %{with_nvme} +%package nvme +BuildRequires: libnvme-devel +BuildRequires: libuuid-devel +Summary: The NVMe plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} + +%description nvme +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to operations with NVMe devices. + +%package nvme-devel +Summary: Development files for the libblockdev-nvme plugin/library +Requires: %{name}-nvme%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description nvme-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-nvme plugin/library. +%endif + + +%if %{with_part} +%package part +BuildRequires: libfdisk-devel +Summary: The partitioning plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: util-linux + +%description part +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to partitioning. + +%package part-devel +Summary: Development files for the libblockdev-part plugin/library +Requires: %{name}-part%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description part-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-part plugin/library. +%endif + + +%if %{with_swap} +%package swap +BuildRequires: libblkid-devel +Summary: The swap plugin for the libblockdev library +Requires: %{name}-utils%{?_isa} = %{version}-%{release} +Requires: util-linux + +%description swap +The libblockdev library plugin (and in the same time a standalone library) +providing the functionality related to swap devices. + +%package swap-devel +Summary: Development files for the libblockdev-swap plugin/library +Requires: %{name}-swap%{?_isa} = %{version}-%{release} +Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release} +Requires: glib2-devel + +%description swap-devel +This package contains header files and pkg-config files needed for development +with the libblockdev-swap plugin/library. +%endif + +%if %{with_tools} %package tools Summary: Various nice tools based on libblockdev -Requires: %{name} -Requires: %{name}-lvm +Requires: %{name} = %{version}-%{release} +Requires: %{name}-lvm = %{version}-%{release} BuildRequires: libbytesize-devel +BuildRequires: parted-devel +%if %{with_lvm_dbus} == 1 Recommends: %{name}-lvm-dbus +%endif %description tools Various nice storage-related tools based on libblockdev. -%package -n python3-blockdev -Summary: Python3 bindings for libblockdev +%endif + +%package plugins-all +Summary: Meta-package that pulls all the libblockdev plugins as dependencies Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: python3-gobject-base -%{?python_provide:%python_provide python3-blockdev} -%description -n python3-blockdev -Python3 bindings for libblockdev +%if %{with_btrfs} +Requires: %{name}-btrfs%{?_isa} = %{version}-%{release} +%endif + +%if %{with_crypto} +Requires: %{name}-crypto%{?_isa} = %{version}-%{release} +%endif + +%if %{with_dm} +Requires: %{name}-dm%{?_isa} = %{version}-%{release} +%endif + +%if %{with_fs} +Requires: %{name}-fs%{?_isa} = %{version}-%{release} +%endif + +%if %{with_loop} +Requires: %{name}-loop%{?_isa} = %{version}-%{release} +%endif + +%if %{with_lvm} +Requires: %{name}-lvm%{?_isa} = %{version}-%{release} +%endif + +%if %{with_mdraid} +Requires: %{name}-mdraid%{?_isa} = %{version}-%{release} +%endif + +%if %{with_mpath} +Requires: %{name}-mpath%{?_isa} = %{version}-%{release} +%endif + +%if %{with_nvdimm} +Requires: %{name}-nvdimm%{?_isa} = %{version}-%{release} +%endif + +%if %{with_nvme} +Requires: %{name}-nvme%{?_isa} = %{version}-%{release} +%endif + +%if %{with_part} +Requires: %{name}-part%{?_isa} = %{version}-%{release} +%endif + +%if %{with_swap} +Requires: %{name}-swap%{?_isa} = %{version}-%{release} +%endif + +%description plugins-all +A meta-package that pulls all the libblockdev plugins as dependencies. + %prep %autosetup -n %{name}-%{version} -p1 @@ -129,42 +540,276 @@ Python3 bindings for libblockdev %build autoreconf -ivf %configure %{?configure_opts} -%make_build +%{__make} %{?_smp_mflags} %install -%make_install +%{make_install} find %{buildroot} -type f -name "*.la" | xargs %{__rm} + %ldconfig_scriptlets +%ldconfig_scriptlets utils + +%if %{with_btrfs} +%ldconfig_scriptlets btrfs +%endif + +%if %{with_crypto} +%ldconfig_scriptlets crypto +%endif + +%if %{with_dm} +%ldconfig_scriptlets dm +%endif + +%if %{with_fs} +%ldconfig_scriptlets fs +%endif + +%if %{with_loop} +%ldconfig_scriptlets loop +%endif + +%if %{with_lvm} +%ldconfig_scriptlets lvm +%endif + +%if %{with_lvm_dbus} +%ldconfig_scriptlets lvm-dbus +%endif + +%if %{with_mdraid} +%ldconfig_scriptlets mdraid +%endif + +%if %{with_mpath} +%ldconfig_scriptlets mpath +%endif + +%if %{with_nvdimm} +%ldconfig_scriptlets nvdimm +%endif + +%if %{with_nvme} +%ldconfig_scriptlets nvme +%endif + +%if %{with_part} +%ldconfig_scriptlets part +%endif + +%if %{with_swap} +%ldconfig_scriptlets swap +%endif + %files +%{!?_licensedir:%global license %%doc} %license LICENSE %{_libdir}/libblockdev.so.* +%if %{with_gi} %{_libdir}/girepository*/BlockDev*.typelib -%{_libdir}/libbd_*.so.* +%endif %dir %{_sysconfdir}/libblockdev -%dir %{_sysconfdir}/libblockdev/conf.d -%config %{_sysconfdir}/libblockdev/conf.d/00-default.cfg -%config %{_sysconfdir}/libblockdev/conf.d/10-lvm-dbus.cfg +%dir %{_sysconfdir}/libblockdev/3/conf.d +%config %{_sysconfdir}/libblockdev/3/conf.d/00-default.cfg %files devel -%doc features.rst specs.rst -%{_libdir}/libbd_*.so %{_libdir}/libblockdev.so -%{_libdir}/pkgconfig/*.pc +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/blockdev.h +%{_includedir}/blockdev/plugins.h +%{_libdir}/pkgconfig/blockdev.pc +%if %{with_gtk_doc} %{_datadir}/gtk-doc/html/libblockdev +%endif +%if %{with_gi} %{_datadir}/gir*/BlockDev*.gir +%endif + +%if %{with_python3} +%files -n python3-blockdev +%{python3_sitearch}/gi/overrides/BlockDev* +%{python3_sitearch}/gi/overrides/__pycache__/BlockDev* +%endif + +%files utils +%{_libdir}/libbd_utils.so.* + +%files utils-devel +%{_libdir}/libbd_utils.so +%{_libdir}/pkgconfig/blockdev-utils.pc %dir %{_includedir}/blockdev -%{_includedir}/blockdev/* +%{_includedir}/blockdev/utils.h +%{_includedir}/blockdev/sizes.h +%{_includedir}/blockdev/exec.h +%{_includedir}/blockdev/extra_arg.h +%{_includedir}/blockdev/dev_utils.h +%{_includedir}/blockdev/module.h +%{_includedir}/blockdev/dbus.h +%{_includedir}/blockdev/logging.h + + +%if %{with_btrfs} +%files btrfs +%{_libdir}/libbd_btrfs.so.* + +%files btrfs-devel +%{_libdir}/libbd_btrfs.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/btrfs.h +%endif + + +%if %{with_crypto} +%files crypto +%{_libdir}/libbd_crypto.so.* + +%files crypto-devel +%{_libdir}/libbd_crypto.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/crypto.h +%endif + + +%if %{with_dm} +%files dm +%{_libdir}/libbd_dm.so.* + +%files dm-devel +%{_libdir}/libbd_dm.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/dm.h +%endif + + +%if %{with_fs} +%files fs +%{_libdir}/libbd_fs.so.* + +%files fs-devel +%{_libdir}/libbd_fs.so +%dir %{_includedir}/blockdev +%dir %{_includedir}/blockdev/fs +%{_includedir}/blockdev/fs.h +%{_includedir}/blockdev/fs/*.h +%endif + + +%if %{with_loop} +%files loop +%{_libdir}/libbd_loop.so.* + +%files loop-devel +%{_libdir}/libbd_loop.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/loop.h +%endif + + +%if %{with_lvm} +%files lvm +%{_libdir}/libbd_lvm.so.* + +%files lvm-devel +%{_libdir}/libbd_lvm.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/lvm.h +%endif + + +%if %{with_lvm_dbus} +%files lvm-dbus +%{_libdir}/libbd_lvm-dbus.so.* +%config %{_sysconfdir}/libblockdev/3/conf.d/10-lvm-dbus.cfg + +%files lvm-dbus-devel +%{_libdir}/libbd_lvm-dbus.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/lvm.h +%endif + + +%if %{with_mdraid} +%files mdraid +%{_libdir}/libbd_mdraid.so.* +%files mdraid-devel +%{_libdir}/libbd_mdraid.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/mdraid.h +%endif + + +%if %{with_mpath} +%files mpath +%{_libdir}/libbd_mpath.so.* + +%files mpath-devel +%{_libdir}/libbd_mpath.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/mpath.h +%endif + + +%if %{with_nvdimm} +%files nvdimm +%{_libdir}/libbd_nvdimm.so.* + +%files nvdimm-devel +%{_libdir}/libbd_nvdimm.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/nvdimm.h +%endif + + +%if %{with_nvme} +%files nvme +%{_libdir}/libbd_nvme.so.* + +%files nvme-devel +%{_libdir}/libbd_nvme.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/nvme.h +%endif + + +%if %{with_part} +%files part +%{_libdir}/libbd_part.so.* + +%files part-devel +%{_libdir}/libbd_part.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/part.h +%endif + + +%if %{with_swap} +%files swap +%{_libdir}/libbd_swap.so.* + +%files swap-devel +%{_libdir}/libbd_swap.so +%dir %{_includedir}/blockdev +%{_includedir}/blockdev/swap.h +%endif + + +%if %{with_tools} %files tools %{_bindir}/lvm-cache-stats +%{_bindir}/vfat-resize +%endif -%files -n python3-blockdev -%{python3_sitearch}/gi/overrides/* + +%files plugins-all %changelog +* Mon Feb 19 2024 liweigang - 3.0.4-1 +- update to version 3.0.4 + * Tue Jan 2 2024 liyanan - 2.28-3 - remove require vdo