diff --git a/SOURCES/osinfo-db-20200813-add_almalinux.patch b/SOURCES/osinfo-db-20200813-add_almalinux.patch
new file mode 100644
index 0000000..aeb5674
--- /dev/null
+++ b/SOURCES/osinfo-db-20200813-add_almalinux.patch
@@ -0,0 +1,94 @@
+diff -Naur osinfo-db-20200813.orig/install-script/redhat.com/rhel-kickstart-desktop.xml osinfo-db-20200813.alma/install-script/redhat.com/rhel-kickstart-desktop.xml
+--- osinfo-db-20200813.orig/install-script/redhat.com/rhel-kickstart-desktop.xml 2020-08-13 13:44:02.000000000 +0300
++++ osinfo-db-20200813.alma/install-script/redhat.com/rhel-kickstart-desktop.xml 2021-03-13 14:03:32.081390444 +0300
+@@ -158,6 +158,13 @@
+
+
+
++
++ http://repo.almalinux.org/almalinux/
++
++ /BaseOS/
++
++ /os/
++
+
+
+
+diff -Naur osinfo-db-20200813.orig/install-script/redhat.com/rhel-kickstart-jeos.xml osinfo-db-20200813.alma/install-script/redhat.com/rhel-kickstart-jeos.xml
+--- osinfo-db-20200813.orig/install-script/redhat.com/rhel-kickstart-jeos.xml 2020-08-13 13:44:02.000000000 +0300
++++ osinfo-db-20200813.alma/install-script/redhat.com/rhel-kickstart-jeos.xml 2021-03-13 14:04:23.528039336 +0300
+@@ -138,6 +138,13 @@
+
+
+
++
++ http://repo.almalinux.org/almalinux/
++
++ /BaseOS/
++
++ /os/
++
+
+
+
+diff -Naur osinfo-db-20200813.orig/os/almalinux.org/almalinux-8.xml osinfo-db-20200813.alma/os/almalinux.org/almalinux-8.xml
+--- osinfo-db-20200813.orig/os/almalinux.org/almalinux-8.xml 1970-01-01 03:00:00.000000000 +0300
++++ osinfo-db-20200813.alma/os/almalinux.org/almalinux-8.xml 2021-03-13 16:06:46.622017282 +0300
+@@ -0,0 +1,56 @@
++
++
++
++ almalinux8
++ AlmaLinux 8
++ 8
++ AlmaLinux
++ linux
++ almalinux
++ Purple Manul
++
++ 2021-03-30
++
++
++ LINUX
++ AlmaLinux-8.*-x86_64.*
++
++ isolinux/vmlinuz
++ isolinux/initrd.img
++
++
++ http://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/
++
++ AlmaLinux
++ ^8$
++ x86_64
++
++
++
++
++ AlmaLinux
++ ^8$
++
++
++
++
++ 1
++ 1000000000
++ 1610612736
++ 10737418240
++
++
++ 1000000000
++ 1610612736
++ 21474836480
++
++
++ 3221225472
++
++
++
++
++
++
++
++
diff --git a/SPECS/osinfo-db.spec b/SPECS/osinfo-db.spec
index d26dd88..1c83f99 100644
--- a/SPECS/osinfo-db.spec
+++ b/SPECS/osinfo-db.spec
@@ -1,12 +1,15 @@
# -*- rpm-spec -*-
+%define PatchedSource ../%{name}-%{version}-patched.tar.xz
+
Summary: osinfo database files
Name: osinfo-db
Version: 20210215
-Release: 1%{?dist}
+Release: 1%{?dist}.alma
License: LGPLv2+
Source0: https://fedorahosted.org/releases/l/i/libosinfo/%{name}-%{version}.tar.xz
Source1: https://fedorahosted.org/releases/l/i/libosinfo/%{name}-%{version}.tar.xz.asc
+Patch0: osinfo-db-20200813-add_almalinux.patch
URL: http://libosinfo.org/
BuildRequires: intltool
BuildRequires: osinfo-db-tools
@@ -18,8 +21,23 @@ The osinfo database provides information about operating systems and
hypervisor platforms to facilitate the automated configuration and
provisioning of new virtual machines
+%prep
+%setup
+%patch0 -p1
+
+# Remove spurious leftovers from when applying the patches
+find ../%{name}-%{version}/ -name "*.orig" -exec rm -f {} \;
+
+# For us to be able to apply patches on top of a rebase, we:
+# 1. unpack the sources
+# 2. patch the sources
+# 3. pack the sources in a tarball
+# 4. feed the patched tarball to osinfo-db-import
+%build
+tar -cvJf %{PatchedSource} ../%{name}-%{version}/
+
%install
-osinfo-db-import --root %{buildroot} --dir %{_datadir}/osinfo %{SOURCE0}
+osinfo-db-import --root %{buildroot} --dir %{_datadir}/osinfo %{PatchedSource}
%if 0%{?rhel}
# Remove the upstream virtio-win / spice-guest-tools drivers
find %{buildroot}/%{_datadir}/osinfo/os/microsoft.com/ -name "win-*.d" -type d -exec rm -rf {} +
@@ -37,6 +55,9 @@ find %{buildroot}/%{_datadir}/osinfo/os/microsoft.com/ -name "win-*.d" -type d -
%{_datadir}/osinfo/schema
%changelog
+* Mon Apr 19 2021 Andrew Lukoshko - 20210215-1.alma
+- Add AlmaLinux 8 detection
+
* Mon Feb 15 2021 Fabiano FidĂȘncio - 20210215-1
- Resolves: rhbz#1903300 - rebase osinfo-db to latest fedora