From 537cad54a4160c544a67d3298f653d8b4420297c Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 10 2019 10:39:03 +0000 Subject: import insights-client-3.0.8-0.el8_0 --- diff --git a/.gitignore b/.gitignore index 6597117..bfd48fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/insights-client-3.0.5.tar.gz +SOURCES/insights-client-3.0.8.tar.gz diff --git a/.insights-client.metadata b/.insights-client.metadata index f7b90fa..5e09c82 100644 --- a/.insights-client.metadata +++ b/.insights-client.metadata @@ -1 +1 @@ -dc6211034ac64a7c8aa3413f8f7806f1c412afe9 SOURCES/insights-client-3.0.5.tar.gz +dc4bab1ae0d565f7d1413848c1068b8f827665b9 SOURCES/insights-client-3.0.8.tar.gz diff --git a/SPECS/insights-client.spec b/SPECS/insights-client.spec index 89fb2c7..6c03080 100644 --- a/SPECS/insights-client.spec +++ b/SPECS/insights-client.spec @@ -1,47 +1,58 @@ %define _binaries_in_noarch_packages_terminate_build 0 -%global insights_user insights -%global insights_group %{insights_user} - Name: insights-client Summary: Uploads Insights information to Red Hat on a periodic basis -Version: 3.0.5 -Release: 4%{?dist} +Version: 3.0.8 +Release: 0%{?dist} Source0: https://github.com/redhatinsights/insights-client/archive/insights-client-%{version}.tar.gz Epoch: 0 License: GPLv2+ -URL: http://access.redhat.com/insights +URL: http://cloud.redhat.com/insights Group: Applications/System Vendor: Red Hat, Inc. Provides: redhat-access-insights = 1.0.13-3 Provides: redhat-access-insights = %{version}-%{release}%{?dist} -Obsoletes: redhat-access-insights <= 1.0.13-2%{?dist} -Obsoletes: redhat-access-proactive <= 0.3.3-0%{?dist} +Obsoletes: redhat-access-insights +Obsoletes: redhat-access-proactive -# TODO: make specfile dynamic for python 2 or 3 +Requires: tar +Requires: gpg +Requires: pciutils +BuildArch: noarch + +# RHEL 8 +%if 0%{?rhel} == 8 %{?__python3:Requires: %{__python3}} Requires: platform-python-setuptools Requires: python3-requests >= 2.6 Requires: python3-PyYAML -Requires: python3-pyOpenSSL -Requires: tar -Requires: gpg -Requires: pciutils Requires: python3-magic Requires: python3-six -%if 0%{?rhel} && 0%{?rhel} == 6 +BuildRequires: python3-devel +BuildRequires: python3-six +BuildRequires: python3-setuptools + +# RHEL 6-7 +%else +Requires: python +Requires: python-setuptools +Requires: python-requests >= 2.6 +Requires: PyYAML +Requires: libcgroup +Requires: python-magic +Requires: python-six >= 1.9.0 +BuildRequires: python2-devel +BuildRequires: python-setuptools +%endif + +# systemd/RHEL 6 deps +%if 0%{?rhel} == 6 Requires: python-argparse %else %{?systemd_requires} Requires: systemd -%endif -BuildArch: noarch - -BuildRequires: python3-devel -BuildRequires: python3-setuptools -%if 0%{?rhel} != 6 BuildRequires: systemd %endif @@ -53,14 +64,15 @@ Sends insightful information to Red Hat for automated analysis %install rm -rf ${RPM_BUILD_ROOT} +%if 0%{?rhel} == 8 %{__python3} setup.py install --root=${RPM_BUILD_ROOT} $PREFIX -sed -i '1s=^#!/usr/bin/env python\($\|\s\)=#!%{__python3}\1=' \ - %{buildroot}%{python3_sitelib}/insights_client/{__init__.py,major_version.py,run.py} -%pre -getent group insights > /dev/null || /usr/sbin/groupadd -r %{insights_group} -getent passwd insights > /dev/null || \ - /usr/sbin/useradd -g insights -r --shell /sbin/nologin %{insights_user} \ - -c "Red Hat Insights" -d /var/lib/insights +pathfix.py -pni "%{__python3}" %{buildroot}%{python3_sitelib}/insights_client/{__init__.py,major_version.py,run.py} +pathfix.py -pni "%{__python3}" %{buildroot}%{_bindir}/insights-client-run +pathfix.py -pni "%{__python3}" %{buildroot}%{_bindir}/insights-client +pathfix.py -pni "%{__python3}" %{buildroot}%{_bindir}/redhat-access-insights +%else +%{__python2} setup.py install --root=${RPM_BUILD_ROOT} $PREFIX +%endif %post @@ -94,13 +106,17 @@ if [ $1 -eq 1 ]; then if [ -f "/etc/redhat-access-insights/.lastupload" ]; then cp /etc/redhat-access-insights/.lastupload /etc/insights-client/.lastupload fi + #Migrate remove.conf + if [ -f "/etc/redhat-access-insights/remove.conf" ]; then + cp /etc/redhat-access-insights/remove.conf /etc/insights-client/remove.conf + fi if ! [ -d "/etc/redhat-access-insights" ]; then mkdir /etc/redhat-access-insights fi # Symlink new cron job if the old one exists. Remove the old one if [ -f "/etc/cron.daily/redhat-access-insights" ]; then rm -f /etc/cron.daily/redhat-access-insights - %if 0%{?rhel} && 0%{?rhel} == 6 + %if 0%{?rhel} == 6 ln -sf /etc/insights-client/insights-client.cron /etc/cron.daily/insights-client %else %_bindir/systemctl start insights-client.timer @@ -110,29 +126,25 @@ fi # if the logging directory isnt created then make it if ! [ -d "/var/log/insights-client" ]; then -mkdir /var/log/insights-client +mkdir -m 640 /var/log/insights-client fi # if the library directory for eggs and such isn't present # make it if ! [ -d "/var/lib/insights" ]; then -mkdir /var/lib/insights +mkdir -m 644 /var/lib/insights fi -# if ansible is present -# make the fact directory AND -# the fact file AND -if [ -d "/etc/ansible" ]; then -if ! [ -d "/etc/ansible/facts.d" ]; then -mkdir /etc/ansible/facts.d -fi -fi -if [ -d "/etc/ansible/facts.d" ]; then -touch /etc/ansible/facts.d/insights.fact -touch /etc/ansible/facts.d/insights_machine_id.fact +#Link motd into place. Only do so if motd file doesn't exist and insights hasn't been used +if [ ! -e /etc/motd.d/insights-client -a ! -L /etc/motd.d/insights-client ]; then + mkdir -p /etc/motd.d + if [ -e /var/lib/insights/newest.egg ]; then + ln -sn /dev/null /etc/motd.d/insights-client + else + ln -sn /etc/insights-client/insights-client.motd /etc/motd.d/insights-client + fi fi - # always perform legacy symlinks %posttrans mkdir -p /etc/redhat-access-insights @@ -142,6 +154,10 @@ ln -sf /etc/insights-client/.registered /etc/redhat-access-insights/.registered ln -sf /etc/insights-client/.unregistered /etc/redhat-access-insights/.unregistered ln -sf /etc/insights-client/.lastupload /etc/redhat-access-insights/.lastupload ln -sf /etc/insights-client/machine-id /etc/redhat-access-insights/machine-id +# remove all ACLs on upgrade, forever and always +setfacl -Rb /var/lib/insights +setfacl -Rb /var/log/insights-client +setfacl -Rb /etc/insights-client %preun %if 0%{?rhel} != 6 @@ -165,6 +181,7 @@ rm -f /etc/insights-client/rpm.egg rm -f /etc/insights-client/rpm.egg.asc rm -f /etc/insights-client/.insights-core*.etag rm -rf /var/lib/insights +# keep these to remove from previous install rm -f /etc/ansible/facts.d/insights.fact rm -f /etc/ansible/facts.d/insights_machine_id.fact # remove symlink to old name on uninstall @@ -173,6 +190,7 @@ rm -f %{_bindir}/redhat-access-insights rm -rf /etc/redhat-access-insights/ rm -f /etc/cron.daily/redhat-access-insights rm -f /etc/cron.weekly/redhat-access-insights +rm -f /etc/motd.d/insights-client fi %clean @@ -184,6 +202,7 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT /etc/insights-client/.fallback.json /etc/insights-client/.fallback.json.asc /etc/insights-client/.exp.sed +%config(noreplace) %attr(644,root,root) /etc/insights-client/insights-client.motd %if 0%{?rhel} != 6 %attr(644,root,root) %{_unitdir}/insights-client.service @@ -197,17 +216,26 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/redhat-access-insights %attr(755,root,root) %{_bindir}/insights-client-run -%if 0%{?rhel} && 0%{?rhel} == 6 +%if 0%{?rhel} == 6 %attr(755,root,root) /etc/insights-client/insights-client.cron %endif %attr(644,root,root) /etc/insights-client/rpm.egg %attr(644,root,root) /etc/insights-client/rpm.egg.asc -%attr(755,root,root) %dir %{python3_sitelib}/insights_client*.egg-info +%if 0%{?rhel} == 8 +%attr(755,root,root) %{python3_sitelib}/insights_client*.egg-info %attr(644,root,root) %{python3_sitelib}/insights_client*.egg-info/* %attr(644,root,root) %{python3_sitelib}/insights_client/*.py* -%attr(644,root,root) %{python3_sitelib}/insights_client/__pycache__/* +%attr(644,root,root) %{python3_sitelib}/insights_client/__pycache__ +%else +%attr(755,root,root) %{python2_sitelib}/insights_client*.egg-info +%attr(644,root,root) %{python3_sitelib}/insights_client*.egg-info/* +%attr(644,root,root) %{python2_sitelib}/insights_client/*.py* +%endif + +%attr(640,root,root) /var/log/insights-client +%attr(644,root,root) /var/lib/insights %doc %defattr(-, root, root) @@ -215,6 +243,18 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT /usr/share/man/man5/*.5.gz %changelog +* Fri Aug 30 2019 Jeremy Crafts - 3.0.8-0 +- Modify MOTD logic and installation +- Resolves: BZ1747450 + +* Thu Aug 29 2019 Jeremy Crafts - 3.0.7-0 +- Update core egg with bugfixes (3.0.121-1) +- Remove unused PyOpenSSL dependency +- Remove ACLs from previous installations +- Update service URL +- Add MOTD information +- Resolves: BZ1740286 + * Tue Dec 11 2018 Jeremy Crafts - 3.0.5-4 - Update core egg with bugfixes - Resolves: BZ1656973