From 2384105aa8533cbb999a798f73fd668e2f14d464 Mon Sep 17 00:00:00 2001 From: Johnny Hughes Date: Jul 10 2019 17:18:06 +0000 Subject: Manaul CentOS Debranding --- diff --git a/SOURCES/subscription-manager-centos-remove-redhat.repo.patch b/SOURCES/subscription-manager-centos-remove-redhat.repo.patch new file mode 100644 index 0000000..d474938 --- /dev/null +++ b/SOURCES/subscription-manager-centos-remove-redhat.repo.patch @@ -0,0 +1,11 @@ +diff -uNrp subscription-manager-1.23.8.orig/src/subscription_manager/repofile.py subscription-manager-1.23.8/src/subscription_manager/repofile.py +--- subscription-manager-1.23.8.orig/src/subscription_manager/repofile.py 2019-03-06 08:15:21.000000000 -0600 ++++ subscription-manager-1.23.8/src/subscription_manager/repofile.py 2019-07-10 12:03:11.266030982 -0500 +@@ -340,6 +340,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 af7b87c..33fd17d 100644 --- a/SPECS/subscription-manager.spec +++ b/SPECS/subscription-manager.spec @@ -7,6 +7,7 @@ %global use_firstboot 0 %global use_inotify 1 %global py2_package_prefix python2 +%global if_centos (0%{?centos_ver} && 0%{?centos_ver} >= 7) %if (0%{?rhel} >= 7 || 0%{?fedora}) %global dmidecode_version >= 3.12.2-2 @@ -28,7 +29,7 @@ %if %{with python3} %global use_subman_gui 0 %else -%global use_subman_gui 1 +%global use_subman_gui 0 %endif %global rhsm_plugins_dir /usr/share/rhsm-plugins @@ -156,6 +157,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %endif Patch100: CENTOS-use-centos-syspurposes.patch +Patch101: subscription-manager-centos-remove-redhat.repo.patch # The following macro examples are preceeded by '%' to stop macro expansion # in the comments. (See https://bugzilla.redhat.com/show_bug.cgi?id=1224660 for @@ -519,6 +521,7 @@ Subscription Manager Cockpit UI %prep %setup -q %patch100 -p1 +%patch101 -p1 %build make -f Makefile VERSION=%{version}-%{release} CFLAGS="%{optflags}" \ @@ -587,7 +590,7 @@ desktop-file-validate %{buildroot}/usr/share/applications/subscription-manager-c # fake out the redhat.repo file %if %{use_yum} || %{use_dnf} mkdir %{buildroot}%{_sysconfdir}/yum.repos.d - touch %{buildroot}%{_sysconfdir}/yum.repos.d/redhat.repo + #touch %{buildroot}%{_sysconfdir}/yum.repos.d/redhat.repo %endif # fake out the certificate directories @@ -596,12 +599,18 @@ mkdir -p %{buildroot}%{_sysconfdir}/pki/entitlement # Setup cert directories for the container plugin: mkdir -p %{buildroot}%{_sysconfdir}/docker/certs.d/ +%if 0%{!?if_centos} 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 +%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/redhat-uep.pem %{buildroot}/%{_sysconfdir}/rhsm/ca/redhat-uep.pem +%else +rm %{buildroot}/%{_sysconfdir}/rhsm/ca/redhat-entitlement-authority.pem +%endif %if %use_cockpit # install cockpit dist targz @@ -883,29 +892,29 @@ 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 %{_datadir}/omf/subscription-manager/subscription-manager-C.omf -%{_datadir}/applications/subscription-manager-gui.desktop -%{_datadir}/appdata/subscription-manager-gui.appdata.xml +#%{_datadir}/applications/subscription-manager-gui.desktop +#%{_datadir}/appdata/subscription-manager-gui.appdata.xml # desktop config files -%{_sysconfdir}/xdg/autostart/rhsm-icon.desktop -%if !0%{?suse_version} -%{_sysconfdir}/pam.d/subscription-manager-gui -%{_sysconfdir}/security/console.apps/subscription-manager-gui -%endif +#%{_sysconfdir}/xdg/autostart/rhsm-icon.desktop +#%if !0%{?suse_version} +#%{_sysconfdir}/pam.d/subscription-manager-gui +#%{_sysconfdir}/security/console.apps/subscription-manager-gui +#%endif -%{_sysconfdir}/bash_completion.d/subscription-manager-gui +#%{_sysconfdir}/bash_completion.d/subscription-manager-gui %doc -%{_mandir}/man8/subscription-manager-gui.8* -%{_mandir}/man8/rhsm-icon.8* +#%{_mandir}/man8/subscription-manager-gui.8* +#%{_mandir}/man8/rhsm-icon.8* %doc LICENSE %endif @@ -980,9 +989,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 @@ -1037,7 +1046,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 @@ -1138,6 +1147,9 @@ gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || : %endif %changelog +* Wed Jul 10 2019 Johnny Hughes 1.23.8-35 +- Manual CentOS Debranding + * Wed Mar 06 2019 Christopher Snyder 1.23.8-35 - 1685037: Ignore null repos when running using packagekit (csnyder@redhat.com)