Blame SOURCES/subscription-manager-1.15.9-3-to-subscription-manager-1.15.9-4.patch

d88f46
diff --git a/Makefile b/Makefile
d88f46
index 12b891e..fb0d2eb 100644
d88f46
--- a/Makefile
d88f46
+++ b/Makefile
d88f46
@@ -307,6 +307,7 @@ install-ui:
d88f46
 install-gui: install-glade install-ui
d88f46
 
d88f46
 install-files: set-versions dbus-service-install desktop-files install-plugins install-post-boot install-ga install-gui
d88f46
+	install -d $(PYTHON_INST_DIR)/api
d88f46
 	install -d $(PYTHON_INST_DIR)/gui
d88f46
 	install -d $(PYTHON_INST_DIR)/gui/data/icons
d88f46
 	install -d $(PYTHON_INST_DIR)/branding
d88f46
@@ -356,6 +357,7 @@ install-files: set-versions dbus-service-install desktop-files install-plugins i
d88f46
 
d88f46
 
d88f46
 	install -m 644 -p $(SRC_DIR)/*.py $(PYTHON_INST_DIR)/
d88f46
+	install -m 644 -p $(SRC_DIR)/api/*.py $(PYTHON_INST_DIR)/api
d88f46
 	install -m 644 -p $(SRC_DIR)/gui/*.py $(PYTHON_INST_DIR)/gui
d88f46
 	install -m 644 -p $(SRC_DIR)/migrate/*.py $(PYTHON_INST_DIR)/migrate
d88f46
 	install -m 644 -p $(SRC_DIR)/branding/*.py $(PYTHON_INST_DIR)/branding
d88f46
diff --git a/rel-eng/packages/subscription-manager b/rel-eng/packages/subscription-manager
d88f46
index c569df4..b7ea50a 100644
d88f46
--- a/rel-eng/packages/subscription-manager
d88f46
+++ b/rel-eng/packages/subscription-manager
d88f46
@@ -1 +1 @@
d88f46
-1.15.9-3 ./
d88f46
+1.15.9-4 ./
d88f46
diff --git a/setup.py b/setup.py
d88f46
index ebac808..b27670b 100644
d88f46
--- a/setup.py
d88f46
+++ b/setup.py
d88f46
@@ -23,6 +23,7 @@ setup(name="subscription-manager",
d88f46
       author="Adrian Likins",
d88f46
       author_email="alikins@redhat.com",
d88f46
       packages=['src/subscription_manager',
d88f46
+                'src/subscription_manager/api',
d88f46
                 'src/subscription_manager/gui',
d88f46
                 'src/subscription_manager/plugin',
d88f46
                 'src/subscription_manager/plugin/ostree',
d88f46
diff --git a/src/initial-setup/com_redhat_subscription_manager/gui/spokes/rhsm_gui.py b/src/initial-setup/com_redhat_subscription_manager/gui/spokes/rhsm_gui.py
d88f46
index 73cb2ca..09ca0b6 100644
d88f46
--- a/src/initial-setup/com_redhat_subscription_manager/gui/spokes/rhsm_gui.py
d88f46
+++ b/src/initial-setup/com_redhat_subscription_manager/gui/spokes/rhsm_gui.py
d88f46
@@ -22,7 +22,6 @@ import sys
d88f46
 from pyanaconda.ui.gui.spokes import NormalSpoke
d88f46
 from pyanaconda.ui.common import FirstbootOnlySpokeMixIn
d88f46
 from pyanaconda.ui.categories.system import SystemCategory
d88f46
-from pyanaconda.ui.gui import GUIObject
d88f46
 
d88f46
 log = logging.getLogger(__name__)
d88f46
 
d88f46
@@ -81,6 +80,8 @@ class RHSMSpoke(FirstbootOnlySpokeMixIn, NormalSpoke):
d88f46
         # each attaching different handlers.
d88f46
         self._registergui.close_window_callback = self._close_window_callback
d88f46
 
d88f46
+        self._registergui._error_screen = registergui.CHOOSE_SERVER_PAGE
d88f46
+
d88f46
         # we have a ref to _register_box, but need to remove it from
d88f46
         # the regustergui.window (a GtkDialog), and add it to the main
d88f46
         # box in the action area of our initial-setup screen.
d88f46
@@ -91,10 +92,12 @@ class RHSMSpoke(FirstbootOnlySpokeMixIn, NormalSpoke):
d88f46
         self._registergui.initialize()
d88f46
 
d88f46
     def _close_window_callback(self):
d88f46
-        pass
d88f46
+        self._registergui.goto_error_screen()
d88f46
 
d88f46
     def finished(self):
d88f46
         self._registergui.done()
d88f46
+        self._registergui.cancel_button.hide()
d88f46
+        self._registergui.register_button.hide()
d88f46
         self._done = True
d88f46
 
d88f46
     # Update gui widgets to reflect state of self.data
d88f46
diff --git a/src/subscription_manager/async.py b/src/subscription_manager/async.py
d88f46
index 05433f9..41a9aab 100644
d88f46
--- a/src/subscription_manager/async.py
d88f46
+++ b/src/subscription_manager/async.py
d88f46
@@ -61,7 +61,7 @@ class AsyncPool(object):
d88f46
         Run pool stash refresh asynchronously.
d88f46
         """
d88f46
         ga_GObject.idle_add(self._watch_thread)
d88f46
-        threading.Thread(target=self._run_refresh,
d88f46
+        threading.Thread(target=self._run_refresh, name="AsyncPoolRefreshThread",
d88f46
                 args=(active_on, callback, data)).start()
d88f46
 
d88f46
 
d88f46
@@ -105,11 +105,11 @@ class AsyncBind(object):
d88f46
             ga_GObject.idle_add(except_callback, e, selection)
d88f46
 
d88f46
     def bind(self, pool, quantity, except_callback, bind_callback=None, cert_callback=None):
d88f46
-        threading.Thread(target=self._run_bind,
d88f46
+        threading.Thread(target=self._run_bind, name="AsyncBindBindThread",
d88f46
                 args=(pool, quantity, bind_callback, cert_callback, except_callback)).start()
d88f46
 
d88f46
     def unbind(self, serial, selection, callback, except_callback):
d88f46
-        threading.Thread(target=self._run_unbind,
d88f46
+        threading.Thread(target=self._run_unbind, name="AsyncBindUnbindThread",
d88f46
                 args=(serial, selection, callback, except_callback)).start()
d88f46
 
d88f46
 
d88f46
@@ -177,10 +177,13 @@ class AsyncRepoOverridesUpdate(object):
d88f46
         ga_GObject.idle_add(callback, *args)
d88f46
 
d88f46
     def load_data(self, success_callback, failure_callback):
d88f46
-        threading.Thread(target=self._load_data, args=(success_callback, failure_callback)).start()
d88f46
+        threading.Thread(target=self._load_data, name="AsyncRepoOverridesUpdateLoadDataThread",
d88f46
+                         args=(success_callback, failure_callback)).start()
d88f46
 
d88f46
     def update_overrides(self, to_add, to_remove, success_callback, except_callback):
d88f46
-        threading.Thread(target=self._update, args=(to_add, to_remove, success_callback, except_callback)).start()
d88f46
+        threading.Thread(target=self._update, name="AsyncRepoOverridesUpdateUpdateOverridesThread",
d88f46
+                         args=(to_add, to_remove, success_callback, except_callback)).start()
d88f46
 
d88f46
     def remove_all_overrides(self, repo_ids, success_callback, except_callback):
d88f46
-        threading.Thread(target=self._remove_all, args=(repo_ids, success_callback, except_callback)).start()
d88f46
+        threading.Thread(target=self._remove_all, name="AsyncRepoOverridesUpdateRemoveAllOverridesThread",
d88f46
+                         args=(repo_ids, success_callback, except_callback)).start()
d88f46
diff --git a/src/subscription_manager/ga_loader.py b/src/subscription_manager/ga_loader.py
d88f46
index 59a00f6..1d7912e 100644
d88f46
--- a/src/subscription_manager/ga_loader.py
d88f46
+++ b/src/subscription_manager/ga_loader.py
d88f46
@@ -94,9 +94,6 @@ class GaImporter(object):
d88f46
         return None
d88f46
 
d88f46
     def load_module(self, fullname):
d88f46
-        log.debug("ga_loader class %s loading virtual module %s from %s",
d88f46
-                  self.__class__.__name__,
d88f46
-                  fullname, self.virtual_modules[fullname])
d88f46
         if fullname in sys.modules:
d88f46
             return sys.modules[fullname]
d88f46
 
d88f46
@@ -150,14 +147,6 @@ class GaImporter(object):
d88f46
         """
d88f46
         return self._new_module(self.namespace)
d88f46
 
d88f46
-    def _dirprint(self, module):
d88f46
-        return
d88f46
-        print "module ", module, type(module)
d88f46
-        for i in dir(module):
d88f46
-            if i == "__builtins__":
d88f46
-                continue
d88f46
-            print "\t%s = %s" % (i, getattr(module, i))
d88f46
-
d88f46
 
d88f46
 class GaImporterGtk3(GaImporter):
d88f46
     virtual_modules = {'subscription_manager.ga': None,
d88f46
diff --git a/src/subscription_manager/gui/allsubs.py b/src/subscription_manager/gui/allsubs.py
d88f46
index fe27082..5d6d7af 100644
d88f46
--- a/src/subscription_manager/gui/allsubs.py
d88f46
+++ b/src/subscription_manager/gui/allsubs.py
d88f46
@@ -363,9 +363,7 @@ class AllSubscriptionsTab(widgets.SubscriptionManagerTab):
d88f46
                 # show pulsating progress bar while we wait for results
d88f46
                 self.pb = progress.Progress(pb_title, pb_label)
d88f46
                 self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
d88f46
-                tl = self.content.get_toplevel()
d88f46
-                if tl.is_toplevel():
d88f46
-                    self.pb.set_parent_window(tl)
d88f46
+                self.pb.set_transient_for(self.parent_win)
d88f46
 
d88f46
             # fire off async refresh
d88f46
             async_stash = async.AsyncPool(self.pool_stash)
d88f46
@@ -410,11 +408,7 @@ class AllSubscriptionsTab(widgets.SubscriptionManagerTab):
d88f46
         self.pb = progress.Progress(_("Attaching"),
d88f46
                 _("Attaching subscription. Please wait."))
d88f46
         self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
d88f46
-        content_toplevel = self.content.get_toplevel()
d88f46
-        # get_toplevel() can return a GtkWindow that is within another
d88f46
-        # GtkWindow. See the get_toplevel() gtk docs
d88f46
-        if content_toplevel.is_toplevel():
d88f46
-            self.pb.set_parent_window(content_toplevel)
d88f46
+        self.pb.set_transient_for(self.parent_win)
d88f46
         # Spin off a thread to handle binding the selected pool.
d88f46
         # After it has completed the actual bind call, available
d88f46
         # subs will be refreshed, but we won't re-run compliance
d88f46
@@ -451,10 +445,7 @@ class AllSubscriptionsTab(widgets.SubscriptionManagerTab):
d88f46
         self.contract_selection = ContractSelectionWindow(
d88f46
                 self._contract_selected, self._contract_selection_cancelled)
d88f46
 
d88f46
-        content_toplevel = self.content.get_toplevel()
d88f46
-        self.log.debug("content_toplevel %s", content_toplevel)
d88f46
-        if content_toplevel.is_toplevel():
d88f46
-            self.contract_selection.set_parent_window(content_toplevel)
d88f46
+        self.contract_selection.set_parent_window(self.parent_win)
d88f46
         #self.log.debug("user_data %s", pw.get_user_data())
d88f46
         merged_pools.sort_virt_to_top()
d88f46
 
d88f46
diff --git a/src/subscription_manager/gui/contract_selection.py b/src/subscription_manager/gui/contract_selection.py
d88f46
index 70233d2..9c5572e 100644
d88f46
--- a/src/subscription_manager/gui/contract_selection.py
d88f46
+++ b/src/subscription_manager/gui/contract_selection.py
d88f46
@@ -168,14 +168,6 @@ class ContractSelectionWindow(widgets.SubmanBaseWidget):
d88f46
             'quantity_increment': quantity_increment,
d88f46
             })
d88f46
 
d88f46
-    def toplevel(self):
d88f46
-        tl = self.get_toplevel()
d88f46
-        if tl.is_toplevel():
d88f46
-            return tl
d88f46
-        else:
d88f46
-            self.log.debug("no toplevel window?")
d88f46
-            return None
d88f46
-
d88f46
     def set_parent_window(self, window):
d88f46
         self.log.debug('window %s', window)
d88f46
         self.contract_selection_window.set_transient_for(window)
d88f46
diff --git a/src/subscription_manager/gui/firstboot/rhsm_login.py b/src/subscription_manager/gui/firstboot/rhsm_login.py
d88f46
index 791607d..7c06f19 100644
d88f46
--- a/src/subscription_manager/gui/firstboot/rhsm_login.py
d88f46
+++ b/src/subscription_manager/gui/firstboot/rhsm_login.py
d88f46
@@ -255,6 +255,7 @@ class moduleClass(RhsmFirstbootModule, registergui.RegisterScreen):
d88f46
         else:
d88f46
             return registergui.CHOOSE_SERVER_PAGE
d88f46
 
d88f46
+    @property
d88f46
     def error_screen(self):
d88f46
         return self._get_initial_screen()
d88f46
 
d88f46
diff --git a/src/subscription_manager/gui/mysubstab.py b/src/subscription_manager/gui/mysubstab.py
d88f46
index 4c5922d..adc471c 100644
d88f46
--- a/src/subscription_manager/gui/mysubstab.py
d88f46
+++ b/src/subscription_manager/gui/mysubstab.py
d88f46
@@ -146,9 +146,7 @@ class MySubscriptionsTab(widgets.SubscriptionManagerTab):
d88f46
             self.pb = progress.Progress(_("Removing"),
d88f46
                     _("Removing subscription. Please wait."))
d88f46
             self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
d88f46
-            content_toplevel = self.content.get_toplevel()
d88f46
-            if content_toplevel.is_toplevel():
d88f46
-                self.pb.set_parent_window(content_toplevel)
d88f46
+            self.pb.set_transient_for(self.parent_win)
d88f46
             self.async_bind.unbind(serial, selection, self._unsubscribe_callback, self._handle_unbind_exception)
d88f46
         else:
d88f46
             # unregistered, just delete the certs directly
d88f46
diff --git a/src/subscription_manager/gui/networkConfig.py b/src/subscription_manager/gui/networkConfig.py
d88f46
index 503839b..7efd0b1 100644
d88f46
--- a/src/subscription_manager/gui/networkConfig.py
d88f46
+++ b/src/subscription_manager/gui/networkConfig.py
d88f46
@@ -264,7 +264,7 @@ class NetworkConfigDialog(widgets.SubmanBaseWidget):
d88f46
         self._display_progress_bar()
d88f46
         threading.Thread(target=self.test_connection_wrapper,
d88f46
                          args=(proxy_host, proxy_port, proxy_user, proxy_password),
d88f46
-                         name='test_connection_thread').start()
d88f46
+                         name='TestNetworkConnectionThread').start()
d88f46
 
d88f46
     def deleted(self, event, data):
d88f46
         self.write_values()
d88f46
@@ -279,7 +279,7 @@ class NetworkConfigDialog(widgets.SubmanBaseWidget):
d88f46
         else:
d88f46
             self.progress_bar = progress.Progress(_("Testing Connection"), _("Please wait"))
d88f46
             self.timer = ga_GObject.timeout_add(100, self.progress_bar.pulse)
d88f46
-            self.progress_bar.set_parent_window(self.networkConfigDialog)
d88f46
+            self.progress_bar.set_transient_for(self.networkConfigDialog)
d88f46
 
d88f46
     def _clear_progress_bar(self):
d88f46
         if not self.progress_bar:  # progress bar could be none iff self.test_connection is called directly
d88f46
diff --git a/src/subscription_manager/gui/progress.py b/src/subscription_manager/gui/progress.py
d88f46
index 61b2b2d..5aa938e 100644
d88f46
--- a/src/subscription_manager/gui/progress.py
d88f46
+++ b/src/subscription_manager/gui/progress.py
d88f46
@@ -75,7 +75,7 @@ class Progress(widgets.SubmanBaseWidget):
d88f46
     def set_status_label(self, text):
d88f46
         self.statusLabel.set_text(text)
d88f46
 
d88f46
-    def set_parent_window(self, window):
d88f46
+    def set_transient_for(self, window):
d88f46
         self.progressWindow.set_transient_for(window)
d88f46
 
d88f46
     def _on_delete_event(self, widget, event):
d88f46
diff --git a/src/subscription_manager/gui/registergui.py b/src/subscription_manager/gui/registergui.py
d88f46
index c56ec5b..123c783 100644
d88f46
--- a/src/subscription_manager/gui/registergui.py
d88f46
+++ b/src/subscription_manager/gui/registergui.py
d88f46
@@ -294,6 +294,7 @@ class RegisterScreen(widgets.SubmanBaseWidget):
d88f46
                         screen.container, tab_label=None)
d88f46
 
d88f46
         self._current_screen = CHOOSE_SERVER_PAGE
d88f46
+        self._error_screen = DONT_CHANGE
d88f46
 
d88f46
         # values that will be set by the screens
d88f46
         self.username = None
d88f46
@@ -337,15 +338,24 @@ class RegisterScreen(widgets.SubmanBaseWidget):
d88f46
     # for subman gui, we don't need to switch screens on error
d88f46
     # but for firstboot, we will go back to the info screen if
d88f46
     # we have it.
d88f46
+    @property
d88f46
     def error_screen(self):
d88f46
-        return DONT_CHANGE
d88f46
+        return self._error_screen
d88f46
+
d88f46
+    def goto_error_screen(self):
d88f46
+        self._set_navigation_sensitive(True)
d88f46
+        self._set_screen(self.error_screen)
d88f46
 
d88f46
     # FIXME: This exists because standalone gui needs to update the nav
d88f46
     #        buttons in it's own top level window, while firstboot needs to
d88f46
     #        update the buttons in the main firstboot window. Firstboot version
d88f46
     #        has additional logic for rhel5/rhel6 differences.
d88f46
+    # FIXME: just split this into a registerWidget and a registerDialog
d88f46
     def _set_navigation_sensitive(self, sensitive):
d88f46
-        self.cancel_button.set_sensitive(sensitive)
d88f46
+        # We could unsens the cancel button here, but since we use it as
d88f46
+        # a 'do over' button that sends the dialog back to the start, just
d88f46
+        # leave it enabled, to avoid leaving un unsens after an async error
d88f46
+        # handler.
d88f46
         self.register_button.set_sensitive(sensitive)
d88f46
 
d88f46
     def _set_screen(self, screen):
d88f46
@@ -421,6 +431,10 @@ class RegisterScreen(widgets.SubmanBaseWidget):
d88f46
         # XXX it would be cool here to do some async spinning while the
d88f46
         # main window gui refreshes itself
d88f46
 
d88f46
+        if failed:
d88f46
+            self.goto_error_screen()
d88f46
+            return
d88f46
+
d88f46
         # FIXME: subman-gui needs this but initial-setup doesnt
d88f46
         self.close_window_callback()
d88f46
 
d88f46
@@ -1151,16 +1165,16 @@ class ChooseServerScreen(Screen):
d88f46
                     show_error_window(_("Unable to reach the server at %s:%s%s") %
d88f46
                                       (hostname, port, prefix),
d88f46
                                       self._parent.window)
d88f46
-                    return self._parent.error_screen()
d88f46
+                    return self._parent.error_screen
d88f46
             except MissingCaCertException:
d88f46
                 show_error_window(_("CA certificate for subscription service has not been installed."),
d88f46
                                   self._parent.window)
d88f46
-                return self._parent.error_screen()
d88f46
+                return self._parent.error_screen
d88f46
 
d88f46
         except ServerUrlParseError:
d88f46
             show_error_window(_("Please provide a hostname with optional port and/or prefix: hostname[:port][/prefix]"),
d88f46
                               self._parent.window)
d88f46
-            return self._parent.error_screen()
d88f46
+            return self._parent.error_screen
d88f46
 
d88f46
         log.debug("Writing server data to rhsm.conf")
d88f46
         CFG.save()
d88f46
diff --git a/src/subscription_manager/gui/reposgui.py b/src/subscription_manager/gui/reposgui.py
d88f46
index 2b6a391..4c00ead 100644
d88f46
--- a/src/subscription_manager/gui/reposgui.py
d88f46
+++ b/src/subscription_manager/gui/reposgui.py
d88f46
@@ -250,7 +250,7 @@ class RepositoriesDialog(widgets.SubmanBaseWidget, HasSortableWidget):
d88f46
     def _show_progress_bar(self, title, label, progress_parent=None):
d88f46
         self.pb = progress.Progress(title, label, True)
d88f46
         self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
d88f46
-        self.pb.set_parent_window(progress_parent or self._get_dialog_widget())
d88f46
+        self.pb.set_transient_for(progress_parent or self._get_dialog_widget())
d88f46
 
d88f46
     def _clear_progress_bar(self):
d88f46
         if self.pb:
d88f46
diff --git a/src/subscription_manager/gui/utils.py b/src/subscription_manager/gui/utils.py
d88f46
index 6535c7d..6c77ff7 100644
d88f46
--- a/src/subscription_manager/gui/utils.py
d88f46
+++ b/src/subscription_manager/gui/utils.py
d88f46
@@ -264,5 +264,6 @@ class AsyncWidgetUpdater(object):
d88f46
             ga_GObject.idle_add(widget_update.finished)
d88f46
 
d88f46
     def update(self, widget_update, backend_method, args=None, kwargs=None, exception_msg=None, callback=None):
d88f46
-        threading.Thread(target=self.worker, args=(widget_update,
d88f46
-            backend_method, args, kwargs, exception_msg, callback)).start()
d88f46
+        threading.Thread(target=self.worker, name="AsyncWidgetUpdaterThread",
d88f46
+                         args=(widget_update, backend_method, args,
d88f46
+                               kwargs, exception_msg, callback)).start()
d88f46
diff --git a/subscription-manager.spec b/subscription-manager.spec
d88f46
index a44c4db..c762947 100644
d88f46
--- a/subscription-manager.spec
d88f46
+++ b/subscription-manager.spec
d88f46
@@ -3,10 +3,22 @@
d88f46
 # For optional building of ostree-plugin sub package. Unrelated to systemd
d88f46
 # but the same versions apply at the moment.
d88f46
 %global has_ostree %use_systemd
d88f46
-%global use_old_firstboot (0%{?rhel} && 0%{?rhel} <= 6)
d88f46
+%global use_firstboot 0
d88f46
+%global use_initial_setup 1
d88f46
 %global rhsm_plugins_dir  /usr/share/rhsm-plugins
d88f46
 %global use_gtk3 %use_systemd
d88f46
-%global use_initial_setup %use_systemd
d88f46
+%global rhel7_minor %(%{__grep} -o "7.[0-9]*" /etc/redhat-release |%{__sed} -s 's/7.//')
d88f46
+
d88f46
+%if 0%{?rhel} == 7
d88f46
+%global use_initial_setup 1
d88f46
+%global use_firstboot 0
d88f46
+%endif
d88f46
+
d88f46
+# 6 < rhel < 7
d88f46
+%if 0%{?rhel} == 6
d88f46
+%global use_initial_setup 0
d88f46
+%global use_firstboot 1
d88f46
+%endif
d88f46
 
d88f46
 %global _hardened_build 1
d88f46
 %{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro -Wl,-z,now}
d88f46
@@ -37,7 +49,7 @@
d88f46
 
d88f46
 Name: subscription-manager
d88f46
 Version: 1.15.9
d88f46
-Release: 3%{?dist}
d88f46
+Release: 4%{?dist}
d88f46
 Summary: Tools and libraries for subscription and repository management
d88f46
 Group:   System Environment/Base
d88f46
 License: GPLv2
d88f46
@@ -178,28 +190,26 @@ This package contains a GTK+ graphical interface for configuring and
d88f46
 registering a system with a Red Hat Entitlement platform and manage
d88f46
 subscriptions.
d88f46
 
d88f46
+%if %use_firstboot
d88f46
 %package -n subscription-manager-firstboot
d88f46
 Summary: Firstboot screens for subscription manager
d88f46
 Group: System Environment/Base
d88f46
 Requires: %{name}-gui = %{version}-%{release}
d88f46
-
d88f46
-# Required for firstboot before RHEL 7:
d88f46
-%if %use_old_firstboot
d88f46
 Requires: rhn-setup-gnome
d88f46
-%endif
d88f46
 
d88f46
 # Fedora can figure this out automatically, but RHEL cannot:
d88f46
 Requires: librsvg2
d88f46
 
d88f46
 %description -n subscription-manager-firstboot
d88f46
 This package contains the firstboot screens for subscription-manager.
d88f46
+%endif
d88f46
 
d88f46
 %if %use_initial_setup
d88f46
 %package -n subscription-manager-initial-setup-addon
d88f46
 Summary: initial-setup screens for subscription-manager
d88f46
 Group: System Environment/Base
d88f46
 Requires: %{name}-gui = %{version}-%{release}
d88f46
-Requires: initial-setup-gui
d88f46
+Requires: initial-setup-gui >= 0.3.9.24-1
d88f46
 Obsoletes: subscription-manager-firstboot < 1.15.3-1
d88f46
 
d88f46
 %description -n subscription-manager-initial-setup-addon
d88f46
@@ -354,6 +364,7 @@ rm -rf %{buildroot}
d88f46
 # python package dirs
d88f46
 %dir %{_datadir}/rhsm
d88f46
 %dir %{_datadir}/rhsm/subscription_manager
d88f46
+%dir %{_datadir}/rhsm/subscription_manager/api
d88f46
 %dir %{_datadir}/rhsm/subscription_manager/branding
d88f46
 %dir %{_datadir}/rhsm/subscription_manager/model
d88f46
 %dir %{_datadir}/rhsm/subscription_manager/plugin
d88f46
@@ -361,6 +372,7 @@ rm -rf %{buildroot}
d88f46
 # code, python modules and packages
d88f46
 %{_datadir}/rhsm/subscription_manager/*.py*
d88f46
 
d88f46
+%{_datadir}/rhsm/subscription_manager/api/*.py*
d88f46
 %{_datadir}/rhsm/subscription_manager/branding/*.py*
d88f46
 
d88f46
 # our gtk2/gtk3 compat modules
d88f46
@@ -469,8 +481,9 @@ rm -rf %{buildroot}
d88f46
 %{_datadir}/anaconda/addons/com_redhat_subscription_manager/gui/spokes/*.py*
d88f46
 %{_datadir}/anaconda/addons/com_redhat_subscription_manager/categories/*.py*
d88f46
 %{_datadir}/anaconda/addons/com_redhat_subscription_manager/ks/*.py*
d88f46
-%else
d88f46
+%endif
d88f46
 
d88f46
+%if %use_firstboot
d88f46
 %files -n subscription-manager-firstboot
d88f46
 %defattr(-,root,root,-)
d88f46
 %{_datadir}/rhn/up2date_client/firstboot/rhsm_login.py*
d88f46
@@ -529,6 +542,16 @@ fi
d88f46
 %endif
d88f46
 
d88f46
 %changelog
d88f46
+* Thu Aug 06 2015 Chris Rog <crog@redhat.com> 1.15.9-4
d88f46
+- Fix spec file build errors (alikins@redhat.com)
d88f46
+- Require initial-setup >= 0.3.9.24, no fb on el7 (alikins@redhat.com)
d88f46
+- Remove use of Widget.is_toplevel() (alikins@redhat.com)
d88f46
+- Only build initial-setup rpm on rhel > 7.1 (alikins@redhat.com)
d88f46
+- 1243704: Goto error screen on 'cancel' (alikins@redhat.com)
d88f46
+- Add new api package to RPM. (awood@redhat.com)
d88f46
+- Turn off ga loading debug messages. (alikins@redhat.com)
d88f46
+- Specify a thread name for any threads we start. (alikins@redhat.com)
d88f46
+
d88f46
 * Fri Jul 31 2015 Chris Rog <crog@redhat.com> 1.15.9-3
d88f46
 - 1248746: Fix layout of contract dialog (GTK3) (mstead@redhat.com)
d88f46
 - 1248821: Add Gtk.Window to ga_gtk2.Gtk (alikins@redhat.com)