From fd13abfb28e3b6d2e4d88fa578f301384d02b878 Mon Sep 17 00:00:00 2001 From: Carl George Date: May 05 2020 23:01:22 +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/CENTOS-use-centos-syspurposes.patch b/SOURCES/CENTOS-use-centos-syspurposes.patch new file mode 100644 index 0000000..52d2e66 --- /dev/null +++ b/SOURCES/CENTOS-use-centos-syspurposes.patch @@ -0,0 +1,20 @@ +diff --git a/etc-conf/syspurpose/valid_fields.json b/etc-conf/syspurpose/valid_fields.json +index 1ac7ea0e..305ec4b9 100644 +--- a/etc-conf/syspurpose/valid_fields.json ++++ b/etc-conf/syspurpose/valid_fields.json +@@ -1,12 +1,10 @@ + { + "role": [ +- "Red Hat Enterprise Linux Server", +- "Red Hat Enterprise Linux Workstation", +- "Red Hat Enterprise Linux Compute Node" ++ "CentOS Linux Server", ++ "CentOS Linux Workstation", ++ "CentOS Linux Compute Node" + ], + "service_level_agreement": [ +- "Premium", +- "Standard", + "Self-Support" + ], + "usage": [ 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 7a92bee..e095fec 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) @@ -713,6 +716,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 +795,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 +807,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 @@ -1202,10 +1215,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 +1275,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