From 9ee0cf3f2f32fc6f35af92f292f5c58f19c41b48 Mon Sep 17 00:00:00 2001 From: Johnny Hughes Date: Nov 19 2018 10:12:38 +0000 Subject: Manual CentOS Debranding --- diff --git a/README.debrand b/README.debrand deleted file mode 100644 index 01c46d2..0000000 --- a/README.debrand +++ /dev/null @@ -1,2 +0,0 @@ -Warning: This package was configured for automatic debranding, but the changes -failed to apply. diff --git a/SOURCES/subscription-manager-1.19.21-centos-remove-redhat.repo.patch b/SOURCES/subscription-manager-1.19.21-centos-remove-redhat.repo.patch new file mode 100644 index 0000000..ed06dbc --- /dev/null +++ b/SOURCES/subscription-manager-1.19.21-centos-remove-redhat.repo.patch @@ -0,0 +1,11 @@ +diff -uNrp subscription-manager-1.20.11.orig/src/subscription_manager/repolib.py subscription-manager-1.20.11/src/subscription_manager/repolib.py +--- subscription-manager-1.20.11.orig/src/subscription_manager/repolib.py 2018-03-13 14:36:33.000000000 +0000 ++++ subscription-manager-1.20.11/src/subscription_manager/repolib.py 2018-04-12 19:12:43.177743996 +0000 +@@ -955,6 +955,7 @@ class RepoFileBase(object): + return self.path_exists(self.path) + + def create(self): ++ return + if self.path_exists(self.path) or not self.manage_repos: + return + with open(self.path, 'w') as f: diff --git a/SPECS/subscription-manager.spec b/SPECS/subscription-manager.spec index aa80817..29e0fc6 100644 --- a/SPECS/subscription-manager.spec +++ b/SPECS/subscription-manager.spec @@ -2,6 +2,7 @@ %global use_systemd 0%{?fedora} || (0%{?rhel} && 0%{?rhel} >= 7) || (0%{?suse_version} && 0%{?suse_version} >= 1315) # For optional building of ostree-plugin sub package. Unrelated to systemd # but the same versions apply at the moment. +%global if_centos (0%{?centos_ver} && 0%{?centos_ver} >= 7) %global has_ostree %use_systemd && 0%{?suse_version} == 0 %global use_initial_setup 1 %global use_firstboot 0 @@ -150,6 +151,7 @@ Source1: %{name}-cockpit-%{version}.tar.gz %if 0%{?suse_version} Source2: subscription-manager-rpmlintrc %endif +Patch999: subscription-manager-1.19.21-centos-remove-redhat.repo.patch %if 0%{?suse_version} < 1200 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -496,6 +498,8 @@ Subscription Manager Cockpit UI %prep %setup -q +%patch999 -p1 + %build make -f Makefile VERSION=%{version}-%{release} CFLAGS="%{optflags}" \ LDFLAGS="%{__global_ldflags}" OS_DIST="%{dist}" PYTHON="%{__python}" \ @@ -528,19 +532,6 @@ python2 ./setup.py build_ext --build-lib %{buildroot}%{python2_sitearch} --quiet cp %{buildroot}%{python_sitearch}/rhsm/*.py %{buildroot}%{python2_sitearch}/rhsm/ %endif -%if 0%{?suse_version} -%suse_update_desktop_file -n -r subscription-manager-gui Settings PackageManager -%endif - -%if %use_subman_gui -desktop-file-validate %{buildroot}/etc/xdg/autostart/rhsm-icon.desktop -desktop-file-validate %{buildroot}/usr/share/applications/subscription-manager-gui.desktop -%else -%if %use_cockpit -desktop-file-validate %{buildroot}/usr/share/applications/subscription-manager-cockpit.desktop -%endif -%endif - %find_lang rhsm @@ -555,13 +546,22 @@ desktop-file-validate %{buildroot}/usr/share/applications/subscription-manager-c %{__mkdir_p} %{buildroot}%{_sysconfdir}/pki/entitlement # Setup cert directories for the container plugin: +%if 0%{!?if_centos} %{__mkdir_p} %{buildroot}%{_sysconfdir}/docker/certs.d/ %{__mkdir} %{buildroot}%{_sysconfdir}/docker/certs.d/cdn.redhat.com install -m 644 %{_builddir}/%{buildsubdir}/etc-conf/redhat-entitlement-authority.pem %{buildroot}%{_sysconfdir}/docker/certs.d/cdn.redhat.com/redhat-entitlement-authority.crt +%else +rm %{buildroot}/%{_sysconfdir}/rhsm/ca/redhat-entitlement-authority.pem +%endif +%if 0%{!?if_centos} %{__mkdir_p} %{buildroot}%{_sysconfdir}/etc/rhsm/ca install -m 644 %{_builddir}/%{buildsubdir}/etc-conf/redhat-entitlement-authority.pem %{buildroot}/%{_sysconfdir}/rhsm/ca/redhat-entitlement-authority.pem install -m 644 %{_builddir}/%{buildsubdir}/etc-conf/ca/redhat-uep.pem %{buildroot}/%{_sysconfdir}/rhsm/ca/redhat-uep.pem +%else +rm %{_builddir}/%{buildsubdir}/etc-conf/redhat-entitlement-authority.pem +rm %{_builddir}/%{buildsubdir}/etc-conf/ca/redhat-uep.pem +%endif %if %use_cockpit # install cockpit dist targz @@ -576,6 +576,11 @@ install -m 644 %{_builddir}/%{buildsubdir}/etc-conf/ca/redhat-uep.pem %{buildroo # fix timestamps on our byte compiled files so they match across arches find %{buildroot} -name \*.py -exec touch -r %{SOURCE0} '{}' \; +rm -f %{buildroot}/etc/xdg/autostart/rhsm-icon.desktop +rm -f %{buildroot}/usr/bin/rhsm-icon +rm -f %{buildroot}/usr/bin/subscription-manager-gui +rm -f %{buildroot}/usr/sbin/subscription-manager-gui + # base/cli tools use the gettext domain 'rhsm', while the # gnome-help tools use domain 'subscription-manager' %files -f rhsm.lang @@ -829,7 +834,7 @@ find %{buildroot} -name \*.py -exec touch -r %{SOURCE0} '{}' \; #%files -n subscription-manager-gui -f subscription-manager.lang %files -n subscription-manager-gui %defattr(-,root,root,-) -%attr(755,root,root) %{_sbindir}/subscription-manager-gui +#%attr(755,root,root) %{_sbindir}/subscription-manager-gui %if 0%{?suse_version} %dir %{python_sitearch}/subscription_manager/gui/data %dir %{python_sitearch}/subscription_manager/gui/data/glade @@ -845,9 +850,9 @@ find %{buildroot} -name \*.py -exec touch -r %{SOURCE0} '{}' \; %dir %{_datadir}/omf/subscription-manager %else # symlink to console-helper -%{_bindir}/subscription-manager-gui +#%{_bindir}/subscription-manager-gui %endif -%{_bindir}/rhsm-icon +#%{_bindir}/rhsm-icon %{_datadir}/gnome/help/subscription-manager/C/figures/*.png %{_datadir}/gnome/help/subscription-manager/C/*.xml @@ -857,7 +862,7 @@ find %{buildroot} -name \*.py -exec touch -r %{SOURCE0} '{}' \; %{_datadir}/appdata/subscription-manager-gui.appdata.xml # desktop config files -%{_sysconfdir}/xdg/autostart/rhsm-icon.desktop +#%{_sysconfdir}/xdg/autostart/rhsm-icon.desktop %if !0%{?suse_version} %{_sysconfdir}/pam.d/subscription-manager-gui %{_sysconfdir}/security/console.apps/subscription-manager-gui @@ -941,9 +946,9 @@ find %{buildroot} -name \*.py -exec touch -r %{SOURCE0} '{}' \; %{python_sitearch}/subscription_manager/plugin/container.py* # Copying Red Hat CA cert into each directory: -%attr(755,root,root) %dir %{_sysconfdir}/docker/certs.d/cdn.redhat.com -%attr(644,root,root) %{_sysconfdir}/rhsm/ca/redhat-entitlement-authority.pem -%attr(644,root,root) %{_sysconfdir}/docker/certs.d/cdn.redhat.com/redhat-entitlement-authority.crt +#%attr(755,root,root) %dir %{_sysconfdir}/docker/certs.d/cdn.redhat.com +#%attr(644,root,root) %{_sysconfdir}/rhsm/ca/redhat-entitlement-authority.pem +#%attr(644,root,root) %{_sysconfdir}/docker/certs.d/cdn.redhat.com/redhat-entitlement-authority.crt %if %has_ostree @@ -995,7 +1000,7 @@ find %{buildroot} -name \*.py -exec touch -r %{SOURCE0} '{}' \; %attr(755,root,root) %dir %{_sysconfdir}/rhsm %attr(755,root,root) %dir %{_sysconfdir}/rhsm/ca -%attr(644,root,root) %{_sysconfdir}/rhsm/ca/redhat-uep.pem +#%attr(644,root,root) %{_sysconfdir}/rhsm/ca/redhat-uep.pem %if %use_cockpit %files -n subscription-manager-cockpit @@ -1096,6 +1101,9 @@ gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || : %endif %changelog +* Mon Nov 19 2018 Johnny Hughes 1.21.10-3 +- Manual CentOS Debranding + * Wed Nov 07 2018 Christopher Snyder 1.21.10-3 - 1646867: Do not update ent certs inside containers (csnyder@redhat.com)