diff --git a/SOURCES/BZ-1645318-gen-repofile-for-any-arch-if-ALL.patch b/SOURCES/BZ-1645318-gen-repofile-for-any-arch-if-ALL.patch
new file mode 100644
index 0000000..dac5251
--- /dev/null
+++ b/SOURCES/BZ-1645318-gen-repofile-for-any-arch-if-ALL.patch
@@ -0,0 +1,25 @@
+commit e215c12da9b74dbe85e2ca6555fd10b5b02778d5
+Author: Pavla Kratochvilova <pkratoch@redhat.com>
+Date:   Wed Mar 20 18:45:16 2019 +0100
+
+    Generate repofile for any architecture if "ALL" is specified (RhBug:1645318)
+    
+    The "arches" array can contain special value "ALL" and in that case any
+    architecture should be accepted.
+    
+    https://bugzilla.redhat.com/show_bug.cgi?id=1645318
+
+diff --git a/rhsm/rhsm-utils.c b/rhsm/rhsm-utils.c
+index 06b12fc..b52a2b8 100644
+--- a/rhsm/rhsm-utils.c
++++ b/rhsm/rhsm-utils.c
+@@ -230,7 +230,8 @@ rhsm_utils_yum_repo_from_context (RHSMContext *ctx)
+           if (json_object_has_member (repo, "arches"))
+             {
+               JsonArray *arr = json_object_get_array_member (repo, "arches");
+-              if (!rhsm_json_array_contains_string (arr, ctx_arch))
++              if (!rhsm_json_array_contains_string (arr, ctx_arch)
++                && !rhsm_json_array_contains_string (arr, "ALL"))
+                 continue;
+             }
+ 
diff --git a/SPECS/librhsm.spec b/SPECS/librhsm.spec
index f838d4a..c448c74 100644
--- a/SPECS/librhsm.spec
+++ b/SPECS/librhsm.spec
@@ -2,13 +2,15 @@
 
 Name:           lib%{libname}
 Version:        0.0.3
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Red Hat Subscription Manager library
 
 License:        LGPLv2+
 URL:            https://github.com/rpm-software-management/librhsm
 Source:         %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
 
+Patch1:         BZ-1645318-gen-repofile-for-any-arch-if-ALL.patch
+
 BuildRequires:  meson >= 0.37.0
 BuildRequires:  gcc
 BuildRequires:  pkgconfig(glib-2.0) >= 2.44
@@ -48,6 +50,10 @@ Requires:       %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
 %{_libdir}/pkgconfig/%{name}.pc
 
 %changelog
+* Wed Mar 27 2019 Michal Domonkos <mdomonko@redhat.com> - 0.0.3-2
+- Generate repofile for any architecture if "ALL" is specified
+- Resolves: bug#1645318
+
 * Mon Jul 09 2018 Igor Gnatenko <ignatenko@redhat.com> - 0.0.3-1
 - Update to 0.0.3