From b19b2c8c4e312bf94ed44b5b54fecf4575ac4fde1b1c095b9dba98874104e1bf Mon Sep 17 00:00:00 2001 From: Luciano Santos Date: Thu, 24 Aug 2023 01:29:17 +0000 Subject: [PATCH] Version update: 3.0.1 -> 3.0.2 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libblockdev?expand=0&rev=48 --- NEWS.rst | 1162 ++++++++++++++++++++++++++++++++++++++ libblockdev-3.0.1.tar.gz | 3 - libblockdev-3.0.2.tar.gz | 3 + libblockdev.changes | 23 +- libblockdev.spec | 1161 ++++++++++++++++++++----------------- 5 files changed, 1818 insertions(+), 534 deletions(-) create mode 100644 NEWS.rst delete mode 100644 libblockdev-3.0.1.tar.gz create mode 100644 libblockdev-3.0.2.tar.gz diff --git a/NEWS.rst b/NEWS.rst new file mode 100644 index 0000000..7e0688c --- /dev/null +++ b/NEWS.rst @@ -0,0 +1,1162 @@ +Libblockdev 3.0.2 +------------------ + +New bugfix release of the libblockdev library with multiple fixes. See below +for details. + +**Full list of changes** + +Alexis Murzeau (1): + +- Use ntfsinfo instead of ntfscluster for faster bd_fs_ntfs_get_info + +Marek Szuba (1): + +- docs: Fix test quotation + +Michael Biebl (1): + +- Restrict list of exported symbols via -export-symbols-regex + +Tomas Bzatek (2): + +- lib: Silence the missing DEFAULT_CONF_DIR_PATH +- loop: Report BD_LOOP_ERROR_DEVICE on empty loop devices + +Vojtech Trefny (5): + +- Fix formatting in NEWS.rst +- fs: Fix unused error in extract_e2fsck_progress +- fs: Use read-only mount where possible for generic FS functions +- fs: Document that generic functions can mount filesystems +- fs: Avoid excess logging in extract_e2fsck_progress + +Libblockdev 3.0.1 +------------------ + +New bugfix release of the libblockdev library with multiple fixes. See below +for details. + +**Full list of changes** + +Giulio Benetti (1): + +- loop: define LOOP_SET_BLOCK_SIZE is not defined + +Tomas Bzatek (6): + +- nvme: Mark private symbols as hidden +- build: Exit before AC_OUTPUT on error +- loop: Remove unused variable +- crypto: Remove stray struct redefinition +- boilerplate_generator: Annotate stub func args as G_GNUC_UNUSED +- fs: Simplify struct BDFSInfo + +Vojtech Trefny (11): + +- vdo_stats: Remove unused libparted include +- lvm: Make _vglock_start_stop static +- lvm: Fix declaration for bd_lvm_vdolvpoolname +- loop: Remove bd_loop_get_autoclear definition +- lvm: Add bd_lvm_segdata_copy/free to the header file +- fs: Add missing copy and free functions to the header file +- misc: Update steps and Dockerfile for Python documentation +- dist: Sync spec with downstream +- spec: Add dependency on libblockdev-utils to the s390 plugin +- configure: Fix MAJOR_VER macro +- Make the conf.d directory versioned + +Libblockdev 3.0 +--------------- + +New major release of the libblockdev library. This release contains a large +API overhaul, please check the documentation for full list of API changes. + +**Notable changes** + +- VDO a KBD plugins were removed. +- New NVMe plugin was added. +- Runtime dependencies are no longer checked during plugin initialization. +- Part plugin was rewritten to use libfdisk instead of libparted. +- Crypto plugin API went through an extensive rewrite. +- Support for new technologies was added to the crypto plugin: FileVault2 encryption, + DM Integrity, LUKS2 tokens. +- Filesystem plugin adds support for btrfs, F2FS, NILFS2, exFAT and UDF. +- Support for new filesystem operations was added to the plugin: setting label and UUID, + generic mkfs function and API for getting feature support for filesystems. +- dmraid support was removed from the DM plugin. +- Python 2 support was dropped. + +Libblockdev 2.28 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Full list of changes** + +Michael Biebl (1): + +- Fix typos + +Vojtech Trefny (17): + +- lvm: Fix bd_lvm_get_supported_pe_sizes in Python on 32bit +- tests: Create bigger devices for XFS tests +- tests: Use ext instead of xfs in MountTestCase.test_mount_ro_device +- mpath: Memory leak fix +- spec: Require the same version utils from plugins +- mdraid: Try harder to get container UUID in bd_md_detail +- Add a test case for DDF arrays/containers +- mdraid: Do not ignore errors from bd_md_canonicalize_uuid in bd_md_examine +- mdraid: Try harder to get container UUID in bd_md_examine +- mdraid: Fix copy-paste error when checking return value +- tests: Wait for raid and mirrored LVs to be synced before removing +- tests: Make smaller images for test_lvcreate_type +- dm: Fix comparing DM RAID member devices UUID +- mdraid: Fix use after free +- ci: Add .lgtm.yaml config for LGTM +- ci: Add GitHub actions for running rpmbuilds and csmock +- mpath: Fix potential NULL pointer dereference + +zhanghongtao (1): + +- Fix mismatched functions return value type + + +Libblockdev 2.27 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Full list of changes** + +Tomas Bzatek (1): + +- fs: Return BD_FS_ERROR_UNKNOWN_FS on mounting unknown filesystem + +Vojtech Trefny (21): + +- overrides: Fix translating exceptions in ErrorProxy +- tests: Do not check that swap flag is not supported on DOS table +- tests: Lower expected free space on newly created Ext filesystems +- tests: Remove test for NTFS read-only mounting +- vdo_stats: Default to 100 % savings for invalid savings values +- lvm: Fix reading statistics for VDO pools with VDO 8 +- tests: Fix creating loop device for CryptoTestLuksSectorSize +- tests: Use losetup to create 4k sector size loop device for testing +- s390: Remove double fclose in bd_s390_dasd_online (#2045784) +- lvm-dbus: Add support for changing compression and deduplication +- tests: Skip test_lvcreate_type on CentOS/RHEL 9 +- tests: Fix expected extended partition flags with new parted +- lvm: Do not set global config to and empty string +- lvm: Do not include duplicate entries in bd_lvm_lvs output +- lvm: Use correct integer type in for comparison +- crypto: Remove useless comparison in progress report in luks_format +- boilerplate_generator: Remove unused variable assignment +- kbd: Add missing progress reporting to bd_kbd_bcache_create +- kbd: Fix leaking error in bd_kbd_bcache_detach +- kbd: Fix potential NULL pointer dereference in bd_kbd_bcache_create +- crypto: Remove unused and leaking error in write_escrow_data_file + +Libblockdev 2.26 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Full list of changes** + +Manuel Wassermann (1): + +- exec: Fix deprecated glib function call Glib will rename + "g_spawn_check_exit_status()" to "g_spawn_check_wait_status()" in version + 2.69. + +Tomasz Paweł Gajc (1): + +- remove unused variable and fix build with LLVM/clang + +Vojtech Trefny (22): + +- NEWS.rts: Fix markup +- crypto: Fix default key size for non XTS ciphers +- vdo: Do not use g_memdup in bd_vdo_stats_copy +- fs: Allow using empty label for vfat with newest dosfstools +- tests: Call fs_vfat_mkfs with "--mbr=n" extra option in tests +- kbd: Fix memory leak +- crypto: Fix memory leak +- dm: Fix memory leak in the DM plugin and DM logging redirect function +- fs: Fix memory leak +- kbd: Fix memory leak +- lvm-dbus: Fix memory leak +- mdraid: Fix memory leak +- swap: Fix memory leak +- tests: Make sure the test temp mount is always unmounted +- tests: Do not check that XFS shrink fails with xfsprogs >= 5.12 +- tests: Temporarily skip test_snapshotcreate_lvorigin_snapshotmerge +- Fix skipping tests on Debian testing +- crypto: Let cryptsetup autodect encryption sector size when not specified +- tests: Do not try to remove VG before removing the VDO pool +- tests: Force remove LVM VG /dev/ entry not removed by vgremove +- tests: Tag LvmPVVGLVcachePoolCreateRemoveTestCase as unstable +- Add missing plugins to the default config + + +Libblockdev 2.25 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Full list of changes** + +Tomas Bzatek (6): + +- exec: Fix polling for stdout and stderr +- exec: Use non-blocking read and process the buffer manually +- exec: Clarify the BDUtilsProgExtract callback documentation +- tests: Add bufferbloat exec tests +- tests: Add null-byte exec tests +- lvm: Fix bd_lvm_vdopooldata_* symbols + +Vojtech Trefny (10): + +- exec: Fix setting locale for util calls +- fs: Do not report error when errors were fixed by e2fsck +- README: Use CI status image for 2.x-branch on 2.x +- fs: Fix compile error in ext_repair caused by cherry pick from master +- Mark all GIR file constants as guint64 +- lvm: Set thin metadata limits to match limits LVM uses in lvcreate +- lvm: Do not use thin_metadata_size to recommend thin metadata size +- lvm: Use the UNUSED macro instead of __attribute__((unused)) +- Fix max size limit for LVM thinpool metadata +- loop: Retry LOOP_SET_STATUS64 on EAGAIN + + +Libblockdev 2.24 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Notable changes** + +- vdo + + - VDO plugin has been deprecated in this release (functionality replaced by LVM VDO) + +- lvm + + - support for creating and managing LVM VDO volumes added + +- crypto + + - support for unlocking of BitLocker-compatible format BITLK added (requires cryptsetup 2.3.0) + +**Full list of changes** + +Lars Wendler (1): + +- configure.ac: Avoid bashisms + +Matt Thompson (1): + +- Fixed a number of memory leaks in lvm-dbus plugin + +Matt Whitlock (1): + +- configure.ac: Avoid more bashisms + +Tomas Bzatek (4): + +- utils: Add functions to get and check current linux kernel version +- vdo: Fix a memleak +- exec: Fix a memleak +- mount: Fix a memleak + +Vojtech Trefny (47): + +- Sync spec with downstream +- Use 'explicit_bzero' to erase passphrases from key files +- Add new function 'bd_fs_wipe_force' to control force wipe +- Fix linking against utils on Debian +- exec.c: Fix reading outputs with null bytes +- fs: Fix checking for UID/GID == 0 +- Fix expected cache pool name with newest LVM +- Fix memory leak in LVM DBus plugin +- Manually remove symlinks not removed by udev in tests +- Add a helper function for closing an active crypto device +- Add support for BitLocker encrypted devices using cryptsetup +- ext: Return empty string instead of "" for empty UUID +- Fix typo in (un)mount error messages +- vdo: Run "vdo create" with "--force" +- lvm-dbus: Do not activate LVs during pvscan --cache +- lvm-dbus: Fix memory leak in bd_lvm_thlvpoolname +- tests: Specify loader for yaml.load in VDO tests +- Add a function to check if a tool supports given feature +- Do not hardcode pylint executable name in Makefile +- Fix LVM plugin so names in tests +- Add support for creating and managing VDO LVs with LVM +- Add some helper functions to get LVM VDO mode and state strings +- Fix converting to VDO pool without name for the VDO LV +- Add write policy and index size to LVM VDO data +- Fix getting string representation of unknown VDO state index +- Fix getting VDO data in the LVM DBus plugin +- Allow calling LVM functions without locking global_config_lock +- Add extra parameters for creating LVM VDO volumes +- Add function to get LVM VDO write policy from a string +- exec: Disable encoding when reading data from stdout/stderr +- Fix copy-paste bug in lvm.api +- Move VDO statistics code to a separate file +- Add functions to get VDO stats for LVM VDO volumes +- lvm-dbus: Get data LV name for LVM VDO pools too +- lvm: Add a function to get VDO pool name for a VDO LV +- lvm-dbus: Add LVM VDO pools to bd_lvm_lvs +- tests: Skip LVM VDO tests if kvdo module cannot be loaded +- Do not skip LVM VDO tests when the kvdo module is already loaded +- lvm: Fix getting cache stats for cache thinpools +- Create a common function to get label and uuid of a filesystem +- Do not open devices as read-write for read-only fs operations +- Use libblkid to get label and UUID for XFS filesystems +- Do not check VDO saving percent value in LVM DBus tests +- utils: Remove deadcode in exec.c +- fs: Fix potential NULL pointer dereference in mount.c +- Fix multiple uninitialized values discovered by coverity +- Mark VDO plugin as deprecated since 2.24 + +Libblockdev 2.23 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Notable changes** + +- fs + + - new functions for (un)freezing filesystems added + +- tests + + - test suite can now be run against installed version of libblockdev + + +**Full list of changes** + +Vojtech Trefny (28): + +- Skip bcache tests on all Debian versions +- Add a function to check whether a path is a mounpoint or not +- Add function for (un)freezing filesystems +- Add a decorator for "tagging" tests +- Use test tags for skipping tests +- Use the new test tags in tests +- Remove duplicate test case +- Allow running tests against installed libblockdev +- Add a special test tag for library tests that recompile plugins +- Force LVM cli plugin in lvm_test +- Mark 'test_set_bitmap_location' as unstable +- Add ability to read tests to skip from a config file +- Skip bcache tests if make-bcache is not installed +- Use the new config file for skipping tests +- Ignore coverity deadcode warnings in the generated code +- Ignore coverity deadcode warning in 'bd_fs_is_tech_avail' +- Mark 'private' plugin management functions as static +- Remove unused 'get_PLUGIN_num_functions' and 'get_PLUGIN_functions' functions +- Mark LVM global config locks as static +- Hide filesystem-specific is_tech_available functions +- Use 'kmod_module_probe_insert_module' function for loading modules +- Fix parsing distro version from CPE name +- Move the NTFS read-only device test to a separate test case +- Print skipped test "results" to stderr instead of stdout +- Fix LVM_MAX_LV_SIZE in the GIR file +- Fix skipping NTFS read-only test case on systems without NTFS +- Skip tests for old-style LVM snapshots on recent Fedora +- Fix how we get process exit code from g_spawn_sync + +Libblockdev 2.22 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Notable changes** + +- nvdimm + + - new function for getting list of supported sector sizes for namespaces + +- fixes + + - multiple memory leaks fixed + + +**Full list of changes** + +Adam Williamson (1): + +- Sync spec file with python2 obsoletion added downstream + +Tomas Bzatek (17): + +- bd_fs_xfs_get_info: Allow passing error == NULL +- lvm: Fix some obvious memory leaks +- lvm: Use g_ptr_array_free() for creating lists +- lvm: Fix leaking BDLVMPVdata.vg_uuid +- exec: Fix some memory leaks +- mdraid: Fix g_strsplit() leaks +- s390: Fix g_strsplit() leaks +- ext: Fix g_strsplit() leaks +- ext: Fix g_match_info_fetch() leaks +- kbd: Fix g_match_info_fetch() leaks +- part: Fix leaking objects +- ext: Fix leaking string +- part: Fix leaking string in args +- mdraid: Fix leaking error +- mdraid: Fix leaking BDMDExamineData.metadata +- btrfs: Fix number of memory leaks +- module: Fix libkmod related leak + +Vojtech Trefny (7): + +- Sync spec with downstream +- Allow skiping tests only based on architecture +- New function to get supported sector sizes for NVDIMM namespaces +- Use existing cryptsetup API for changing keyslot passphrase +- tests: Fix removing targetcli lun +- Remove device-mapper-multipath dependency from fs and part plugins +- tests: Fix Debian testing "version" for skipping + + +Libblockdev 2.21 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Notable changes** + +- crypto + + - default key size for LUKS was changed to 512bit + +- tools + + - new simple cli tools that use libblockdev + - first tool is ``lvm-cache-stats`` for displaying stats for LVM cache devices + - use configure option ``--without-tools`` to disable building these + + +**Full list of changes** + +Vojtech Trefny (19): + +- Use libblkid to check swap status before swapon +- Add error codes and Python exceptions for swapon fails +- Add libblkid-devel as a build dependency for the swap plugin +- Skip VDO grow physical test +- crypto_test.py: Use blkid instead of lsblk to check luks label +- Use major/minor macros from sys/sysmacros.h instead of linux/kdev_t.h +- Add custom error message for wrong passphrase for open +- Skip LUKS2+integrity test on systems without dm-integrity module +- Use cryptsetup to check LUKS2 label +- Fix LUKS2 resize password test +- crypto: Do not try to use keyring on systems without keyring support +- lvm-dbus: Do not pass extra arguments enclosed in a tuple +- Enable cryptsetup debug messages when compiled using --enable-debug +- vagrant: install 'autoconf-archive' on Ubuntu +- vagrant: remove F27 and add F29 +- Add 'autoconf-archive' to build requires +- tests: Remove some old/irrelevant skips +- tests: Stop skipping some tests on Debian testing +- Fix checking swap status on lvm/md + +Vratislav Podzimek (6): + +- Discard messages from libdevmapper in the LVM plugins +- Add a tool for getting cached LVM statistics +- Make building tools optional +- Document what the 'tools' directory contains +- Add a new subpackage with the tool(s) +- Use 512bit keys in LUKS by default + +Libblockdev 2.20 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Notable changes** + +- fixes + + - Fix parsing extra arguments for LVM methods calls in the LVM DBus plugin. + - Multiple fixes for running tests on Debian testing. + +- development + + - Vagrantfile template was added for easy development machine setup. + +**Full list of changes** + +Dennis Schridde (1): + +- Fix build of plugins by changing linking order + +Vojtech Trefny (17): + +- Fix spacing in NEWS.rst +- Fix licence header in dbus.c +- Do not require 'dmraid' package if built without dmraid support +- Always build the VDO plugin +- kbd: Check for zram module availability in 'bd_kbd_is_tech_avail' +- Fix skipping zram tests on Fedora 27 +- Build the dm plugin without dmraid support on newer RHEL +- tests: Try harder to get distribution version +- Skip bcache tests on Debian testing +- Skip NTFS mount test on Debian testing +- Skip MDTestAddRemove on Debian +- lvm-dbus: Fix parsing extra arguments for LVM methods calls +- Fix how we check zram stats from /sys/block/zram0/stat +- Add some missing test dependencies to the vagrant template +- Add Ubuntu 18.04 VM configuration to the vagrant template +- Skip nvdimm tests on systems without ndctl +- Require newer version of cryptsetup for LUKS2 tests + +Vratislav Podzimek (6): + +- Mark the function stubs as static +- Fix the error message when deleting partition fails +- Add a Vagrantfile template +- Document what the 'misc' directory contains +- Fix how/where the bcache tests are skipped +- Use unsafe caching for storage for devel/testing VMs + + +Libblockdev 2.19 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Notable changes** + +- features + + - vdo: new functions to get statistical data for existing VDO volumes (`bd_vdo_get_stats`) + - crypto: support for passing extra arguments for key derivation function when creating LUKS2 format + +**Full list of changes** + +Max Kellermann (8): + +- fix -Wstrict-prototypes +- exec: make `msg` parameters const +- plugins/check_deps: make all strings and `UtilDep` instances `const` +- plugins/crypto: work around -Wdiscarded-qualifiers +- plugins/dm: add explicit cast to work around -Wdiscarded-qualifiers +- plugins/lvm{,-dbus}: get_lv_type_from_flags() returns const string +- plugins/kbd: make wait_for_file() static +- pkg-config: add -L${libdir} and -I${includedir} + +Tom Briden (1): + +- Re-order libbd_crypto_la_LIBADD to fix libtool issue + +Tomas Bzatek (2): + +- vdo: Properly destroy the yaml parser +- fs: Properly close both ends of the pipe + +Vojtech Trefny (33): + +- Sync spec with downstream +- Do not build VDO plugin on non-x86_64 architectures +- Show simple summary after configure +- Add Python override for bd_crypto_tc_open_full +- Add a simple test case for bd_crypto_tc_open +- Use libblkid in bd_crypto_is_luks +- Make sure all our free and copy functions work with NULL +- Fix few wrong names in doc strings +- Use versioned command for Python 2 +- Reintroduce python2 support for Fedora 29 +- Allow specifying extra options for PBKDF when creating LUKS2 +- configure.ac: Fix missing parenthesis in blkid version check +- acinclude.m4: Use AS_EXIT to fail in LIBBLOCKDEV_FAILURES +- Skip 'test_cache_pool_create_remove' on CentOS 7 +- BlockDev.py Convert dictionary keys to set before using them +- Make sure library tests properly clean after themselves +- Make sure library_test works after fixing -Wstrict-prototypes +- Do not build btrfs plugin on newer RHEL +- Do not build KBD plugin with bcache support on RHEL +- Skip btrfs tests if btrfs module is not available +- Add version to tests that should be skipped on CentOS/RHEL 7 +- Skip VDO tests also when the 'kvdo' module is not available +- Fix how we check zram stats from /sys/block/zram0/mm_stat +- Fix calling BlockDev.reinit in swap tests +- Fix vdo configuration options definition in spec file +- Fix running pylint in tests +- Ignore "bad-super-call" pylint warning in BlockDev.py +- Fix three memory leaks in lvm-dbus.c +- Fix licence headers in sources +- lvm.c: Check for 'lvm' dependency in 'bd_lvm_is_tech_avail' +- lvm-dbus.c: Check for 'lvmdbus' dependency in 'bd_lvm_is_tech_avail' +- Add test for is_tech_available with multiple dependencies +- Use python interpreter explicitly when running boilerplate_generator.py + +Libblockdev 2.18 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Notable changes** + +- features + + - New plugin: vdo + + - support for creating and managing VDO volumes + + - Support for building dm plugin without libdmraid support -- configure option ``--without-dmraid``. + +**Full list of changes** + +Kai Lüke (2): + +- Correct arguments for ext4 repair with progress +- Introduce reporting function per thread + +Tomas Bzatek (3): + +- vdo: Resolve real device file path +- vdo: Implement bd_vdo_grow_physical() +- vdo: Add tests for bd_vdo_grow_physical() + +Vojtech Trefny (14): + +- Update specs.rst and features.rst +- Fix release number in NEWS.rst +- Add 'bd_dm_is_tech_avail' to header file +- Always check for error when (un)mounting +- Add the VDO plugin +- Add basic VDO plugin functionality +- Add decimal units definition to utils/sizes.h +- Add tests for VDO plugin +- Only require plugins we really need in LVM dbus tests +- Allow compiling libblockdev without libdmraid +- Adjust to new NVDIMM namespace modes +- Do not try to build VDO plugin on Fedora +- Remove roadmap.rst +- Add VDO to features.rst + +Vratislav Podzimek (2): + +- Use xfs_repair instead of xfs_db in bd_fs_xfs_check() +- Clarify that checking an RW-mounted XFS file system is impossible + +segfault (1): + +- Fix off-by-one error when counting TCRYPT keyfiles + + +Libblockdev 2.17 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Notable changes** + +- features + + - New plugin: nvdimm + + - support for NVDIMM namespaces management + - requires *libndctl* >= 58.4 + + - LUKS2 support + + - support for creating LUKS2 format including authenticated disk encryption + - multiple new functions for working with LUKS devices (suspend/resume, header backup, metadata size...) + + - Extended support for opening TrueCrypt/VeraCrypt volumes + + - Support for building crypto plugin without escrow device support (removes + build dependency on *libvolume_key* and *libnss*) -- configure option ``--without-escrow``. + + - Support for building libblockdev without Python 2 support -- configure option + ``--without-python2``. + +**Full list of changes** + +Bjorn Pagen (3): + +- Fix build against musl libc +- Fix build with clang +- Enforce ZERO_INIT gcc backwards compatibility + +Florian Klink (1): + +- s390: don't hardcode paths, search PATH + +Jan Pokorny (1): + +- New function for luks metadata size + +Vojtech Trefny (24): + +- Sync the spec file with downstream +- Fix python2-gobject-base dependency on Fedora 26 and older +- Add the NVDIMM plugin +- Add tests for the NVDIMM plugin +- Add --without-xyz to DISTCHECK_CONFIGURE_FLAGS for disabled plugins +- Add function for getting NVDIMM namespace name from devname or path +- Fix memory leaks discovered by clang +- Get sector size for non-block NVDIMM namespaces too +- lvm-dbus: Check returned job object for error +- Add functions to suspend and resume a LUKS device +- Add function for killing keyslot on a LUKS device +- Add functions to backup and restore LUKS header +- Require at least libndctl 58.4 +- Allow compiling libblockdev crypto plugin without escrow support +- Allow building libblockdev without Python 2 support +- Skip bcache tests on Rawhide +- Add support for creating LUKS 2 format +- Use libblockdev function to create LUKS 2 in tests +- Add a basic test for creating LUKS 2 format +- Add function to get information about a LUKS device +- Add function to get information about LUKS 2 integrity devices +- Add functions to resize LUKS 2 +- Add a generic logging function for libblockdev +- Redirect cryptsetup log to libblockdev log + +Vratislav Podzimek (1): + +- Use '=' instead of '==' to compare using 'test' + +segfault (10): + +- Support unlocking VeraCrypt volumes +- Support TCRYPT keyfiles +- Support TCRYPT hidden containers +- Support TCRYPT system volumes +- Support VeraCrypt PIM +- Add function bd_crypto_device_seems_encrypted +- Make keyfiles parameter to bd_crypto_tc_open_full zero terminated +- Don't use VeraCrypt PIM if compiled against libcryptsetup < 2.0 +- Make a link point to the relevant section +- Add new functions to docs/libblockdev-sections.txt + +Libblockdev 2.16 +---------------- + +New minor release of the libblockdev library with multiple fixes. See below +for details. + +**Notable changes** + +- features + + - LUKS 2 support for luks_open/close and luks_add/remove/change_key + + - Progress report support for ext filesystem checks + + +**Full list of changes** + +Jan Tulak (4): + +- Add a function to test if prog. reporting was initialized +- Add progress reporting infrastructure for Ext fsck +- Add e2fsck progress +- Add tests for progress report + +Vojtech Trefny (5): + +- Fix link to online documentation +- Update 'Testing libblockdev' section in documentation +- Check if 'journalctl' is available before trying to use it in tests +- Fix few more links for project and documentation website +- Add support for LUKS 2 opening and key management + +Vratislav Podzimek (2): + +- Fix how the new kernel module functions are added to docs +- Sync the spec file with downstream + + +Libblockdev 2.15 +---------------- + +New minor release of the libblockdev library with multiple fixes and quite big +refactorization changes (in the file system plugin). See below for details. + + +**Notable changes** + +- fixes + + - Fix bd_s390_dasd_format() and bd_s390_dasd_is_ldl(). + + - Fix how GPT patition flags are set. + + - Check the *btrfs* module availability as part of checking the *btrfs* + plugin's dependencies. + + - Fix memory leaks in bd_fs_vfat_get_info() + + - Fix the file system plugin's dependency checking mechanisms. + + +- features + + - Mark some of the tests as unstable so that their failures are reported, but + ignored in the overall test suite status. + + - The file system plugin is now split into multiple source files making it + easier to add support for more file systems and technologies. + + +**Full list of changes** + +Vendula Poncova (2): + +- bd_s390_dasd_is_ldl should be true only for LDL DADSs +- Fix bd_s390_dasd_format + +Vojtech Trefny (5): + +- Use only sgdisk to set flags on GPT +- Add test for setting partition flags on GPT +- Free locale struct in kbd plugin +- Move kernel modules (un)loading and checking into utils +- Check for btrfs module availability in btrfs module + +Vratislav Podzimek (11): + +- Do not lie about tag creation +- Mark unstable tests as such +- Split the FS plugin source into multiple files +- Split the bd_fs_is_tech_avail() implementation +- Revert the behaviour of bd_fs_check_deps() +- Fix memory leaks in bd_fs_vfat_get_info() +- Mark bcache tests as unstable +- Add a HACKING.rst file +- Move the fs.h file to its original place +- Do not use the btrfs plugin in library tests +- Do not use the 'btrfs' plugin in overrides tests + + +Libblockdev 2.14 +---------------- + +New minor release of the libblockdev library with important fixes and a few new +features, in particular support for the NTFS file system. See below for details. + + +**Notable changes** + +- fixes + + - Fix BSSize memory leaks + + - Fixes for issues discovered by coverity + + - Support for the 'Legacy boot' GPT flag + +- features + + - Added function to get DM device subsystem + + - Support for the NTFS file system + + - pkg-config definitions improvements + + +**Full list of changes** + +Jan Pokorny (1): + +- Added function to get DM device subsystem + +Kai Lüke (2): + +- Add function wrappers for NTFS tools +- Add some test cases for NTFS + +Vojtech Trefny (29): + +- Skip btrfs subvolume tests with btrfs-progs 4.13.2 +- Fix BSSize memory leaks in btrfs and mdraid plugins +- Use system values in KbdTestBcacheStatusTest +- Use libbytesize to parse bcache block size +- blockdev.c.in: Fix unused variables +- fs.c: Fix resource leaks in 'bd_fs_get_fstype' +- fs.c: Check sscanf return value in 'bd_fs_vfat_get_info' +- fs.c: Fix for loop condition in 'bd_fs_get_fstype' +- lvm.c: Fix "use after free" in 'bd_lvm_get_thpool_meta_size' +- mdraid.c: Fix resource leaks +- part.c: Check if file discriptor is >= 0 before closing it +- kbd.c: Fix double free in 'bd_kbd_zram_get_stats' +- exec.c: Fix "use after free" in 'bd_utils_check_util_version' +- crypto.c: Use right key buffer in 'bd_crypto_luks_add_key' +- part.c: Fix possible NULL pointer dereference +- fs.c: Fix "forward null" in 'do_mount' and 'bd_fs_xfs_get_info' +- exec.c: Fix resource leaks in 'bd_utils_exec_and_report_progress' +- kbd.c: Fix potential string overflow in 'bd_kbd_bcache_create' +- part.c: Check if we've found a place to put new logical partitions +- exec.c: Ignore errors from 'g_io_channel_shutdown' +- Ignore some coverity false positive errors +- crypto.c: Fix waiting for enough entropy +- exec.c: Fix error message in 'bd_utils_exec_and_report_progress' +- Fix duplicate 'const' in generated functions +- lvm-dbus.c: Fix multiple "use after free" coverity warnings +- fs.c: Fix multiple "forward NULL" warnings in 'bd_fs_ntfs_get_info' +- dm.c: Check return values of dm_task_set_name/run/get_info functions +- dm.c: Fix uninitialized values in various dm plugin functions +- fs.c: Fix potential NULL pointer dereference + +Vratislav Podzimek (3): + +- Sync spec with downstream +- Add pkgconfig definitions for the utils library +- Respect the version in the blockdev.pc file + +intrigeri (1): + +- Support the legacy boot GPT flag + + +Thanks to all our contributors. + +Vratislav Podzimek, 2017-10-31 + + +Libblockdev 2.13 +---------------- + +New minor release of the libblockdev library. Most of the changes are bugfixes +related to building and running tests on the s390 architecture and CentOS 7 +aarch64. Other than that a support for checking runtime dependencies (utilities) +on demand and querying available technologies was implemented. + + +**Notable changes** + +- builds + + - various fixes for building on s390 + +- tests + + - various changes allowing running the test suite on s390 + + - various changes allowing running the test suite on CentOS7 aarch64 + +- features + + - checking for runtime dependencies on demand + + - querying available technologies + + +**Full list of changes** + +Vojtech Trefny (14): + +- Allow compiling libblockdev without s390 plugin +- Do not run g_clear_error after setting it +- Fix zFCP LUN max length +- Bypass error proxy in s390 test +- Use "AC_CANONICAL_BUILD" to check architecture instead of "uname" +- Do not include s390utils/vtoc.h in s390 plugin +- Add NEWS.rst file +- Fix source URL in spec file +- Use only one git tag for new releases +- Add new function for setting swap label +- Skip btrfs tests on CentOS 7 aarch64 +- Better handle old and new zram sysfs api in tests +- Try harder when waiting for lio device to show up +- Use shorter prefix for tempfiles + +Vratislav Podzimek (9): + +- Add a function for getting plugin name +- Dynamically check for the required utilities +- Add functions for querying available technologies +- Simplify what WITH_BD_BCACHE changes in the KBD plugin +- Add a basic test for the runtime dependency checking +- Add missing items to particular sections in the documentation +- Assign functions to tech-mode categories +- Add a function for enabling/disabling plugins' init checks +- Fix the rpmlog and shortlog targets + +Thanks to all our contributors. + +Vratislav Podzimek, 2017-09-29 + + +Libblockdev 2.12 +---------------- + +New minor release of libblockdev library. Most changes in this release are related to +improving our test suite and fixing new issues and bugs. + +**Notable changes** + +- tests + + - various changes allowing running the test suite on Debian + +**Full list of changes** + +Kai Lüke (1): + +- Wait for resized partition + +Vojtech Trefny (20): + +- Try to get distribution info from "PrettyName" if "CPEName" isn't available +- Require only plugins that are needed for given test +- Try harder to unmount devices in test cleanup +- Fix redirecting command output to /dev/null in tests +- Skip free region tests on Debian too +- Skip the test for device escrow on Debian too +- Skip zRAM tests on Debian +- Skip dependency checking in mpath tests on Debian +- Fix checking for available locales +- Fix names of backing files in tests +- Skip vgremove tests on 32bit Debian +- Use libmount cache when parsing /proc/mounts +- Use mountpoint for "xfs_info" calls +- Close filesystem before closing the partition during FAT resize +- Stop skipping FAT resize tests on rawhide +- Tests: Move library initialization to setUpClass method +- Add a script for running tests +- Use "run_tests" script for running tests from Makefile +- Fix label check in swap_test +- Own directories /etc/libblockdev and /etc/libblockdev/conf.d + +Vratislav Podzimek (6): + +- Sync spec with downstream +- Use -ff when creating PVs in FS tests +- Confirm the force when creating PVs in FS tests +- Add some space for the CI status +- Make sure the device is opened for libparted +- New version - 2.12 + +Thanks to all our contributors. + +Vratislav Podzimek, 2017-08-30 + + +Libblockdev 2.11 +---------------- + +New minor release of libblockdev library. + +**Notable changes** + +- library + + - added option to skip dependecy check during library initialization + +**Full list of changes** + +Kai Lüke (2): + +- Link to GObject even if no plugin is activated +- Allow non-source directory builds + +Vojtech Trefny (1): + +- Use new libmount function to get (un)mount error message + +Vratislav Podzimek (6): + +- Update the documentation URL +- Keep most utilities available for tests +- Skip zram tests on Rawhide +- Add a way to disable runtime dependency checks +- Make the KbdZRAMDevicesTestCase inherit from KbdZRAMTestCase +- New version - 2.11 + + +Thanks to all our contributors. + +Vratislav Podzimek, 2017-07-31 + + +Libblockdev 2.10 +---------------- + +New minor release of libblockdev library adding some new functionality in the +crypto, fs and part plugins and fixing various issues and bugs. + +**Notable changes** + +- crypto + + - support for opening and closing TrueCrypt/VeraCrypt volumes: ``bd_crypto_tc_open`` + and ``bd_crypto_tc_close`` + +- fs + + - new functions for checking of filesystem functions availability: ``bd_fs_can_resize``, + ``bd_fs_can_check`` and ``bd_fs_can_repair`` + + - new generic function for filesystem repair and check: ``bd_fs_repair`` and ``bd_fs_check`` + +- part + + - newly added support for partition resizing: ``bd_part_resize_part`` + + +**Full list of changes** + +Kai Lüke (6): + +- Size in bytes for xfs_resize_device +- Query functions for FS resize and repair support +- Generic Check and Repair Functions +- Add partition resize function +- Query setting FS label support and generic relabeling +- Specify tolerance for partition size + +Tony Asleson (3): + +- kbd.c: Make bd_kbd_bcache_create work without abort +- kbd.c: Code review corrections +- bcache tests: Remove FEELINGLUCKY checks + +Tristan Van Berkom (2): + +- Fixed include for libvolume_key.h +- src/plugins/Makefile.am: Remove hard coded include path in /usr prefix + +Vratislav Podzimek (12): + +- Try RO mount also if we get EACCES +- Adapt to a change in behaviour in new libmount +- Add functions for opening/closing TrueCrypt/VeraCrypt volumes +- Update the project/source URL in the spec file +- Compile everything with the C99 standard +- Do not strictly require all FS utilities +- Check resulting FS size in tests for generic FS resize +- Only use the exact constraint if not using any other +- Do not verify vfat FS' size after generic resize +- Limit the requested partition size to maximum possible +- Only enable partition size tolerance with alignment +- New version - 2.10 + +squimrel (1): + +- Ignore parted warnings if possible + +Thanks to all our contributors. + +Vratislav Podzimek, 2017-07-05 diff --git a/libblockdev-3.0.1.tar.gz b/libblockdev-3.0.1.tar.gz deleted file mode 100644 index 5e8861e..0000000 --- a/libblockdev-3.0.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:569e47eb322acc6dfe2becb0b575ebd19f0df8dab8dc91ea0280f112d2d9e528 -size 1066201 diff --git a/libblockdev-3.0.2.tar.gz b/libblockdev-3.0.2.tar.gz new file mode 100644 index 0000000..fc974d5 --- /dev/null +++ b/libblockdev-3.0.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7aff7c762abe7585fac0ea335ea5eefced6688515cc5a0b9c1a18003246af079 +size 1067300 diff --git a/libblockdev.changes b/libblockdev.changes index a3d1c27..41a15e2 100644 --- a/libblockdev.changes +++ b/libblockdev.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Wed Aug 23 01:16:38 UTC 2023 - Luciano Santos + +- Update to version 3.0.2: + * Use ntfsinfo instead of ntfscluster for faster + bd_fs_ntfs_get_info. + * Restrict list of exported symbols via -export-symbols-regex. + * lib: Silence the missing DEFAULT_CONF_DIR_PATH. + * loop: Report BD_LOOP_ERROR_DEVICE on empty loop devices. + * fs: Fix unused error in extract_e2fsck_progress. + * fs: Use read-only mount where possible for generic FS + functions. + * fs: Document that generic functions can mount filesystems. + * fs: Avoid excess logging in extract_e2fsck_progress. +- Restructure all sub-packages in the spec file to enhance + maintainability. + ------------------------------------------------------------------- Fri Jun 30 10:16:53 UTC 2023 - Paolo Stivanin @@ -38,10 +55,10 @@ Fri Jun 30 10:16:53 UTC 2023 - Paolo Stivanin (python-devel), bcache, dmraid (dmraid-devel BuildRequires) and kbd. - Add (gcc >= 11 or gcc11) boolean BuildRequires to ensure the - package is buildable in Leap 15.5, where the gcc meta-package is + package is buildable on Leap 15.5, where the gcc meta-package is of version 7. -- Bump SO version in shared library and GI bindings sub-packages to - 3. +- Bump the SO version to 3 for the shared library and GI bindings + sub-packages. - Add ext2fs, fdisk, and libkeyutils pkgconfig() BuildRequires. The first is a new dependency for the FS plugin. The second, for the PART plugin. And the latter, for the CRYPTO plugin (before, diff --git a/libblockdev.spec b/libblockdev.spec index 0f23717..f26fde9 100644 --- a/libblockdev.spec +++ b/libblockdev.spec @@ -16,26 +16,55 @@ # -%define somajor 3 -%define libname %{name}%{somajor} +### PLUGINS ### +%bcond_without btrfs_plugin +%bcond_without crypto_plugin +%bcond_without dm_plugin +%bcond_with escrow_plugin +%bcond_without fs_plugin +%bcond_without loop_plugin +%bcond_without lvm_plugin +%bcond_without lvmdbus_plugin +%bcond_without mdraid_plugin +%bcond_without mpath_plugin +%bcond_with nvdimm_plugin +%bcond_without nvme_plugin +%bcond_without part_plugin +%bcond_without swap_plugin +### +%bcond_without gi_bindings +%bcond_without gtk_doc +%bcond_without python_bindings +%bcond_without utils +%bcond_without tools + +%define soversion 3 Name: libblockdev -Version: 3.0.1 +Version: 3.0.2 Release: 0 Summary: A library for low-level manipulation with block devices License: LGPL-2.1-only Group: Development/Libraries/C and C++ URL: https://github.com/storaged-project/libblockdev -Source0: https://github.com/storaged-project/libblockdev/releases/download/%{version}-1/libblockdev-%{version}.tar.gz -BuildRequires: gobject-introspection-devel >= 1.3.0 +Source0: %{url}/releases/download/%{version}-1/libblockdev-%{version}.tar.gz +Source1: %{url}/raw/%{version}-1/NEWS.rst + +############################################################################### +# M A I N P A C K A G E +############################################################################### + +%if %{with gtk_doc} BuildRequires: gtk-doc +%endif BuildRequires: pkgconfig -BuildRequires: python3-devel BuildRequires: (gcc >= 11 or gcc11) BuildRequires: pkgconfig(ext2fs) BuildRequires: pkgconfig(fdisk) BuildRequires: pkgconfig(libnvme) >= 1.3 -# There is a s390x plugin that, until vtoc.h is provided, can't be added. +# There is a s390x plugin that, until vtoc.h is provided by s390-tools*, can't +# be added: +# https://github.com/ibm-s390-linux/s390-tools/blob/master/include/lib/vtoc.h #BuildRequires: s390-tools-devel BuildRequires: pkgconfig(blkid) >= 2.23.0 BuildRequires: pkgconfig(bytesize) >= 0.1 @@ -51,9 +80,11 @@ BuildRequires: pkgconfig(libparted) >= 3.1 BuildRequires: pkgconfig(libudev) >= 216 BuildRequires: pkgconfig(mount) >= 2.23.0 BuildRequires: pkgconfig(yaml-0.1) -Requires: %{libname} >= %{version} +Requires: libblockdev%{soversion} >= %{version} +%if %{with tools} ### lvm-cache-stats binary needs LVM's plugin to work (boo#1183948) ### Requires: libblockdev-lvm >= %{version} +%endif %description The LibBlockDev is a C library with GObject introspection support that can be @@ -64,451 +95,35 @@ 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 -n %{libname} -Summary: A library for low-level manipulation with block devices -Group: System/Libraries -Obsoletes: libbd_vdo2 <= 2.26 -Obsoletes: libblockdev-vdo <= 2.26 +%files +%doc NEWS.rst +%{_bindir}/lvm-cache-stats +%{_bindir}/vfat-resize +%dir %{_sysconfdir}/libblockdev +%dir %{_sysconfdir}/libblockdev/%{soversion} +%dir %{_sysconfdir}/libblockdev/%{soversion}/conf.d +%config %{_sysconfdir}/libblockdev/%{soversion}/conf.d/10-lvm-dbus.cfg +%config %{_sysconfdir}/libblockdev/%{soversion}/conf.d/00-default.cfg -%description -n %{libname} -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 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 -n typelib-1_0-BlockDev-3_0 -Summary: Introspection bindings for the LibBlockDev library -Group: System/Libraries - -%description -n typelib-1_0-BlockDev-3_0 -This package provides the GObject Introspection bindings for LibBlockDev, which -provides low-level manipulation of block devices. +############################################################################### +# D E V E L F I L E S +############################################################################### %package devel Summary: Development files for the LibBlockDev library Group: Development/Libraries/C and C++ -Requires: %{libname} >= %{version} Requires: glib2-devel -Obsoletes: libbd_vdo-devel <= 2.26 -Obsoletes: libblockdev-vdo-devel <= 2.26 +Requires: libblockdev%{soversion} >= %{version} %description devel -This package provides header files, pkg-config modules and API documentation needed for -development with the LibBlockDev library. - -%package -n python3-%{name} -Summary: Python3 gobject-introspection bindings for the LibBlockDev library -Group: Development/Libraries/Python -Requires: %{libname} >= %{version} -Requires: python3-gobject - -%description -n python3-%{name} -This package contains enhancements to the gobject-introspection bindings for -LibBlockDev in Python3. - -%package -n libbd_btrfs%{somajor} -Summary: The BTRFS plugin for the LibBlockDev library -Group: System/Libraries -Requires: libbd_utils%{somajor} >= %{version} -Provides: libblockdev-btrfs = %{version} - -%description -n libbd_btrfs%{somajor} -This LibBlockDev library plugin (and, at the same time, a standalone library) -provides BTRFS-related functionality. - -%package -n libbd_btrfs-devel -Summary: Development files for the libbd_btrfs plugin/library -Group: Development/Libraries/C and C++ -Requires: glib2-devel -Requires: libbd_btrfs%{somajor} >= %{version} -Requires: libbd_utils-devel -Provides: libblockdev-btrfs-devel = %{version} - -%description -n libbd_btrfs-devel -This package contains header files and pkg-config files needed for development -with the libbd_btrfs plugin/library. - -%package -n libbd_nvme%{somajor} -Summary: The NVME plugin for the LibBlockDev library -Group: System/Libraries -Requires: libbd_utils%{somajor} >= %{version} -Provides: libblockdev-nvme = %{version} - -%description -n libbd_nvme%{somajor} -This LibBlockDev library plugin (and, at the same time, a standalone library) -provides NVME-related functionality. - -%package -n libbd_nvme-devel -Summary: Development files for the libbd_btrfs plugin/library -Group: Development/Libraries/C and C++ -Requires: glib2-devel -Requires: libbd_nvme%{somajor} >= %{version} -Requires: libbd_utils-devel -Provides: libblockdev-nvme-devel = %{version} - -%description -n libbd_nvme-devel -This package contains header files and pkg-config files needed for development -with the libbd_nvme plugin/library. - -%package -n libbd_crypto%{somajor} -Summary: The crypto plugin for the LibBlockDev library -Group: System/Libraries -Provides: libblockdev-crypto = %{version} - -%description -n libbd_crypto%{somajor} -This LibBlockDev library plugin (and, at the same time, a standalone library) -provides functionality related to LUKS-style encrypted devices. - -%package -n libbd_crypto-devel -Summary: Development files for the libbd_crypto plugin/library -Group: Development/Libraries/C and C++ -Requires: glib2-devel -Requires: libbd_crypto%{somajor} >= %{version} -Provides: libblockdev-crypto-devel = %{version} - -%description -n libbd_crypto-devel -This package contains header files and pkg-config files needed for development -with the libbd_crypto plugin/library.. - -%package -n libbd_dm%{somajor} -Summary: The Device Mapper plugin for the LibBlockDev library -Group: System/Libraries -Requires: device-mapper -Requires: dmraid -Requires: libbd_utils%{somajor} >= %{version} -Provides: libblockdev-dm = %{version} - -%description -n libbd_dm%{somajor} -This LibBlockDev library plugin (and, at the same time, a standalone library) -provides functionality related to Device Mapper. - -%package -n libbd_dm-devel -Summary: Development files for the libbd_dm plugin/library -Group: Development/Libraries/C and C++ -Requires: device-mapper-devel -Requires: dmraid-devel -Requires: glib2-devel -Requires: libbd_dm%{somajor} >= %{version} -Requires: libbd_utils-devel -Requires: systemd-devel -Provides: libblockdev-dm-devel = %{version} - -%description -n libbd_dm-devel -This package contains header files and pkg-config files needed for development -with the libbd_dm plugin/library.. - -%package -n libbd_fs%{somajor} -Summary: The FS plugin for the LibBlockDev library -Group: System/Libraries -Requires: device-mapper -Requires: libbd_utils%{somajor} >= %{version} -Provides: libblockdev-fs = %{version} - -%description -n libbd_fs%{somajor} -This LibBlockDev library plugin (and, at the same time, a standalone library) -provides functionality related to operations with file systems. - -%package -n libbd_fs-devel -Summary: Development files for the libbd_fs plugin/library -Group: Development/Libraries/C and C++ -Requires: dosfstools -Requires: glib2-devel -Requires: libbd_fs%{somajor} >= %{version} -Requires: libbd_utils-devel -Requires: xfsprogs -Provides: libblockdev-fs-devel = %{version} - -%description -n libbd_fs-devel -This package contains header files and pkg-config files needed for development -with the libbd_fs plugin/library.. - -%package -n libbd_loop%{somajor} -Summary: The loop plugin for the LibBlockDev library -Group: System/Libraries -Requires: libbd_utils%{somajor} >= %{version} -Provides: libblockdev-loop = %{version} - -%description -n libbd_loop%{somajor} -This LibBlockDev library plugin (and, at the same time, a standalone library) -provides functionality related to loop devices. - -%package -n libbd_loop-devel -Summary: Development files for the libblockdev-loop plugin/library -Group: Development/Libraries/C and C++ -Requires: glib2-devel -Requires: libbd_loop%{somajor} = %{version} -Requires: libbd_utils-devel >= %{version} -Provides: libblockdev-loop-devel = %{version} - -%description -n libbd_loop-devel -This package contains header files and pkg-config files needed for development -with the libbd_loop plugin/library. - -%package -n libbd_lvm%{somajor} -Summary: The LVM plugin for the LibBlockDev library -Group: System/Libraries -Requires: libbd_utils%{somajor} >= %{version} -Requires: lvm2 -# For thin_metadata_size. -Requires: thin-provisioning-tools -Provides: libblockdev-lvm = %{version} - -%description -n libbd_lvm%{somajor} -This LibBlockDev library plugin (and, at the same time, a standalone library) -provides LVM-related functionality. - -%package -n libbd_lvm-devel -Summary: Development files for the libblockdev-lvm plugin/library -Group: Development/Libraries/C and C++ -Requires: glib2-devel -Requires: libbd_lvm%{somajor} = %{version} -Requires: libbd_utils-devel >= %{version} -Provides: libblockdev-lvm-devel = %{version} - -%description -n libbd_lvm-devel -This package contains header files and pkg-config files needed for development -with the libbd_lvm plugin/library. - -%package -n libbd_lvm-dbus%{somajor} -Summary: The LVM plugin for the LibBlockDev library -Group: System/Libraries -Requires: libbd_utils%{somajor} >= %{version} -Requires: lvm2 -# For thin_metadata_size. -Requires: thin-provisioning-tools -Provides: libblockdev-lvm-dbus = %{version} - -%description -n libbd_lvm-dbus%{somajor} -This LibBlockDev library plugin (and, at the same time, a standalone library) -provides LVM-related functionality utilizing the LVM DBus API. - -%package -n libbd_lvm-dbus-devel -Summary: Development files for the libblockdev-lvm-dbus plugin/library -Group: Development/Libraries/C and C++ -Requires: glib2-devel -Requires: libbd_lvm-dbus%{somajor} = %{version} -Requires: libbd_lvm-devel >= %{version} -Requires: libbd_utils-devel >= %{version} -Provides: libblockdev-lvm-dbus-devel = %{version} - -%description -n libbd_lvm-dbus-devel -This package contains header files and pkg-config files needed for development -with the libbd_lvm-dbus plugin/library. - -%package -n libbd_mdraid%{somajor} -Summary: The MD RAID plugin for the LibBlockDev library -Group: System/Libraries -Requires: libbd_utils%{somajor} >= %{version} -Requires: mdadm -Provides: libblockdev-mdraid = %{version} - -%description -n libbd_mdraid%{somajor} -This LibBlockDev library plugin (and, at the same time, a standalone library) -provides functionality related to MD RAID. - -%package -n libbd_mdraid-devel -Summary: Development files for the libblockdev-mdraid plugin/library -Group: Development/Libraries/C and C++ -Requires: glib2-devel -Requires: libbd_mdraid%{somajor} = %{version} -Requires: libbd_utils-devel >= %{version} -Provides: libblockdev-mdraid-devel = %{version} - -%description -n libbd_mdraid-devel -This package contains header files and pkg-config files needed for development -with the libbd_mdraid plugin/library. - -%package -n libbd_mpath%{somajor} -Summary: The multipath plugin for the LibBlockDev library -Group: System/Libraries -Requires: libbd_utils%{somajor} >= %{version} -Requires: multipath-tools -Provides: libblockdev-mpath = %{version} - -%description -n libbd_mpath%{somajor} -This LibBlockDev library plugin (and, at the same time, a standalone library) -provides functionality related to multipath devices. - -%package -n libbd_mpath-devel -Summary: Development files for the libblockdev-mpath plugin/library -Group: Development/Libraries/C and C++ -Requires: glib2-devel -Requires: libbd_mpath%{somajor} = %{version} -Requires: libbd_utils-devel >= %{version} -Provides: libblockdev-mpath-devel = %{version} - -%description -n libbd_mpath-devel -This package contains header files and pkg-config files needed for development -with the libbd_mpath plugin/library. - -%package -n libbd_part%{somajor} -Summary: The partitioning plugin for the LibBlockDev library -Group: System/Libraries -Requires: gptfdisk -Requires: libbd_utils%{somajor} >= %{version} -Requires: util-linux -Provides: libblockdev-part = %{version} - -%description -n libbd_part%{somajor} -This LibBlockDev library plugin (and, at the same time, a standalone library) -provides functionality related to partitioning. - -%package -n libbd_part-devel -Summary: Development files for the libblockdev-part plugin/library -Group: Development/Libraries/C and C++ -Requires: glib2-devel -Requires: libbd_part%{somajor} = %{version} -Requires: libbd_utils-devel >= %{version} -Provides: libblockdev-part-devel = %{version} - -%description -n libbd_part-devel -This package contains header files and pkg-config files needed for development -with the libbd_part plugin/library. - -%package -n libbd_swap%{somajor} -Summary: The swap plugin for the LibBlockDev library -Group: System/Libraries -Requires: libbd_utils%{somajor} >= %{version} -Requires: util-linux -Provides: libblockdev-swap = %{version} - -%description -n libbd_swap%{somajor} -This LibBlockDev library plugin (and, at the same time, a standalone library) -provides functionality related to swap devices. - -%package -n libbd_swap-devel -Summary: Development files for the libblockdev-swap plugin/library -Group: Development/Libraries/C and C++ -Requires: glib2-devel -Requires: libbd_swap%{somajor} = %{version} -Requires: libbd_utils-devel >= %{version} -Provides: libblockdev-swap-devel = %{version} - -%description -n libbd_swap-devel -This package contains header files and pkg-config files needed for development -with the libbd_swap plugin/library. - -%package -n libbd_utils%{somajor} -Summary: Utility functions library for the LibBlockDev library -Group: System/Libraries - -%description -n libbd_utils%{somajor} -libbd_utils is a library providing utility functions used by the -LibBlockDev library and its plugins. - -%package -n libbd_utils-devel -Summary: Development files for libbd_utils -Group: Development/Libraries/C and C++ -Requires: glib2-devel -Requires: libbd_utils%{somajor} >= %{version} - -%description -n libbd_utils-devel -This package contains header files and pkg-config files needed for development -with the libbd_utils library. - -%prep -%autosetup -p1 - -%build -export CFLAGS="%{optflags} -Wno-deprecated-declarations" -%if 0%{?suse_version} < 1590 - export CC=%{_bindir}/gcc-11 -%endif - -%configure \ - --disable-static \ - --enable-introspection \ - --with-btrfs \ - --with-crypto \ - --with-dm \ - --with-fs \ - --with-gtk-doc \ - --with-tools \ - --with-nvme \ - --with-loop \ - --with-lvm \ - --with-lvm_dbus \ - --with-mdraid \ - --with-mpath \ - --with-part \ - --with-swap \ - --without-escrow \ - --without-nvdimm \ - %{nil} -%make_build - -%install -%make_install -find %{buildroot} -name "*.la" -print -type f -delete - -%post -n %{libname} -p /sbin/ldconfig -%postun -n %{libname} -p /sbin/ldconfig - -%post -n libbd_btrfs%{somajor} -p /sbin/ldconfig -%postun -n libbd_btrfs%{somajor} -p /sbin/ldconfig - -%post -n libbd_nvme%{somajor} -p /sbin/ldconfig -%postun -n libbd_nvme%{somajor} -p /sbin/ldconfig - -%post -n libbd_crypto%{somajor} -p /sbin/ldconfig -%postun -n libbd_crypto%{somajor} -p /sbin/ldconfig - -%post -n libbd_dm%{somajor} -p /sbin/ldconfig -%postun -n libbd_dm%{somajor} -p /sbin/ldconfig - -%post -n libbd_fs%{somajor} -p /sbin/ldconfig -%postun -n libbd_fs%{somajor} -p /sbin/ldconfig - -%post -n libbd_loop%{somajor} -p /sbin/ldconfig -%postun -n libbd_loop%{somajor} -p /sbin/ldconfig - -%post -n libbd_lvm%{somajor} -p /sbin/ldconfig -%postun -n libbd_lvm%{somajor} -p /sbin/ldconfig - -%post -n libbd_lvm-dbus%{somajor} -p /sbin/ldconfig -%postun -n libbd_lvm-dbus%{somajor} -p /sbin/ldconfig - -%post -n libbd_mdraid%{somajor} -p /sbin/ldconfig -%postun -n libbd_mdraid%{somajor} -p /sbin/ldconfig - -%post -n libbd_mpath%{somajor} -p /sbin/ldconfig -%postun -n libbd_mpath%{somajor} -p /sbin/ldconfig - -%post -n libbd_part%{somajor} -p /sbin/ldconfig -%postun -n libbd_part%{somajor} -p /sbin/ldconfig - -%post -n libbd_swap%{somajor} -p /sbin/ldconfig -%postun -n libbd_swap%{somajor} -p /sbin/ldconfig - -%post -n libbd_utils%{somajor} -p /sbin/ldconfig -%postun -n libbd_utils%{somajor} -p /sbin/ldconfig - -%files -%dir %{_sysconfdir}/libblockdev -%dir %{_sysconfdir}/libblockdev/%{somajor} -%dir %{_sysconfdir}/libblockdev/%{somajor}/conf.d -%config %{_sysconfdir}/libblockdev/%{somajor}/conf.d/10-lvm-dbus.cfg -%{_bindir}/lvm-cache-stats -%{_bindir}/vfat-resize - -%files -n %{libname} -%license LICENSE -%{_libdir}/libblockdev.so.%{somajor}* -%ifarch s390x -%{_libdir}/libbd_s390.so* -%endif - -%files -n typelib-1_0-BlockDev-3_0 -%{_libdir}/girepository-1.0/BlockDev-3.0.typelib +This package provides header files, pkg-config modules and API documentation +needed for development with the LibBlockDev library. %files devel %doc %{_datadir}/gtk-doc/html/libblockdev %{_libdir}/libblockdev.so %{_libdir}/pkgconfig/blockdev.pc -%{_datadir}/gir-1.0/BlockDev-3.0.gir +%{_datadir}/gir-1.0/BlockDev-%{soversion}.0.gir %dir %{_includedir}/blockdev %{_includedir}/blockdev/blockdev.h %{_includedir}/blockdev/plugins.h @@ -517,134 +132,624 @@ find %{buildroot} -name "*.la" -print -type f -delete %{_includedir}/blockdev/s390.h %endif +############################################################################### +# S H A R E D L I B R A R Y +############################################################################### + +%package -n libblockdev%{soversion} +Summary: A library for low-level manipulation with block devices +Group: System/Libraries + +%description -n libblockdev%{soversion} +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 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). + +%ldconfig_scriptlets -n libblockdev%{soversion} + +%files -n libblockdev%{soversion} +%license LICENSE +%{_libdir}/libblockdev.so.%{soversion} +%{_libdir}/libblockdev.so.%{soversion}.?.? +%ifarch s390x +%{_libdir}/libbd_s390.so.%{soversion} +%{_libdir}/libbd_s390.so.%{soversion}.?.? +%endif + +############################################################################### +# G O B J E C T I N T R O S P E C T I O N B I N D I N G S +############################################################################### + +%if %{with gi_bindings} +%package -n typelib-1_0-BlockDev-%{soversion}_0 +Summary: GI bindings for the LibBlockDev library +Group: System/Libraries +BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.3.0 + +%description -n typelib-1_0-BlockDev-%{soversion}_0 +This package provides the GObject Introspection bindings for LibBlockDev, which +provides low-level manipulation of block devices. + +%files -n typelib-1_0-BlockDev-%{soversion}_0 +%{_libdir}/girepository-1.0/BlockDev-%{soversion}.0.typelib + +############################################################################### +# P Y T H O N 3 B I N D I N G S +############################################################################### + +%if %{with python_bindings} +%package -n python3-%{name} +Summary: Python 3 GI bindings for the LibBlockDev library +Group: Development/Libraries/Python +BuildRequires: python3-devel +BuildRequires: python3-gobject + +Requires: python3-bytesize +Requires: python3-gobject + +%description -n python3-%{name} +This package contains enhancements to the GObject Introspection bindings for +LibBlockDev, in Python 3. + %files -n python3-%{name} -%dir %{python3_sitearch}/gi -%dir %{python3_sitearch}/gi/overrides %{python3_sitearch}/gi/overrides/BlockDev.py +%endif +%endif -%files -n libbd_btrfs%{somajor} -%{_libdir}/libbd_btrfs.so.%{somajor}* +############################################################################### +# B T R F S P L U G I N +############################################################################### -%files -n libbd_btrfs-devel -%{_libdir}/libbd_btrfs.so +%if %{with btrfs_plugin} +%package -n libbd_btrfs%{soversion} +Summary: The Btrfs plugin for the LibBlockDev library +Group: System/Libraries +Requires: libbd_utils%{soversion} >= %{version} +Provides: libblockdev-btrfs = %{version} + +%description -n libbd_btrfs%{soversion} +This LibBlockDev library plugin (and, at the same time, a standalone library) +provides Btrfs-related functionality. + +%files -n libbd_btrfs%{soversion} -f btrfs-plugin.filelist + +%package -n libbd_btrfs-devel +Summary: Development files for the libbd_btrfs plugin/library +Group: Development/Libraries/C and C++ +Requires: glib2-devel +Requires: libbd_btrfs%{soversion} >= %{version} +Requires: libbd_utils-devel >= %{version} +Provides: libblockdev-btrfs-devel = %{version} + +%description -n libbd_btrfs-devel +This package contains header files and pkg-config files needed for development +with the libbd_btrfs plugin/library. + +%ldconfig_scriptlets -n libbd_btrfs%{soversion} + +%files -n libbd_btrfs-devel -f btrfs-plugin-devel.filelist %dir %{_includedir}/blockdev -%{_includedir}/blockdev/btrfs.h +%endif -%files -n libbd_nvme%{somajor} -%{_libdir}/libbd_nvme.so.%{somajor}* +############################################################################### +# C R Y P T O P L U G I N +############################################################################### -%files -n libbd_nvme-devel -%{_libdir}/libbd_nvme.so +%if %{with crypto_plugin} +%package -n libbd_crypto%{soversion} +Summary: The Crypto plugin for the LibBlockDev library +Group: System/Libraries +Requires: libbd_utils%{soversion} >= %{version} +Provides: libblockdev-crypto = %{version} + +%description -n libbd_crypto%{soversion} +This LibBlockDev library plugin (and, at the same time, a standalone library) +provides functionality related to LUKS-style encrypted devices. + +%ldconfig_scriptlets -n libbd_crypto%{soversion} + +%files -n libbd_crypto%{soversion} -f crypto-plugin.filelist + +%package -n libbd_crypto-devel +Summary: Development files for the libbd_crypto plugin/library +Group: Development/Libraries/C and C++ +Requires: glib2-devel +Requires: libbd_crypto%{soversion} >= %{version} +Provides: libblockdev-crypto-devel = %{version} + +%description -n libbd_crypto-devel +This package contains header files and pkg-config files needed for development +with the libbd_crypto plugin/library.. + +%files -n libbd_crypto-devel -f crypto-plugin-devel.filelist %dir %{_includedir}/blockdev -%{_includedir}/blockdev/nvme.h +%endif -%files -n libbd_crypto%{somajor} -%{_libdir}/libbd_crypto.so.%{somajor}* +############################################################################### +# D E V I C E M A P P E R P L U G I N +############################################################################### -%files -n libbd_crypto-devel -%{_libdir}/libbd_crypto.so +%if %{with dm_plugin} +%package -n libbd_dm%{soversion} +Summary: The Device Mapper plugin for the LibBlockDev library +Group: System/Libraries +Requires: device-mapper +Requires: dmraid +Requires: libbd_utils%{soversion} >= %{version} +Provides: libblockdev-dm = %{version} + +%description -n libbd_dm%{soversion} +This LibBlockDev library plugin (and, at the same time, a standalone library) +provides functionality related to Device Mapper. + +%ldconfig_scriptlets -n libbd_dm%{soversion} + +%files -n libbd_dm%{soversion} -f dm-plugin.filelist + +%package -n libbd_dm-devel +Summary: Development files for the libbd_dm plugin/library +Group: Development/Libraries/C and C++ +Requires: device-mapper-devel +Requires: dmraid-devel +Requires: glib2-devel +Requires: libbd_dm%{soversion} >= %{version} +Requires: libbd_utils-devel +Requires: systemd-devel +Provides: libblockdev-dm-devel = %{version} + +%description -n libbd_dm-devel +This package contains header files and pkg-config files needed for development +with the libbd_dm plugin/library.. + +%files -n libbd_dm-devel -f dm-plugin-devel.filelist %dir %{_includedir}/blockdev -%{_includedir}/blockdev/crypto.h +%endif -%files -n libbd_dm%{somajor} -%{_libdir}/libbd_dm.so.%{somajor}* +############################################################################### +# F I L E S Y S T E M P L U G I N +############################################################################### -%files -n libbd_dm-devel -%{_libdir}/libbd_dm.so -%dir %{_includedir}/blockdev -%{_includedir}/blockdev/dm.h +%if %{with fs_plugin} +%package -n libbd_fs%{soversion} +Summary: The FS plugin for the LibBlockDev library +Group: System/Libraries +Requires: device-mapper +Requires: libbd_utils%{soversion} >= %{version} +Provides: libblockdev-fs = %{version} -%files -n libbd_fs%{somajor} -%{_libdir}/libbd_fs.so.%{somajor}* +%description -n libbd_fs%{soversion} +This LibBlockDev library plugin (and, at the same time, a standalone library) +provides functionality related to operations with file systems. -%files -n libbd_fs-devel -%{_libdir}/libbd_fs.so +%ldconfig_scriptlets -n libbd_fs%{soversion} + +%files -n libbd_fs%{soversion} -f fs-plugin.filelist + +%package -n libbd_fs-devel +Summary: Development files for the libbd_fs plugin/library +Group: Development/Libraries/C and C++ +Requires: dosfstools +Requires: glib2-devel +Requires: libbd_fs%{soversion} >= %{version} +Requires: libbd_utils-devel +Requires: xfsprogs +Provides: libblockdev-fs-devel = %{version} + +%description -n libbd_fs-devel +This package contains header files and pkg-config files needed for development +with the libbd_fs plugin/library.. + +%files -n libbd_fs-devel -f fs-plugin-devel.filelist %dir %{_includedir}/blockdev %dir %{_includedir}/blockdev/fs -%{_includedir}/blockdev/fs.h -%{_includedir}/blockdev/fs/ext.h -%{_includedir}/blockdev/fs/generic.h -%{_includedir}/blockdev/fs/mount.h -%{_includedir}/blockdev/fs/ntfs.h -%{_includedir}/blockdev/fs/vfat.h -%{_includedir}/blockdev/fs/xfs.h -%{_includedir}/blockdev/fs/btrfs.h -%{_includedir}/blockdev/fs/exfat.h -%{_includedir}/blockdev/fs/f2fs.h -%{_includedir}/blockdev/fs/nilfs.h -%{_includedir}/blockdev/fs/udf.h +%endif -%files -n libbd_loop%{somajor} -%{_libdir}/libbd_loop.so.%{somajor}* +############################################################################### +# L O O P P L U G I N +############################################################################### -%files -n libbd_loop-devel -%{_libdir}/libbd_loop.so +%if %{with loop_plugin} +%package -n libbd_loop%{soversion} +Summary: The loop plugin for the LibBlockDev library +Group: System/Libraries +Requires: libbd_utils%{soversion} >= %{version} +Provides: libblockdev-loop = %{version} + +%description -n libbd_loop%{soversion} +This LibBlockDev library plugin (and, at the same time, a standalone library) +provides functionality related to loop devices. + +%ldconfig_scriptlets -n libbd_loop%{soversion} + +%files -n libbd_loop%{soversion} -f loop-plugin.filelist + +%package -n libbd_loop-devel +Summary: Development files for the libblockdev-loop plugin/library +Group: Development/Libraries/C and C++ +Requires: glib2-devel +Requires: libbd_loop%{soversion} = %{version} +Requires: libbd_utils-devel >= %{version} +Provides: libblockdev-loop-devel = %{version} + +%description -n libbd_loop-devel +This package contains header files and pkg-config files needed for development +with the libbd_loop plugin/library. + +%files -n libbd_loop-devel -f loop-plugin-devel.filelist %dir %{_includedir}/blockdev -%{_includedir}/blockdev/loop.h +%endif -%files -n libbd_lvm%{somajor} -%{_libdir}/libbd_lvm.so.%{somajor}* +############################################################################### +# L V M P L U G I N +############################################################################### -%files -n libbd_lvm-devel -%{_libdir}/libbd_lvm.so +%if %{with lvm_plugin} +%package -n libbd_lvm%{soversion} +Summary: The LVM plugin for the LibBlockDev library +Group: System/Libraries +Requires: libbd_utils%{soversion} >= %{version} +Requires: lvm2 +# For thin_metadata_size. +Requires: thin-provisioning-tools +Provides: libblockdev-lvm = %{version} + +%description -n libbd_lvm%{soversion} +This LibBlockDev library plugin (and, at the same time, a standalone library) +provides LVM-related functionality. + +%ldconfig_scriptlets -n libbd_lvm%{soversion} + +%files -n libbd_lvm%{soversion} -f lvm-plugin.filelist + +%package -n libbd_lvm-devel +Summary: Development files for the libblockdev-lvm plugin/library +Group: Development/Libraries/C and C++ +Requires: glib2-devel +Requires: libbd_lvm%{soversion} = %{version} +Requires: libbd_utils-devel >= %{version} +Provides: libblockdev-lvm-devel = %{version} + +%description -n libbd_lvm-devel +This package contains header files and pkg-config files needed for development +with the libbd_lvm plugin/library. + +%files -n libbd_lvm-devel -f lvm-plugin-devel.filelist %dir %{_includedir}/blockdev -%{_includedir}/blockdev/lvm.h +%endif -%files -n libbd_lvm-dbus%{somajor} -%dir %{_sysconfdir}/libblockdev -%dir %{_sysconfdir}/libblockdev/%{somajor} -%dir %{_sysconfdir}/libblockdev/%{somajor}/conf.d -%config %{_sysconfdir}/libblockdev/%{somajor}/conf.d/00-default.cfg -%{_libdir}/libbd_lvm-dbus.so.%{somajor}* +############################################################################### +# L V M D B U S P L U G I N +############################################################################### -%files -n libbd_lvm-dbus-devel -%{_libdir}/libbd_lvm-dbus.so +%if %{with lvmdbus_plugin} +%package -n libbd_lvm-dbus%{soversion} +Summary: The LVM plugin for the LibBlockDev library +Group: System/Libraries +Requires: libbd_utils%{soversion} >= %{version} +Requires: lvm2 +# For thin_metadata_size. +Requires: thin-provisioning-tools +Provides: libblockdev-lvm-dbus = %{version} -%files -n libbd_mdraid%{somajor} -%{_libdir}/libbd_mdraid.so.%{somajor}* +%description -n libbd_lvm-dbus%{soversion} +This LibBlockDev library plugin (and, at the same time, a standalone library) +provides LVM-related functionality utilizing the LVM D-Bus API. -%files -n libbd_mdraid-devel -%{_libdir}/libbd_mdraid.so +%ldconfig_scriptlets -n libbd_lvm-dbus%{soversion} + +%files -n libbd_lvm-dbus%{soversion} -f lvm-dbus-plugin.filelist + +%package -n libbd_lvm-dbus-devel +Summary: Development files for the libblockdev-lvm-dbus plugin/library +Group: Development/Libraries/C and C++ +Requires: glib2-devel +Requires: libbd_lvm-dbus%{soversion} = %{version} +Requires: libbd_lvm-devel >= %{version} +Requires: libbd_utils-devel >= %{version} +Provides: libblockdev-lvm-dbus-devel = %{version} + +%description -n libbd_lvm-dbus-devel +This package contains header files and pkg-config files needed for development +with the libbd_lvm-dbus plugin/library. + +%files -n libbd_lvm-dbus-devel -f lvm-dbus-plugin-devel.filelist +%endif + +############################################################################### +# M D R A I D P L U G I N +############################################################################### + +%if %{with mdraid_plugin} +%package -n libbd_mdraid%{soversion} +Summary: The MD RAID plugin for the LibBlockDev library +Group: System/Libraries +Requires: libbd_utils%{soversion} >= %{version} +Requires: mdadm +Provides: libblockdev-mdraid = %{version} + +%description -n libbd_mdraid%{soversion} +This LibBlockDev library plugin (and, at the same time, a standalone library) +provides functionality related to MD RAID. + +%ldconfig_scriptlets -n libbd_mdraid%{soversion} + +%files -n libbd_mdraid%{soversion} -f mdraid-plugin.filelist + +%package -n libbd_mdraid-devel +Summary: Development files for the libblockdev-mdraid plugin/library +Group: Development/Libraries/C and C++ +Requires: glib2-devel +Requires: libbd_mdraid%{soversion} = %{version} +Requires: libbd_utils-devel >= %{version} +Provides: libblockdev-mdraid-devel = %{version} + +%description -n libbd_mdraid-devel +This package contains header files and pkg-config files needed for development +with the libbd_mdraid plugin/library. + +%files -n libbd_mdraid-devel -f mdraid-plugin-devel.filelist %dir %{_includedir}/blockdev -%{_includedir}/blockdev/mdraid.h +%endif -%files -n libbd_mpath%{somajor} -%{_libdir}/libbd_mpath.so.%{somajor}* +############################################################################### +# M U L T I P A T H P L U G I N +############################################################################### -%files -n libbd_mpath-devel -%{_libdir}/libbd_mpath.so +%if %{with mpath_plugin} +%package -n libbd_mpath%{soversion} +Summary: The multipath plugin for the LibBlockDev library +Group: System/Libraries +Requires: libbd_utils%{soversion} >= %{version} +Requires: multipath-tools +Provides: libblockdev-mpath = %{version} + +%description -n libbd_mpath%{soversion} +This LibBlockDev library plugin (and, at the same time, a standalone library) +provides functionality related to multipath devices. + +%ldconfig_scriptlets -n libbd_mpath%{soversion} + +%files -n libbd_mpath%{soversion} -f mpath-plugin.filelist + +%package -n libbd_mpath-devel +Summary: Development files for the libblockdev-mpath plugin/library +Group: Development/Libraries/C and C++ +Requires: glib2-devel +Requires: libbd_mpath%{soversion} = %{version} +Requires: libbd_utils-devel >= %{version} +Provides: libblockdev-mpath-devel = %{version} + +%description -n libbd_mpath-devel +This package contains header files and pkg-config files needed for development +with the libbd_mpath plugin/library. + +%files -n libbd_mpath-devel -f mpath-plugin-devel.filelist %dir %{_includedir}/blockdev -%{_includedir}/blockdev/mpath.h +%endif -%files -n libbd_part%{somajor} -%{_libdir}/libbd_part.so.%{somajor}* +############################################################################### +# N V M E P L U G I N +############################################################################### -%files -n libbd_part-devel -%{_libdir}/libbd_part.so +%if %{with nvme_plugin} +%package -n libbd_nvme%{soversion} +Summary: The NVMe plugin for the LibBlockDev library +Group: System/Libraries +Requires: libbd_utils%{soversion} >= %{version} +Provides: libblockdev-nvme = %{version} + +%description -n libbd_nvme%{soversion} +This LibBlockDev library plugin (and, at the same time, a standalone library) +provides NVMe-related functionality. + +%ldconfig_scriptlets -n libbd_nvme%{soversion} + +%files -n libbd_nvme%{soversion} -f nvme-plugin.filelist + +%package -n libbd_nvme-devel +Summary: Development files for the libblockdev-nvme plugin/library +Group: Development/Libraries/C and C++ +Requires: glib2-devel +Requires: libbd_nvme%{soversion} >= %{version} +Requires: libbd_utils-devel +Provides: libblockdev-nvme-devel = %{version} + +%description -n libbd_nvme-devel +This package contains header files and pkg-config files needed for development +with the libbd_nvme plugin/library. + +%files -n libbd_nvme-devel -f nvme-plugin-devel.filelist %dir %{_includedir}/blockdev -%{_includedir}/blockdev/part.h +%endif -%files -n libbd_swap%{somajor} -%{_libdir}/libbd_swap.so.%{somajor}* +############################################################################### +# P A R T I T I O N I N G P L U G I N +############################################################################### -%files -n libbd_swap-devel -%{_libdir}/libbd_swap.so +%if %{with part_plugin} +%package -n libbd_part%{soversion} +Summary: The partitioning plugin for the LibBlockDev library +Group: System/Libraries +Requires: gptfdisk +Requires: libbd_utils%{soversion} >= %{version} +Requires: util-linux +Provides: libblockdev-part = %{version} + +%description -n libbd_part%{soversion} +This LibBlockDev library plugin (and, at the same time, a standalone library) +provides functionality related to partitioning. + +%ldconfig_scriptlets -n libbd_part%{soversion} + +%files -n libbd_part%{soversion} -f part-plugin.filelist + +%package -n libbd_part-devel +Summary: Development files for the libblockdev-part plugin/library +Group: Development/Libraries/C and C++ +Requires: glib2-devel +Requires: libbd_part%{soversion} = %{version} +Requires: libbd_utils-devel >= %{version} +Provides: libblockdev-part-devel = %{version} + +%description -n libbd_part-devel +This package contains header files and pkg-config files needed for development +with the libbd_part plugin/library. + +%files -n libbd_part-devel -f part-plugin-devel.filelist %dir %{_includedir}/blockdev -%{_includedir}/blockdev/swap.h +%endif -%files -n libbd_utils%{somajor} -%{_libdir}/libbd_utils.so.%{somajor}* +############################################################################### +# S W A P P L U G I N +############################################################################### -%files -n libbd_utils-devel -%{_libdir}/libbd_utils.so +%if %{with swap_plugin} +%package -n libbd_swap%{soversion} +Summary: The swap plugin for the LibBlockDev library +Group: System/Libraries +Requires: libbd_utils%{soversion} >= %{version} +Requires: util-linux +Provides: libblockdev-swap = %{version} + +%description -n libbd_swap%{soversion} +This LibBlockDev library plugin (and, at the same time, a standalone library) +provides functionality related to swap devices. + +%ldconfig_scriptlets -n libbd_swap%{soversion} + +%files -n libbd_swap%{soversion} -f swap-plugin.filelist + +%package -n libbd_swap-devel +Summary: Development files for the libblockdev-swap plugin/library +Group: Development/Libraries/C and C++ +Requires: glib2-devel +Requires: libbd_swap%{soversion} = %{version} +Requires: libbd_utils-devel >= %{version} +Provides: libblockdev-swap-devel = %{version} + +%description -n libbd_swap-devel +This package contains header files and pkg-config files needed for development +with the libbd_swap plugin/library. + +%files -n libbd_swap-devel -f swap-plugin-devel.filelist +%dir %{_includedir}/blockdev +%endif + +############################################################################### +# U T I L I T Y L I B R A R Y +############################################################################### + +%if %{with utils} +%package -n libbd_utils%{soversion} +Summary: Utility functions library for the LibBlockDev library +Group: System/Libraries +Provides: libblockdev-utils = %{version} + +%description -n libbd_utils%{soversion} +This library provides utility functions used by the LibBlockDev library +and its plugins. + +%ldconfig_scriptlets -n libbd_utils%{soversion} + +%files -n libbd_utils%{soversion} -f utils-plugin.filelist + +%package -n libbd_utils-devel +Summary: Development files for libblockdev-utils +Group: Development/Libraries/C and C++ +Requires: glib2-devel +Requires: libbd_utils%{soversion} >= %{version} +Provides: libblockdev-utils-devel = %{version} + +%description -n libbd_utils-devel +This package contains header files and pkg-config files needed for development +with the libbd_utils library. + +%files -n libbd_utils-devel -f utils-plugin-devel.filelist %{_libdir}/pkgconfig/blockdev-utils.pc %dir %{_includedir}/blockdev -%{_includedir}/blockdev/dbus.h -%{_includedir}/blockdev/dev_utils.h -%{_includedir}/blockdev/exec.h -%{_includedir}/blockdev/extra_arg.h -%{_includedir}/blockdev/module.h -%{_includedir}/blockdev/sizes.h -%{_includedir}/blockdev/utils.h +%{_includedir}/blockdev/{dbus,dev_utils,exec,extra_arg,module,sizes}.h +%endif + +############################################################################### + +%prep +%autosetup -p1 +# Place NEWS.rst in the source tree for %%doc'ing it later. +install -m 644 -t . %{SOURCE1} + +%build +# A bit of auto magic for exporting the CC variable when we don't have a +# /usr/bin/cc symlink to a gcc >= 11 +if [ ! -f %{_bindir}/cc ]; then + %define __gcc %(ls -1 %{_bindir}/gcc-[0-9][0-9] | tail -1) + export CC=%{__gcc} +fi +%configure \ + --disable-static \ + --with%{!?with_btrfs_plugin:out}-btrfs \ + --with%{!?with_crypto_plugin:out}-crypto \ + --with%{!?with_dm_plugin:out}-dm \ + --with%{!?with_escrow_plugin:out}-escrow \ + --with%{!?with_fs_plugin:out}-fs \ + --with%{!?with_gtk_doc:out}-gtk-doc \ + --%{?with_gi_bindings:en}%{!?with_gi_bindings:dis}able-introspection \ + --with%{!?with_tools:out}-tools \ + --with%{!?with_nvdimm_plugin:out}-nvdimm \ + --with%{!?with_nvme_plugin:out}-nvme \ + --with%{!?with_loop_plugin:out}-loop \ + --with%{!?with_lvm_plugin:out}-lvm \ + --with%{!?with_lvmdbus_plugin:out}-lvm-dbus \ + --with%{!?with_mdraid_plugin:out}-mdraid \ + --with%{!?with_mpath_plugin:out}-mpath \ + --with%{!?with_part_plugin:out}-part \ + --with%{!?with_swap_plugin:out}-swap \ + ; + +%make_build + +%install +%make_install +find %{buildroot} -name "*.la" -print -type f -delete + +%{?with_btrfs_plugin: %global plugins %{?plugins} btrfs} +%{?with_crypto_plugin: %global plugins %{?plugins} crypto} +%{?with_dm_plugin: %global plugins %{?plugins} dm} +%{?with_escrow_plugin: %global plugins %{?plugins} escrow} +%{?with_fs_plugin: %global plugins %{?plugins} fs} +%{?with_nvdimm_plugin: %global plugins %{?plugins} nvdimm} +%{?with_nvme_plugin: %global plugins %{?plugins} nvme} +%{?with_loop_plugin: %global plugins %{?plugins} loop} +%{?with_lvm_plugin: %global plugins %{?plugins} lvm} +%{?with_lvmdbus_plugin: %global plugins %{?plugins} lvm-dbus} +%{?with_mdraid_plugin: %global plugins %{?plugins} mdraid} +%{?with_mpath_plugin: %global plugins %{?plugins} mpath} +%{?with_part_plugin: %global plugins %{?plugins} part} +%{?with_swap_plugin: %global plugins %{?plugins} swap} +%{?with_utils: %global plugins %{?plugins} utils} + +echo %{?plugins} + +for plugin in %{?plugins}; do + ls -1 %{buildroot}%{_libdir}/libbd_${plugin}.so.%{soversion}* \ + > ${plugin}-plugin.filelist + ls -1 %{buildroot}%{_libdir}/libbd_${plugin}.so \ + > ${plugin}-plugin-devel.filelist + + test "${plugin}" = lvm-dbus && continue + + ls -1 %{buildroot}%{_includedir}/blockdev/${plugin}.h \ + >> ${plugin}-plugin-devel.filelist + + if [ "${plugin}" = fs ]; then + ls -1 %{buildroot}%{_includedir}/blockdev/${plugin}/* \ + >> ${plugin}-plugin-devel.filelist + fi +done + +sed -i -r 's,%{buildroot}(.*),\1,' ./*.filelist %changelog