Sync from SUSE:SLFO:Main ldmtool revision 11d565b2dcc21008fb45ad60f2ccd2db

This commit is contained in:
Adrian Schröter 2024-05-03 14:19:05 +02:00
commit ffc3c0df28
5 changed files with 395 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,216 @@
From f97b057e70b66bcf502a4923f64d8b999b5814c3 Mon Sep 17 00:00:00 2001
From: Liang Yan <lyan@suse.com>
Date: Sat, 27 Oct 2018 11:07:10 -0400
Subject: [PATCH] Remove deprecated g_type_class_add_private()
The API has been deprecated, which causes build failures,
use the G_DEFINE_TYPE_WITH_PRIVATE() macro instead.
Signed-off-by: Liang Yan <lyan@suse.com>
---
--- a/src/ldm.c
+++ b/src/ldm.c
@@ -267,15 +267,13 @@ ldm_ ## object ## _get_ ## property(cons
/* LDM */
-#define LDM_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), LDM_TYPE, LDMPrivate))
-
struct _LDMPrivate
{
GArray *disk_groups;
};
-G_DEFINE_TYPE(LDM, ldm, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE(LDM, ldm, G_TYPE_OBJECT)
+
static void
ldm_dispose(GObject * const object)
@@ -290,7 +288,7 @@ ldm_dispose(GObject * const object)
static void
ldm_init(LDM * const o)
{
- o->priv = LDM_GET_PRIVATE(o);
+ o->priv = ldm_get_instance_private(o);
bzero(o->priv, sizeof(*o->priv));
}
@@ -300,14 +298,10 @@ ldm_class_init(LDMClass * const klass)
GObjectClass *object_class = G_OBJECT_CLASS(klass);
object_class->dispose = ldm_dispose;
- g_type_class_add_private(klass, sizeof(LDMPrivate));
}
/* LDMDiskGroup */
-#define LDM_DISK_GROUP_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), LDM_TYPE_DISK_GROUP, LDMDiskGroupPrivate))
-
struct _LDMDiskGroupPrivate
{
uuid_t guid;
@@ -326,7 +320,7 @@ struct _LDMDiskGroupPrivate
GArray *comps;
};
-G_DEFINE_TYPE(LDMDiskGroup, ldm_disk_group, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE(LDMDiskGroup, ldm_disk_group, G_TYPE_OBJECT)
enum {
PROP_LDM_DISK_GROUP_PROP0,
@@ -396,7 +390,6 @@ ldm_disk_group_class_init(LDMDiskGroupCl
object_class->finalize = ldm_disk_group_finalize;
object_class->get_property = ldm_disk_group_get_property;
- g_type_class_add_private(klass, sizeof(LDMDiskGroupPrivate));
/**
* LDMDiskGroup:guid:
@@ -431,7 +424,7 @@ ldm_disk_group_class_init(LDMDiskGroupCl
static void
ldm_disk_group_init(LDMDiskGroup * const o)
{
- o->priv = LDM_DISK_GROUP_GET_PRIVATE(o);
+ o->priv = ldm_disk_group_get_instance_private(o);
bzero(o->priv, sizeof(*o->priv));
}
@@ -457,9 +450,6 @@ ldm_volume_type_get_type(void)
/* LDMVolume */
-#define LDM_VOLUME_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), LDM_TYPE_VOLUME, LDMVolumePrivate))
-
typedef enum {
_VOLUME_TYPE_GEN = 0x3,
_VOLUME_TYPE_RAID5 = 0x4
@@ -491,7 +481,7 @@ struct _LDMVolumePrivate
guint32 _n_comps_i;
};
-G_DEFINE_TYPE(LDMVolume, ldm_volume, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE(LDMVolume, ldm_volume, G_TYPE_OBJECT)
enum {
PROP_LDM_VOLUME_PROP0,
@@ -577,7 +567,6 @@ ldm_volume_class_init(LDMVolumeClass * c
object_class->finalize = ldm_volume_finalize;
object_class->get_property = ldm_volume_get_property;
- g_type_class_add_private(klass, sizeof(LDMVolumePrivate));
/**
* LDMVolume:name:
@@ -677,7 +666,7 @@ ldm_volume_class_init(LDMVolumeClass * c
static void
ldm_volume_init(LDMVolume * const o)
{
- o->priv = LDM_VOLUME_GET_PRIVATE(o);
+ o->priv = ldm_volume_get_instance_private(o);
bzero(o->priv, sizeof(*o->priv));
/* We don't have a trivial way to initialize this array to the correct size
@@ -717,8 +706,6 @@ _cleanup_comp(gpointer const data)
/* LDMPartition */
-#define LDM_PARTITION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), LDM_TYPE_PARTITION, LDMPartitionPrivate))
struct _LDMPartitionPrivate
{
@@ -735,7 +722,7 @@ struct _LDMPartitionPrivate
LDMDisk *disk;
};
-G_DEFINE_TYPE(LDMPartition, ldm_partition, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE(LDMPartition, ldm_partition, G_TYPE_OBJECT)
enum {
PROP_LDM_PARTITION_PROP0,
@@ -796,7 +783,6 @@ ldm_partition_class_init(LDMPartitionCla
object_class->finalize = ldm_partition_finalize;
object_class->get_property = ldm_partition_get_property;
- g_type_class_add_private(klass, sizeof(LDMPartitionPrivate));
/**
* LDMPartition:name:
@@ -846,15 +832,12 @@ ldm_partition_class_init(LDMPartitionCla
static void
ldm_partition_init(LDMPartition * const o)
{
- o->priv = LDM_PARTITION_GET_PRIVATE(o);
+ o->priv = ldm_partition_get_instance_private(o);
bzero(o->priv, sizeof(*o->priv));
}
/* LDMDisk */
-#define LDM_DISK_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), LDM_TYPE_DISK, LDMDiskPrivate))
-
struct _LDMDiskPrivate
{
guint32 id;
@@ -870,7 +853,7 @@ struct _LDMDiskPrivate
gchar *device; // NULL until device is found
};
-G_DEFINE_TYPE(LDMDisk, ldm_disk, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE(LDMDisk, ldm_disk, G_TYPE_OBJECT)
enum {
PROP_LDM_DISK_PROP0,
@@ -948,7 +931,6 @@ ldm_disk_class_init(LDMDiskClass * const
object_class->finalize = ldm_disk_finalize;
object_class->get_property = ldm_disk_get_property;
- g_type_class_add_private(klass, sizeof(LDMDiskPrivate));
/**
* LDMDisk:name:
@@ -1062,7 +1044,7 @@ ldm_disk_class_init(LDMDiskClass * const
static void
ldm_disk_init(LDMDisk * const o)
{
- o->priv = LDM_DISK_GET_PRIVATE(o);
+ o->priv = ldm_disk_get_instance_private(o);
bzero(o->priv, sizeof(*o->priv));
}
@@ -2301,7 +2283,7 @@ error:
}
LDM *
-ldm_new()
+ldm_new(void)
{
LDM *ldm = LDM_CAST(g_object_new(LDM_TYPE, NULL));
ldm->priv->disk_groups = g_array_sized_new(FALSE, FALSE,
--- a/src/ldm.h
+++ b/src/ldm.h
@@ -254,7 +254,7 @@ GType ldm_disk_group_get_type(void);
*
* Returns: (transfer full): a new #LDM object
*/
-LDM *ldm_new();
+LDM *ldm_new(void);
/**
* ldm_add:
--- a/src/ldmtool.c
+++ b/src/ldmtool.c
@@ -783,7 +783,7 @@ main(int argc, char *argv[])
g_type_init();
#endif
- LDM * const ldm = ldm_new(&err);
+ LDM * const ldm = ldm_new();
int ret = 0;

47
ldmtool.changes Normal file
View File

@ -0,0 +1,47 @@
-------------------------------------------------------------------
Tue Jan 5 11:11:11 UTC 2021 - olaf@aepfle.de
- Adjust Remove-deprecated-g_type_class_add_private.patch to fix build
-------------------------------------------------------------------
Tue Feb 25 08:30:24 UTC 2020 - Antoine Ginies <aginies@suse.com>
- update to version 0.2.4
- update patch Remove-deprecated-g_type_class_add_private.patch
- remove upstream merged patches (werror-fixes.patch, cast_be64toh.patch)
- fix buildrequires
- use localsource as the github repo doesnt include yet the built tarball
for 0.2.4 release
-------------------------------------------------------------------
Sat Oct 27 15:29:47 UTC 2018 - Liang Yan <lyan@suse.com>
- fix deprecated api g_type_class_add_private()
- Added patches:
* Remove-deprecated-g_type_class_add_private.patch
-------------------------------------------------------------------
Tue May 30 13:17:35 UTC 2017 - olaf@aepfle.de
- fix double const
-------------------------------------------------------------------
Mon Apr 10 09:49:36 UTC 2017 - cbosdonnat@suse.com
- Fix license files
-------------------------------------------------------------------
Fri Apr 7 16:33:22 UTC 2017 - jengelh@inai.de
- Properly assign RPM group to shlib package
- Replace %soname to %sover to better reflects its intent
- Replace -exec rm by _much simpler_ -delete
- Trim excess whitespace
-------------------------------------------------------------------
Thu Apr 6 08:40:47 UTC 2017 - cbosdonnat@suse.com
- Release 0.2.3
- Added patches:
* werror-fixes.patch
* cast_be64toh.patch

106
ldmtool.spec Normal file
View File

@ -0,0 +1,106 @@
#
# spec file for package ldmtool
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define srcname libldm
%define sover 1_0-0
Name: ldmtool
Version: 0.2.4
Release: 0
Summary: A tool to manage Windows dynamic disks
License: GPL-3.0-only
Group: System/Base
URL: https://github.com/mdbooth/libldm
# Disable until the create a tarball with the 2.4.0 release
#Source0: %{url}/downloads/%{srcname}-%{version}.tar.gz
Source0: %{srcname}-%{version}.tar.gz
Patch0: Remove-deprecated-g_type_class_add_private.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: device-mapper-devel >= 1.0
BuildRequires: glib2-devel >= 2.38.0
BuildRequires: gtk-doc
BuildRequires: json-glib-devel >= 0.14.0
BuildRequires: libtool
BuildRequires: libuuid-devel
BuildRequires: readline-devel
BuildRequires: zlib-devel
Requires: %{srcname}-%{sover} = %{version}-%{release}
%description
Command-line tool for managing Microsoft Windows dynamic disks, which use
Microsoft's LDM metadata. It can inspect them, and also create and remove
device-mapper block devices which can be mounted.
%package -n %{srcname}-%{sover}
Summary: Library to manage Windows dynamic disks
License: LGPL-3.0-only
Group: System/Libraries
%description -n %{srcname}-%{sover}
Library for managing Microsoft Windows dynamic disks, which use Microsoft's
LDM metadata. It can inspect them, and also create and remove device-mapper
block devices which can be mounted.
%package -n %{srcname}-%{sover}-devel
Summary: Development files for %{name}
License: LGPL-3.0-only
Group: Development/Libraries/C and C++
Requires: %{srcname}-%{sover} = %{version}-%{release}
%description -n %{srcname}-%{sover}-devel
Contains libraries and header files for developing applications using
%{srcname}.
%prep
%autosetup -p1 -n %{srcname}-%{version}
%build
gtkdocize
autoreconf -fiv
%configure --disable-static --enable-gtk-doc
%make_build
%install
%make_install
find "%buildroot" -type f -name '*.la' -delete
%post -n %{srcname}-%{sover} -p /sbin/ldconfig
%postun -n %{srcname}-%{sover} -p /sbin/ldconfig
%files
%license COPYING.gpl
%{_bindir}/ldmtool
%{_mandir}/man1/ldmtool.1.gz
%files -n %{srcname}-%{sover}
%license COPYING.lgpl
%{_libdir}/*.so.*
%files -n %{srcname}-%{sover}-devel
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/ldm-1.0.pc
%{_datadir}/gtk-doc
%changelog

BIN
libldm-0.2.4.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.