From 1aa5cdf56fe7e3604adb3d80af9b57d0bd20119f Mon Sep 17 00:00:00 2001 From: Johnny Hughes Date: Feb 20 2024 15:38:13 +0000 Subject: Manual CentOS Branding --- diff --git a/SPECS/subscription-manager.spec b/SPECS/subscription-manager.spec index 3ea4ae6..5e02340 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 @@ -266,6 +267,8 @@ BuildRequires: systemd-rpm-macros BuildRequires: systemd %endif +Patch999: subscription-manager-1.24.13-centos-remove-redhat.repo.patch + %description The Subscription Manager package provides programs and libraries to allow users to manage subscriptions and yum repositories from the Red Hat entitlement @@ -573,28 +576,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 - -# libexec directory does not exist on sles based distros -%if 0%{?suse_version} -%if %use_subman_gui - sed -i 's/libexec/lib/g' %{buildroot}/%{_sysconfdir}/cron.daily/rhsmd -%endif -%endif - %find_lang rhsm %if 0%{?include_syspurpose} %find_lang syspurpose @@ -611,13 +592,21 @@ mkdir -p %{buildroot}%{_sysconfdir}/pki/consumer 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/redhat-uep.pem %{buildroot}/%{_sysconfdir}/rhsm/ca/redhat-uep.pem +%else +rm %{_builddir}/%{buildsubdir}/etc-conf/redhat-entitlement-authority.pem +%endif %if %use_cockpit # install cockpit dist targz @@ -627,6 +616,11 @@ install -m 644 %{_builddir}/%{buildsubdir}/etc-conf/redhat-uep.pem %{buildroot}/ # 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 + %if %{with python3} %py_byte_compile %{__python3} %{buildroot}%{rhsm_plugins_dir}/ %py_byte_compile %{__python3} %{buildroot}%{_datadir}/anaconda/addons/com_redhat_subscription_manager/ @@ -897,7 +891,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 @@ -913,10 +907,10 @@ 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 @@ -926,7 +920,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 @@ -1012,9 +1006,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 @@ -1069,7 +1063,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