From 8dbaba3a565aee1fa1e9e2fe1f506e471272753e Mon Sep 17 00:00:00 2001 From: Carl George Date: Jun 10 2020 15:42:32 +0000 Subject: Manual CentOS debranding --- diff --git a/SPECS/subscription-manager.spec b/SPECS/subscription-manager.spec index 2da5c3e..396bda0 100644 --- a/SPECS/subscription-manager.spec +++ b/SPECS/subscription-manager.spec @@ -253,6 +253,9 @@ Source2: subscription-manager-rpmlintrc 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 # why this is necessary) @@ -558,9 +561,11 @@ Group: System Environment/Base Requires: rhsm-gtk = %{version}-%{release} Requires: initial-setup-gui >= 0.3.9.24-1 Obsoletes: subscription-manager-firstboot < 1.15.3-1 +%if %{undefined centos} %if (0%{?rhel} >= 8) Supplements: initial-setup-gui %endif +%endif %description -n subscription-manager-initial-setup-addon This package contains the initial-setup screens for subscription-manager. @@ -713,6 +718,8 @@ subscription-manager-initial-setup-addon, and subscription-manager-cockpit-plugi %prep %setup -q +%patch100 -p1 +%patch101 -p1 %build make -f Makefile VERSION=%{version}-%{release} CFLAGS="%{optflags}" \ @@ -790,7 +797,9 @@ sed -i 's/libexec/lib/g' %{buildroot}/%{_sysconfdir}/cron.daily/rhsmd # fake out the redhat.repo file %if %{use_yum} || %{use_dnf} mkdir %{buildroot}%{_sysconfdir}/yum.repos.d + %if %{undefined centos} touch %{buildroot}%{_sysconfdir}/yum.repos.d/redhat.repo + %endif %endif # fake out the certificate directories @@ -800,13 +809,19 @@ mkdir -p %{buildroot}%{_sysconfdir}/pki/entitlement %if %{use_container_plugin} # Setup cert directories for the container plugin: mkdir -p %{buildroot}%{_sysconfdir}/docker/certs.d/ +%if %{undefined 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 +%endif +%if %{undefined 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 @@ -832,6 +847,10 @@ find %{buildroot} -name \*.py* -exec touch -r %{SOURCE0} '{}' \; %endif %endif +%if %{defined centos} +sed -e '/^enabled=/ s/1/0/' -i %{buildroot}%{_sysconfdir}/dnf/plugins/subscription-manager.conf +%endif + # base/cli tools use the gettext domain 'rhsm', while the # gnome-help tools use domain 'subscription-manager' %files -f rhsm.lang @@ -1202,10 +1221,12 @@ find %{buildroot} -name \*.py* -exec touch -r %{SOURCE0} '{}' \; %{python_sitearch}/subscription_manager/plugin/container/*.py* %{python_sitearch}/subscription_manager/plugin/container/__pycache__ +%if %{undefined centos} # 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}/docker/certs.d/cdn.redhat.com/redhat-entitlement-authority.crt %endif +%endif %if %has_ostree %files -n subscription-manager-plugin-ostree @@ -1260,8 +1281,10 @@ find %{buildroot} -name \*.py* -exec touch -r %{SOURCE0} '{}' \; %attr(755,root,root) %dir %{_sysconfdir}/rhsm %attr(755,root,root) %dir %{_sysconfdir}/rhsm/ca +%if %{undefined centos} %attr(644,root,root) %{_sysconfdir}/rhsm/ca/redhat-entitlement-authority.pem %attr(644,root,root) %{_sysconfdir}/rhsm/ca/redhat-uep.pem +%endif %if %use_cockpit %files -n subscription-manager-cockpit