diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a560613
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+SOURCES/librhsm-0.0.3.tar.gz
diff --git a/.librhsm.metadata b/.librhsm.metadata
new file mode 100644
index 0000000..fdbe51d
--- /dev/null
+++ b/.librhsm.metadata
@@ -0,0 +1 @@
+72963388eece706d328b84070107e20d322cf0e4 SOURCES/librhsm-0.0.3.tar.gz
diff --git a/SOURCES/2.patch b/SOURCES/2.patch
new file mode 100644
index 0000000..972d94b
--- /dev/null
+++ b/SOURCES/2.patch
@@ -0,0 +1,33 @@
+From 1335a0a08399960128192651011c4a3ca6233b32 Mon Sep 17 00:00:00 2001
+From: Daniel Mach <dmach@redhat.com>
+Date: Tue, 13 Nov 2018 12:17:58 +0100
+Subject: [PATCH] Enable repos when generating a .repo file based on
+ entitlement certificate.
+
+Resolves: rhbz#1638850
+---
+ rhsm/rhsm-utils.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/rhsm/rhsm-utils.c b/rhsm/rhsm-utils.c
+index 7b6a26b..021d0d8 100644
+--- a/rhsm/rhsm-utils.c
++++ b/rhsm/rhsm-utils.c
+@@ -246,9 +246,16 @@ rhsm_utils_yum_repo_from_context (RHSMContext *ctx)
+           const gchar *id = json_object_get_string_member (repo, "label");
+           const gchar *name = json_object_get_string_member (repo, "name");
+           const gchar *path = json_object_get_string_member (repo, "path");
+-          gboolean enabled = FALSE;
++
++          /*
++           * The "enabled" option defaults to "true".
++           * If a content (repository) is enabled, the option is missing in the data,
++           * most likely to save limited space in the certificate.
++           */
++          gboolean enabled = TRUE;
+           if (json_object_has_member (repo, "enabled"))
+             enabled = json_object_get_boolean_member (repo, "enabled");
++
+           if (id == NULL || name == NULL || path == NULL)
+             continue; /* TODO: make some error reporting here */
+ 
diff --git a/SPECS/librhsm.spec b/SPECS/librhsm.spec
new file mode 100644
index 0000000..0e5112f
--- /dev/null
+++ b/SPECS/librhsm.spec
@@ -0,0 +1,59 @@
+%global libname rhsm
+
+Name:           lib%{libname}
+Version:        0.0.3
+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
+Patch0:         2.patch
+
+BuildRequires:  meson >= 0.37.0
+BuildRequires:  gcc
+BuildRequires:  pkgconfig(glib-2.0) >= 2.44
+BuildRequires:  pkgconfig(gobject-2.0) >= 2.44
+BuildRequires:  pkgconfig(gio-2.0) >= 2.44
+BuildRequires:  pkgconfig(json-glib-1.0) >= 1.2
+BuildRequires:  pkgconfig(openssl)
+
+%description
+%{summary}.
+
+%package devel
+Summary:        Development libraries and header files for %{name}
+Requires:       %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
+
+%description devel
+%{summary}.
+
+%prep
+%autosetup -p1
+
+%build
+%meson
+%meson_build
+
+%install
+%meson_install
+
+%files
+%license COPYING
+%doc README.md
+%{_libdir}/%{name}.so.*
+
+%files devel
+%{_libdir}/%{name}.so
+%{_includedir}/%{libname}/
+%{_libdir}/pkgconfig/%{name}.pc
+
+%changelog
+* Tue Nov 13 2018 Daniel Mach <dmach@redhat.com> - 0.0.3-2
+- Enable repos when generating a .repo file based on entitlement certificate.
+
+* Mon Jul 09 2018 Igor Gnatenko <ignatenko@redhat.com> - 0.0.3-1
+- Update to 0.0.3
+
+* Thu Feb 22 2018 Igor Gnatenko <ignatenko@redhat.com> - 0.0.2-1
+- Initial release