import RHEL 10 Beta libosinfo-1.11.0-6.el10

This commit is contained in:
eabdullin 2024-11-20 13:22:12 +00:00
parent c790b5cb11
commit 057afdea11
8 changed files with 320 additions and 541 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/libosinfo-1.9.0.tar.xz
libosinfo-1.11.0.tar.xz

View File

@ -1 +0,0 @@
1f928e1412ac29e044e6b02254c9d2b2bf969c31 SOURCES/libosinfo-1.9.0.tar.xz

View File

@ -0,0 +1,31 @@
From 5bbdd06503456784c5ffa22409e8bab50470d673 Mon Sep 17 00:00:00 2001
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 27 Nov 2023 15:11:45 +0100
Subject: [PATCH] osinfo: Make xmlError struct constant in
propagate_libxml_error()
In libxml2 commit v2.12.0~14 the API changed so that
xmlGetLastError() returns pointer to a constant xmlError struct.
Reflect this change in our code.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
osinfo/osinfo_install_script.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c
index 5800f374..303245a1 100644
--- a/osinfo/osinfo_install_script.c
+++ b/osinfo/osinfo_install_script.c
@@ -769,7 +769,7 @@ static void propagate_libxml_error(GError **error, const char *format, ...) G_GN
static void propagate_libxml_error(GError **error, const char *format, ...)
{
- xmlErrorPtr err = xmlGetLastError();
+ const xmlError *err = xmlGetLastError();
char *prefix;
va_list ap;
--
GitLab

View File

@ -1,45 +0,0 @@
From d3b1587f7b77b630bae8ab3f4760eda69bd7fe66 Mon Sep 17 00:00:00 2001
From: Victor Toso <victortoso@redhat.com>
Date: Fri, 26 Nov 2021 17:36:09 +0100
Subject: [PATCH] loader: add check for unknown file type
So we can provide a meaningful error message in case the provided path
is not accessible to running process.
e.g: running HOME=/root osinfo-query os we would get
`Error loading OS data: Unexpected file type`
and now we get
`Error loading OS data: Can't read path /root/.config/osinfo`
This error was first hit with v2v [0] that was leaking $USER and $HOME
of root user when osinfo-query as vsdm user with `sudo -c vdsm`. The
example above is a simple way to show lack of permision of
osinfo-query to read the root's $HOME.
[0] https://bugzilla.redhat.com/show_bug.cgi?id=1901423
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1902720
Signed-off-by: Victor Toso <victortoso@redhat.com>
---
osinfo/osinfo_loader.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index 3f04fa5..96ca6ee 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -2374,6 +2374,11 @@ static void osinfo_loader_find_files(OsinfoLoader *loader,
}
g_object_unref(ents);
g_list_free(children);
+ } else if (type == G_FILE_TYPE_UNKNOWN) {
+ g_autofree gchar *path = g_file_get_path(file);
+ g_autofree gchar *msg = g_strdup_printf("Can't read path %s", path);
+ OSINFO_LOADER_SET_ERROR(&error, msg);
+ g_propagate_error(err, error);
} else {
OSINFO_LOADER_SET_ERROR(&error, "Unexpected file type");
g_propagate_error(err, error);
--
2.33.1

View File

@ -1,220 +0,0 @@
From e5bdc6759195dbcfc4e7dcb02bf59190a3debe06 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Wed, 9 Feb 2022 13:14:54 +0100
Subject: [PATCH] loader: work around lstat()/EACCES regression in
_g_local_file_info_get()
In glib commit 71e7b5800a31 ("Handle MLS selinux policy better",
2010-07-08), which was made for
<https://bugzilla.gnome.org/show_bug.cgi?id=623692>, an lstat() failure
with error code EACCES was *masked* in function _g_local_file_info_get().
Consequently, if osinfo_loader_find_files() calls g_file_query_info() on a
file that is inaccessible due to (e.g.) a missing "x" (search) permission
on a leading directory, then g_file_query_info() succeeds, our
"skipMissing" branch is dead, g_file_info_get_attribute_uint32() is
reached, and it returns G_FILE_TYPE_UNKNOWN.
As a consequence, the outer osinfo_loader_process_default_path() function
can fail, even though it passes skipMissing=TRUE to
osinfo_loader_process_list(). Example:
> $ HOME=/root \
> OSINFO_SYSTEM_DIR=/usr/share/osinfo \
> build/tools/osinfo-query os
> Error loading OS data: Can't read path /root/.config/osinfo
Arguably, this situation should be handled by simply skipping the
inaccessible path, as if all leading directories could be searched, and
only the last pathname compontent (the filename entry) didn't exist in its
direct parent directory.
The glib regression was reported in 2017:
https://bugzilla.gnome.org/show_bug.cgi?id=777187
and then migrated to gitlab:
https://gitlab.gnome.org/GNOME/glib/-/issues/1237
but it's still not solved today.
Work around the issue by honoring "skipMissing" on the G_FILE_TYPE_UNKNOWN
branch. Demonstration:
> $ HOME=/root \
> OSINFO_SYSTEM_DIR=/usr/share/osinfo \
> build/tools/osinfo-query os
>
> ** (osinfo-query:9924): WARNING **: 13:23:12.776: Can't read path /root/.config/osinfo
> Short ID | Name | Version | ID
> ----------------+------------------+---------+----------------------------------------
> alpinelinux3.5 | Alpine Linux 3.5 | 3.5 | http://alpinelinux.org/alpinelinux/3.5
> ...
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2051559
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
osinfo/osinfo_loader.c | 15 ++++++
tests/test-loader.c | 105 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 120 insertions(+)
diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index 96ca6ee..e244b3f 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -2377,6 +2377,21 @@ static void osinfo_loader_find_files(OsinfoLoader *loader,
} else if (type == G_FILE_TYPE_UNKNOWN) {
g_autofree gchar *path = g_file_get_path(file);
g_autofree gchar *msg = g_strdup_printf("Can't read path %s", path);
+ if (skipMissing) {
+ /* This is a work-around for
+ * <https://gitlab.gnome.org/GNOME/glib/-/issues/1237>. If the
+ * lstat() call underlying our g_file_query_info() call at the top
+ * of this function fails for "path" with EACCES, then
+ * g_file_query_info() should fail, and the "skipMissing" branch up
+ * there should suppress the error and return cleanly.
+ * Unfortunately, _g_local_file_info_get() masks the lstat()
+ * failure, g_file_info_get_attribute_uint32() is reached above,
+ * and returns G_FILE_TYPE_UNKNOWN for the file that could never be
+ * accessed. So we need to consider "skipMissing" here too.
+ */
+ g_warning("%s", msg);
+ return;
+ }
OSINFO_LOADER_SET_ERROR(&error, msg);
g_propagate_error(err, error);
} else {
diff --git a/tests/test-loader.c b/tests/test-loader.c
index 6644943..bb86585 100644
--- a/tests/test-loader.c
+++ b/tests/test-loader.c
@@ -16,6 +16,8 @@
*/
#include <osinfo/osinfo.h>
+#include <glib/gstdio.h>
+#include <unistd.h>
static void
test_basic(void)
@@ -31,6 +33,101 @@ test_basic(void)
g_object_unref(loader);
}
+typedef struct {
+ gchar *tmp_parent;
+ gchar *tmp_child;
+ gchar *orig_userdir;
+ gchar *expected_warning;
+} TestEaccesFixture;
+
+static void
+eacces_fixture_setup(TestEaccesFixture *fixture, gconstpointer user_data)
+{
+ gpointer rp;
+ gint ri;
+ gboolean rb;
+
+ /* create a temporary directory with permissions 0700 */
+ fixture->tmp_parent = g_strdup_printf("%s/%s", g_get_tmp_dir(),
+ "test_eacces.XXXXXX");
+ rp = g_mkdtemp_full(fixture->tmp_parent, 0700);
+ g_assert_nonnull(rp);
+
+ /* create a child directory called "osinfo" in it, with permissions 0700 */
+ fixture->tmp_child = g_strdup_printf("%s/osinfo", fixture->tmp_parent);
+ ri = g_mkdir(fixture->tmp_child, 0700);
+ g_assert_cmpint(ri, ==, 0);
+
+ /* revoke the search permission (0100) from the parent */
+ ri = g_chmod(fixture->tmp_parent, 0600);
+ g_assert_cmpint(ri, ==, 0);
+
+ /* stash the current value of OSINFO_USER_DIR */
+ fixture->orig_userdir = g_strdup(g_getenv("OSINFO_USER_DIR"));
+
+ /* point osinfo_loader_get_user_path() inside
+ * osinfo_loader_process_default_path() to the child directory
+ */
+ rb = g_setenv("OSINFO_USER_DIR", fixture->tmp_child, TRUE);
+ g_assert_true(rb);
+
+ /* format the pattern for the warning expected later on */
+ fixture->expected_warning = g_strdup_printf("Can't read path %s",
+ fixture->tmp_child);
+}
+
+static void
+eacces_fixture_teardown(TestEaccesFixture *fixture, gconstpointer user_data)
+{
+ gboolean rb;
+ gint ri;
+
+ /* free the expected warning pattern */
+ g_free(fixture->expected_warning);
+
+ /* restore the OSINFO_USER_DIR variable */
+ if (fixture->orig_userdir) {
+ rb = g_setenv("OSINFO_USER_DIR", fixture->orig_userdir, TRUE);
+ g_assert_true(rb);
+ g_free(fixture->orig_userdir);
+ } else {
+ g_unsetenv("OSINFO_USER_DIR");
+ }
+
+ /* restore search permission on the parent */
+ ri = g_chmod(fixture->tmp_parent, 0700);
+ g_assert_cmpint(ri, ==, 0);
+
+ /* remove both directories */
+ ri = g_rmdir(fixture->tmp_child);
+ g_assert_cmpint(ri, ==, 0);
+ g_free(fixture->tmp_child);
+
+ ri = g_rmdir(fixture->tmp_parent);
+ g_assert_cmpint(ri, ==, 0);
+ g_free(fixture->tmp_parent);
+}
+
+static void
+test_eacces(TestEaccesFixture *fixture, gconstpointer user_data)
+{
+ OsinfoLoader *loader = osinfo_loader_new();
+ GError *error = NULL;
+
+ g_assert_true(OSINFO_IS_LOADER(loader));
+
+ /* this should trigger an EACCES in glib's lstat(), but not break db
+ * loading; also we expect the warning here
+ */
+ g_test_expect_message(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
+ fixture->expected_warning);
+ osinfo_loader_process_default_path(loader, &error);
+ g_assert_no_error(error);
+ g_test_assert_expected_messages();
+
+ g_object_unref(loader);
+}
+
int
main(int argc, char *argv[])
{
@@ -38,6 +135,14 @@ main(int argc, char *argv[])
g_test_add_func("/loader/basic", test_basic);
+ /* the following test depends on a directory with file mode bits 0600 being
+ * unsearchable for the owner, so skip it if the test is running as root
+ */
+ if (geteuid() != 0) {
+ g_test_add("/loader/eacces", TestEaccesFixture, NULL,
+ eacces_fixture_setup, test_eacces, eacces_fixture_teardown);
+ }
+
/* Upfront so we don't confuse valgrind */
osinfo_entity_get_type();
osinfo_db_get_type();
--
2.34.1

View File

@ -1,274 +0,0 @@
# -*- rpm-spec -*-
Summary: A library for managing OS information for virtualization
Name: libosinfo
Version: 1.9.0
Release: 3%{?dist}
License: LGPLv2+
Source: https://releases.pagure.io/%{name}/%{name}-%{version}.tar.xz
URL: https://libosinfo.org/
### Patches ###
Patch0001: 0001-loader-add-check-for-unknown-file-type.patch
Patch0002: 0002-loader-work-around-lstat-EACCES-regression-in-_g_loc.patch
BuildRequires: meson
BuildRequires: gcc
BuildRequires: gtk-doc
BuildRequires: gettext-devel
BuildRequires: glib2-devel
BuildRequires: libxml2-devel >= 2.6.0
BuildRequires: libxslt-devel >= 1.0.0
BuildRequires: libsoup-devel
BuildRequires: vala
BuildRequires: /usr/bin/pod2man
BuildRequires: hwdata
BuildRequires: gobject-introspection-devel
BuildRequires: osinfo-db
BuildRequires: git
Requires: hwdata
Requires: osinfo-db
Requires: osinfo-db-tools
%description
libosinfo is a library that allows virtualization provisioning tools to
determine the optimal device settings for a hypervisor/operating system
combination.
%package devel
Summary: Libraries, includes, etc. to compile with the libosinfo library
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
Requires: glib2-devel
# -vala subpackage removed in F30
Obsoletes: libosinfo-vala < 1.3.0-3
Provides: libosinfo-vala = %{version}-%{release}
%description devel
libosinfo is a library that allows virtualization provisioning tools to
determine the optimal device settings for a hypervisor/operating system
combination.
Libraries, includes, etc. to compile with the libosinfo library
%prep
%autosetup -S git
%build
%meson \
-Denable-gtk-doc=true \
-Denable-tests=true \
-Denable-introspection=enabled \
-Denable-vala=enabled
%meson_build
%install
%meson_install
%find_lang %{name}
%check
%meson_test
%ldconfig_scriptlets
%files -f %{name}.lang
%doc AUTHORS ChangeLog COPYING.LIB NEWS README
%{_bindir}/osinfo-detect
%{_bindir}/osinfo-query
%{_bindir}/osinfo-install-script
%{_mandir}/man1/osinfo-detect.1*
%{_mandir}/man1/osinfo-query.1*
%{_mandir}/man1/osinfo-install-script.1*
%{_libdir}/%{name}-1.0.so.*
%{_libdir}/girepository-1.0/Libosinfo-1.0.typelib
%files devel
%{_libdir}/%{name}-1.0.so
%dir %{_includedir}/%{name}-1.0/
%dir %{_includedir}/%{name}-1.0/osinfo/
%{_includedir}/%{name}-1.0/osinfo/*.h
%{_libdir}/pkgconfig/%{name}-1.0.pc
%{_datadir}/gir-1.0/Libosinfo-1.0.gir
%{_datadir}/gtk-doc/html/Libosinfo
%dir %{_datadir}/vala
%dir %{_datadir}/vala/vapi
%{_datadir}/vala/vapi/libosinfo-1.0.deps
%{_datadir}/vala/vapi/libosinfo-1.0.vapi
%changelog
* Fri Feb 11 2022 Victor Toso <victortoso@redhat.com> - 1.9.0-3
- Resolves: rhbz#2053272
* Thu Dec 16 2021 Victor Toso <victortoso@redhat.com> - 1.9.0-2
- Resolves: rhbz#1902720
* Thu Feb 04 2021 Danilo C. L. de Paula <ddepaula@redhat.com> - 1.9.0-1
- Resolves: rhbz#1903299 - Rebase to latest Fedora
* Sun May 31 2020 Fabiano Fidêncio <fidencio@redhat.com> - 1.8.0-1
- Resolves: rhbz#1815158 - Rebase to libosinfo the latest upstream release
- Resolves: rhbz#1754394 - Provide information about UEFI support for guests (libosinfo)
- Resolves: rhbz#1032520 - WHQL'ed drivers should be made available for Boxes/libosinfo users
* Wed Jul 10 2019 Fabiano Fidêncio <fidencio@redhat.com> - 1.5.0-3
- Resolves: rhbz#1727843 - CVE-2019-13313 libosinfo: osinfo-install-script
option leaks password via command line argument
* Wed May 22 2019 Fabiano Fidêncio <fidencio@redhat.com> - 1.5.0-2
- Resolves: rhbz#1712425 - New defects found in libosinfo-1.5.0-1.el8
* Fri May 10 2019 Fabiano Fidêncio <fidencio@redhat.com> - 1.5.0-1
- Update to 1.5.0 release
- Resolves: rhbz#1699988 - Rebase to the latest upstream release
* Fri Nov 30 2018 Fabiano Fidêncio <fidencio@redhat.com> - 1.2.0-5
- Related: rhbz#1650197 - Fix volume-ids for rhel8.0 entry
* Wed Nov 14 2018 Fabiano Fidêncio <fidencio@redhat.com> - 1.2.0-4
- Resolves: rhbz#1649632 - libosinfo test suite should collect+report all
failures, not exit on first error
* Mon Oct 08 2018 Fabiano Fidêncio <fidencio@redhat.com> - 1.2.0-3
- Related: rhbz#1628027 - Revert ca945cdf04f
* Fri Sep 21 2018 Fabiano Fidêncio <fidencio@redhat.com> - 1.2.0-2
- Resolves: rhbz#1628027 - Force anchored patterns when matching regex
* Wed Jun 20 2018 Daniel P. Berrangé <berrange@redhat.com> - 1.2.0-1
- Update to 1.2.0 release
* Tue Feb 06 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.1.0-2
- Switch to %%ldconfig_scriptlets
* Tue Aug 15 2017 Daniel P. Berrange <berrange@redhat.com> 1.1.0-1
- New upstream release 1.1.0
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Fri Oct 7 2016 Daniel P. Berrange <berrange@redhat.com> 1.0.0-1
- New upstream release 1.0.0
* Fri Jul 1 2016 Daniel P. Berrange <berrange@redhat.com> 0.3.1-1
- New upstream release 0.3.1
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Fri Jan 8 2016 Zeeshan Ali <zeenix@redhat.com> 0.3.0-1
- New upstream release 0.3.0
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Thu May 28 2015 Zeeshan Ali <zeenix@redhat.com> 0.2.12-1
- New upstream release 0.2.12
* Mon Sep 22 2014 Cole Robinson <crobinso@redhat.com> - 0.2.11-2
- os: Add Fedora 21
* Tue Aug 26 2014 Christophe Fergeau <cfergeau@redhat.com> 0.2.11-1
- New upstream release 0.2.11
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.9-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Tue Jul 22 2014 Kalev Lember <kalevlember@gmail.com> - 0.2.9-3
- Rebuilt for gobject-introspection 1.41.4
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed Dec 18 2013 Debarshi Ray <rishi@fedoraproject.org> - 0.2.9-1
- New upstream release 0.2.9
* Thu Nov 28 2013 Zeeshan Ali <zeenix@redhat.com> - 0.2.8-1
- New upstream release 0.2.8
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Tue May 14 2013 Zeeshan Ali <zeenix@redhat.com> - 0.2.7-1
- New upstream release 0.2.7
* Thu Mar 21 2013 Zeeshan Ali <zeenix@redhat.com> - 0.2.6-1
- New upstream release 0.2.6
* Wed Mar 06 2013 Christophe Fergeau <cfergeau@redhat.com> - 0.2.5-2
- BuildRequires /usr/bin/pod2man as this will automatically pick the right
package rather than conditionally requiring a package that is only
available in f19+
- Do not Requires: udev when building libosinfo without its udev rule
(which is done on f19+)
* Tue Mar 05 2013 Christophe Fergeau <cfergeau@redhat.com> 0.2.5-1
- New upstream release 0.2.5
- Disable udev rule as it's no longer required with newer
systemd/util-linux
* Tue Feb 12 2013 Cole Robinson <crobinso@redhat.com> - 0.2.3-2
- Fix osinfo-detect crash with non-bootable media (bz #901910)
* Mon Jan 14 2013 Zeeshan Ali <zeenix@redhat.com> - 0.2.3-1
- New upstream release 0.2.3
* Thu Dec 20 2012 Christophe Fergeau <cfergeau@redhat.com> - 0.2.2-1
- New upstream release 0.2.2
* Fri Oct 12 2012 Zeeshan Ali <zeenix@redhat.com> - 0.2.1-1
- Fix and simplify udev rule.
- Fedora:
- Fix minimum RAM requirements for F16 and F17.
- Add data on:
- Fedora 18
- GNOME 3.6
- Ubuntu 12.10
- Fixes to doc build.
- Install script:
- Add get_config_param method.
- Differenciate between expected/output script names.
- Add more utility functions.
- Add 'installer-reboots' parameter to medias.
- osinfo-detect does not die of DB loading errors anymore.
- More type-specific entity value getters/setters.
- Fixe and update RNG file.
- Add 'subsystem' property/attribute to devices.
* Mon Sep 03 2012 Christophe Fergeau <cfergeau@redhat.com> - 0.2.0-1
- Update to 0.2.0 release.
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Tue Jun 12 2012 Zeeshan Ali <zeenix@redhat.com> - 0.1.2-1
- Update to 0.1.2 release.
* Thu Apr 12 2012 Zeeshan Ali <zeenix@redhat.com> - 0.1.1-1
- Update to 0.1.1 release.
* Wed Mar 14 2012 Daniel P. Berrange <berrange@redhat.com> - 0.1.0-2
- Remove obsolete perl based scripts (rhbz #803086)
* Wed Feb 08 2012 Christophe Fergeau <cfergeau@redhat.com> - 0.1.0-1
- Update to 0.1.0 release
* Tue Jan 17 2012 Zeeshan Ali <zeenix@redhat.com> - 0.0.5-1
- Update to 0.0.5 release
* Tue Jan 3 2012 Daniel P. Berrange <berrange@redhat.com> - 0.0.4-2
- Remove pointless gir conditionals
* Wed Dec 21 2011 Daniel P. Berrange <berrange@redhat.com> - 0.0.4-1
- Update to 0.0.4 release
* Thu Nov 24 2011 Daniel P. Berrange <berrange@redhat.com> - 0.0.2-1
- Initial package

287
libosinfo.spec Normal file
View File

@ -0,0 +1,287 @@
## START: Set by rpmautospec
## (rpmautospec version 0.6.1)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 6;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
# -*- rpm-spec -*-
%define with_mingw 0
%if 0%{?fedora}
%define with_mingw 0%{!?_without_mingw:1}
%endif
Summary: A library for managing OS information for virtualization
Name: libosinfo
Version: 1.11.0
Release: %autorelease
License: LGPL-2.1-or-later
Source: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.xz
URL: https://libosinfo.org/
### Patches ###
# Fix build with libxml2-2.12.0
# https://gitlab.com/libosinfo/libosinfo/-/merge_requests/155
Patch: 0001-osinfo-Make-xmlError-struct-constant.patch
BuildRequires: meson
BuildRequires: gcc
BuildRequires: gtk-doc
BuildRequires: gettext-devel
BuildRequires: glib2-devel
BuildRequires: libxml2-devel >= 2.6.0
BuildRequires: libxslt-devel >= 1.0.0
%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10
BuildRequires: libsoup3-devel
%else
BuildRequires: libsoup-devel
%endif
BuildRequires: vala
BuildRequires: /usr/bin/pod2man
BuildRequires: hwdata
BuildRequires: gobject-introspection-devel
BuildRequires: osinfo-db
BuildRequires: git
Requires: hwdata
Requires: osinfo-db
Requires: osinfo-db-tools
%if %{with_mingw}
BuildRequires: mingw32-filesystem
BuildRequires: mingw32-gcc
BuildRequires: mingw32-binutils
BuildRequires: mingw32-glib2
BuildRequires: mingw32-libxml2
BuildRequires: mingw32-libxslt
BuildRequires: mingw32-libsoup
BuildRequires: mingw64-filesystem
BuildRequires: mingw64-gcc
BuildRequires: mingw64-binutils
BuildRequires: mingw64-glib2
BuildRequires: mingw64-libxml2
BuildRequires: mingw64-libxslt
BuildRequires: mingw64-libsoup
%endif
%description
libosinfo is a library that allows virtualization provisioning tools to
determine the optimal device settings for a hypervisor/operating system
combination.
%package devel
Summary: Libraries, includes, etc. to compile with the libosinfo library
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
Requires: glib2-devel
# -vala subpackage removed in F30
Obsoletes: libosinfo-vala < 1.3.0-3
Provides: libosinfo-vala = %{version}-%{release}
%description devel
libosinfo is a library that allows virtualization provisioning tools to
determine the optimal device settings for a hypervisor/operating system
combination.
Libraries, includes, etc. to compile with the libosinfo library
%if %{with_mingw}
%package -n mingw32-libosinfo
Summary: %{summary}
BuildArch: noarch
Requires: pkgconfig
Requires: mingw32-osinfo-db
Requires: mingw32-osinfo-db-tools
%description -n mingw32-libosinfo
libosinfo is a library that allows virtualization provisioning tools to
determine the optimal device settings for a hypervisor/operating system
combination.
%package -n mingw64-libosinfo
Summary: %{summary}
BuildArch: noarch
Requires: pkgconfig
Requires: mingw64-osinfo-db
Requires: mingw64-osinfo-db-tools
%description -n mingw64-libosinfo
libosinfo is a library that allows virtualization provisioning tools to
determine the optimal device settings for a hypervisor/operating system
combination.
%{?mingw_debug_package}
%endif
%prep
%autosetup -S git
%build
%meson \
-Denable-gtk-doc=true \
-Denable-tests=true \
-Denable-introspection=enabled \
-Denable-vala=enabled
%meson_build
%if %{with_mingw}
%mingw_meson \
-Denable-gtk-doc=false \
-Denable-tests=false \
-Denable-introspection=disabled \
-Denable-vala=disabled
%mingw_ninja
%endif
%install
%meson_install
%find_lang %{name}
%if %{with_mingw}
%mingw_ninja_install
# Remove static libraries but DON'T remove *.dll.a files.
rm -f $RPM_BUILD_ROOT%{mingw32_libdir}/libosinfo-1.0.a
rm -f $RPM_BUILD_ROOT%{mingw64_libdir}/libosinfo-1.0.a
# Libtool files don't need to be bundled
find $RPM_BUILD_ROOT -name "*.la" -delete
# Manpages don't need to be bundled
rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/man
rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/man
rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/gtk-doc
rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/gtk-doc
%mingw_debug_install_post
%mingw_find_lang libosinfo
%endif
%check
%meson_test
%ldconfig_scriptlets
%files -f %{name}.lang
%doc AUTHORS ChangeLog COPYING.LIB NEWS README
%{_bindir}/osinfo-detect
%{_bindir}/osinfo-query
%{_bindir}/osinfo-install-script
%{_mandir}/man1/osinfo-detect.1*
%{_mandir}/man1/osinfo-query.1*
%{_mandir}/man1/osinfo-install-script.1*
%{_libdir}/%{name}-1.0.so.*
%{_libdir}/girepository-1.0/Libosinfo-1.0.typelib
%files devel
%{_libdir}/%{name}-1.0.so
%dir %{_includedir}/%{name}-1.0/
%dir %{_includedir}/%{name}-1.0/osinfo/
%{_includedir}/%{name}-1.0/osinfo/*.h
%{_libdir}/pkgconfig/%{name}-1.0.pc
%{_datadir}/gir-1.0/Libosinfo-1.0.gir
%{_datadir}/gtk-doc/html/Libosinfo
%dir %{_datadir}/vala
%dir %{_datadir}/vala/vapi
%{_datadir}/vala/vapi/libosinfo-1.0.deps
%{_datadir}/vala/vapi/libosinfo-1.0.vapi
%if %{with_mingw}
%files -n mingw32-libosinfo -f mingw32-libosinfo.lang
%doc AUTHORS ChangeLog COPYING.LIB NEWS README
%{mingw32_bindir}/osinfo-detect.exe
%{mingw32_bindir}/osinfo-install-script.exe
%{mingw32_bindir}/osinfo-query.exe
%{mingw32_bindir}/libosinfo-1.0-0.dll
%{mingw32_libdir}/libosinfo-1.0.dll.a
%{mingw32_libdir}/pkgconfig/libosinfo-1.0.pc
%dir %{mingw32_includedir}/libosinfo-1.0/
%dir %{mingw32_includedir}/libosinfo-1.0/osinfo
%{mingw32_includedir}/libosinfo-1.0/osinfo/*.h
%dir %{mingw32_datadir}/libosinfo
%{mingw32_datadir}/libosinfo/usb.ids
%{mingw32_datadir}/libosinfo/pci.ids
%files -n mingw64-libosinfo -f mingw64-libosinfo.lang
%doc AUTHORS ChangeLog COPYING.LIB NEWS README
%{mingw64_bindir}/osinfo-detect.exe
%{mingw64_bindir}/osinfo-install-script.exe
%{mingw64_bindir}/osinfo-query.exe
%{mingw64_bindir}/libosinfo-1.0-0.dll
%{mingw64_libdir}/libosinfo-1.0.dll.a
%{mingw64_libdir}/pkgconfig/libosinfo-1.0.pc
%dir %{mingw64_includedir}/libosinfo-1.0/
%dir %{mingw64_includedir}/libosinfo-1.0/osinfo
%{mingw64_includedir}/libosinfo-1.0/osinfo/*.h
%dir %{mingw64_datadir}/libosinfo
%{mingw64_datadir}/libosinfo/usb.ids
%{mingw64_datadir}/libosinfo/pci.ids
%endif
%changelog
## START: Generated by rpmautospec
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.11.0-6
- Bump release for June 2024 mass rebuild
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Dec 13 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 1.11.0-3
- Fix build with libxml2-2.12.0
* Wed Dec 13 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 1.11.0-2
- Fix rpmautospec changelog
* Fri Oct 27 2023 Victor Toso <victortoso@redhat.com> - 1.11.0-1
- Update to release v1.11.0
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Feb 09 2023 Michael Catanzaro <mcatanzaro@redhat.com> - 1.10.0-6
- Use libsoup 3 in ELN
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Aug 8 2022 Daniel P. Berrangé <berrange@redhat.com> - 1.10.0-4
- Pull in mingw sub-packages
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Tue Jul 19 2022 Daniel P. Berrangé <berrange@redhat.com> - 1.10.0-2
- Switch from libsoup2 to libsoup3 (rhbz #2108589)
* Mon Feb 14 2022 Victor Toso <victortoso@redhat.com> - 1.10.0-1
- Update to 1.10.0 release
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Tue Jan 11 2022 Cole Robinson <crobinso@redhat.com> - 1.9.0-3
- Fix build with glib 2.70
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Feb 03 2021 Fabiano Fidêncio <fidencio@redhat.com> - 1.9.0-1
- Update to 1.9.0 release
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
## END: Generated by rpmautospec

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (libosinfo-1.11.0.tar.xz) = d1b527cc50eaa92e143f068d9a484a1e591dafb77e65e0172e43d6d6440970c5c3b4e2d65050fd0d64f39d1163d49b339ae6d75943306917b4b367c26a938fb6