23f808
%global project freeipa
23f808
%global shortname healthcheck
23f808
%global longname ipa%{shortname}
23f808
%global debug_package %{nil}
23f808
%global python3dir %{_builddir}/python3-%{name}-%{version}-%{release}
23f808
%{!?python3_sitelib: %global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
23f808
23f808
23f808
Name:           ipa-healthcheck
95d978
Version:        0.4
fa6708
Release:        6%{?dist}
23f808
Summary:        Health check tool for IdM
23f808
BuildArch:      noarch
23f808
License:        GPLv3
95d978
URL:            https://github.com/%{project}/freeipa-healthcheck
95d978
Source0:        https://github.com/%{project}/%{name}/archive/%{version}.tar.gz#/%{project}-%{shortname}-%{version}.tar.gz
23f808
Source1:        %{longname}.conf
23f808
23f808
Patch0001:      0001-Remove-requirement-for-pytest-runner-since-PyPI-isn-.patch
95d978
Patch0002:	0002-Move-main-to-run_healthcheck-for-abstraction-purpose.patch
95d978
Patch0003:	0003-Abstract-ServiceCheck-to-not-be-IPA-specific.patch
95d978
Patch0004:	0004-Move-the-abstracted-plugin-runner-code-into-a-separa.patch
95d978
Patch0005:	0005-Convert-running-healthchecks-into-a-class-and-add-pr.patch
95d978
Patch0006:	0006-Move-config-object-from-plugins-to-registry.patch
23f808
fa6708
Requires:       %{name}-core = %{version}-%{release}
23f808
Requires:       ipa-server
23f808
Requires:       python3-ipalib
23f808
Requires:       python3-ipaserver
23f808
# cronie-anacron provides anacron
23f808
Requires:       anacron
23f808
Requires:       logrotate
23f808
Requires(post): systemd-units
95d978
Requires:       %{name}-core = %{version}-%{release}
23f808
BuildRequires:  python3-devel
23f808
BuildRequires:  systemd-devel
23f808
%{?systemd_requires}
23f808
23f808
23f808
%description
23f808
The FreeIPA health check tool provides a set of checks to
23f808
proactively detect defects in a FreeIPA cluster.
23f808
95d978
%package -n %{name}-core
95d978
Summary: Core plugin system for healthcheck
fa6708
# No Requires on %%{name} = %%{version}-%%{release} since this can be
fa6708
# installed standalone
fa6708
Conflicts: %{name} < 0.4
95d978
95d978
%description -n %{name}-core
95d978
Core files
95d978
23f808
23f808
%prep
23f808
%autosetup -p1 -n %{project}-%{shortname}-%{version}
23f808
23f808
23f808
%build
23f808
%py3_build
23f808
23f808
23f808
%install
23f808
%py3_install
23f808
23f808
mkdir -p %{buildroot}%{_sysconfdir}/%{longname}
23f808
install -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{longname}
23f808
23f808
mkdir -p %{buildroot}/%{_unitdir}
23f808
install -p -m644 %{_builddir}/%{project}-%{shortname}-%{version}/systemd/ipa-%{shortname}.service %{buildroot}%{_unitdir}
23f808
install -p -m644 %{_builddir}/%{project}-%{shortname}-%{version}/systemd/ipa-%{shortname}.timer %{buildroot}%{_unitdir}
23f808
23f808
mkdir -p %{buildroot}/%{_libexecdir}/ipa
23f808
install -p -m755 %{_builddir}/%{project}-%{shortname}-%{version}/systemd/ipa-%{shortname}.sh %{buildroot}%{_libexecdir}/ipa/
23f808
23f808
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
23f808
install -p -m644 %{_builddir}/%{project}-%{shortname}-%{version}/logrotate/%{longname} %{buildroot}%{_sysconfdir}/logrotate.d
23f808
23f808
mkdir -p %{buildroot}/%{_localstatedir}/log/ipa/%{shortname}
23f808
23f808
mkdir -p %{buildroot}/%{_mandir}/man1
23f808
mkdir -p %{buildroot}/%{_mandir}/man5
23f808
install -p -m644 %{_builddir}/%{project}-%{shortname}-%{version}/man/man1/ipa-%{shortname}.1  %{buildroot}%{_mandir}/man1/
23f808
install -p -m644 %{_builddir}/%{project}-%{shortname}-%{version}/man/man5/%{longname}.conf.5  %{buildroot}%{_mandir}/man5/
23f808
95d978
(cd %{buildroot}/%{python3_sitelib}/ipahealthcheck && find . -type f  | \
95d978
    grep -v '^./core' | \
95d978
    grep -v 'opt-1' | \
95d978
    sed -e 's,\.py.*$,.*,g' | sort -u | \
95d978
    sed -e 's,\./,%%{python3_sitelib}/ipahealthcheck/,g' ) >healthcheck.list
23f808
23f808
%post
23f808
%systemd_post ipa-%{shortname}.service
23f808
23f808
23f808
%preun
23f808
%systemd_preun ipa-%{shortname}.service
23f808
23f808
23f808
%postun
23f808
%systemd_postun_with_restart ipa-%{shortname}.service
23f808
23f808
95d978
%files -f healthcheck.list
23f808
%{!?_licensedir:%global license %%doc}
23f808
%license COPYING
23f808
%doc README.md
23f808
%{_bindir}/ipa-%{shortname}
23f808
%dir %{_sysconfdir}/%{longname}
23f808
%dir %{_localstatedir}/log/ipa/%{shortname}
23f808
%config(noreplace) %{_sysconfdir}/%{longname}/%{longname}.conf
23f808
%config(noreplace) %{_sysconfdir}/logrotate.d/%{longname}
23f808
%{python3_sitelib}/%{longname}-%{version}-*.egg-info/
23f808
%{python3_sitelib}/%{longname}-%{version}-*-nspkg.pth
23f808
%{_unitdir}/*
23f808
%{_libexecdir}/*
23f808
%{_mandir}/man1/*
23f808
%{_mandir}/man5/*
23f808
95d978
%files -n %{name}-core
95d978
%{!?_licensedir:%global license %%doc}
95d978
%license COPYING
95d978
%doc README.md
95d978
%{python3_sitelib}/%{longname}/core/
95d978
23f808
23f808
%changelog
fa6708
* Wed Aug 19 2020 Rob Crittenden <rcritten@redhat.com> - 0.4-6
fa6708
- The core subpackage can be installed standalone, drop the Requires
fa6708
  on the base package. (#1852244)
fa6708
- Add Conflicts < 0.4 to to core to allow downgrading with
fa6708
  --allowerasing (#1852244)
fa6708
fa6708
* Tue Aug  4 2020 Rob Crittenden <rcritten@redhat.com> - 0.4-5
fa6708
- Remove the Obsoletes < 0.4 and add same-version Requires to each
fa6708
  subpackage so that upgrades from 0.3 will work (#1852244)
fa6708
95d978
* Thu Jan 16 2020 Rob Crittenden <rcritten@redhat.com> - 0.4-4
95d978
- Allow plugins to read contents from config during initialization (#1784037)
95d978
95d978
* Thu Dec  5 2019 Rob Crittenden <rcritten@redhat.com> - 0.4-3
95d978
- Add Obsoletes to core subpackage (#1780121)
95d978
95d978
* Mon Dec  2 2019 Rob Crittenden <rcritten@redhat.com> - 0.4-2
95d978
- Abstract processing so core package is standalone (#1771710)
95d978
95d978
* Mon Dec  2 2019 Rob Crittenden <rcritten@redhat.com> - 0.4-1
95d978
- Rebase to upstream 0.4 (#1770346)
95d978
- Create subpackage to split out core processing (#1771710)
95d978
- Correct URL (#1773512)
95d978
- Errors not translated to strings (#1752849)
95d978
- JSON output not indented by default (#1729043)
95d978
- Add dependencies to checks to avoid false-positives (#1727900)
95d978
- Verify expected DNS records (#1695125)
95d978
23f808
* Mon Aug 12 2019 Rob Crittenden <rcritten@redhat.com> - 0.3-4
23f808
- Lookup AD user by SID and not by hardcoded username (#1739500)
23f808
23f808
* Thu Aug  8 2019 Rob Crittenden <rcritten@redhat.com> - 0.3-3
23f808
- The AD trust agent and controller are not being initialized (#1738314)
23f808
23f808
* Mon Aug  5 2019 Rob Crittenden <rcritten@redhat.com> - 0.3-2
23f808
- Change DNA plugin to return WARNING if no range is set (#1737492)
23f808
23f808
* Mon Jul 29 2019 François Cami <fcami@redhat.com> - 0.3-1
23f808
- Update to upstream 0.3 (#1701351)
23f808
- Add logrotate configs + depend on anacron and logrotate (#1729207)
23f808
23f808
* Thu Jul 11 2019 François Cami <fcami@redhat.com> - 0.2-4
23f808
- Fix ipa-healthcheck.sh installation path (rhbz#1729188)
23f808
- Create and own log directory (rhbz#1729188)
23f808
23f808
* Tue Apr 30 2019 François Cami <fcami@redhat.com> - 0.2-3
23f808
- Add python3-lib389 to BRs
23f808
23f808
* Tue Apr 30 2019 François Cami <fcami@redhat.com> - 0.2-2
23f808
- Fix changelog
23f808
23f808
* Thu Apr 25 2019 Rob Crittenden <rcritten@redhat.com> - 0.2-1
23f808
- Update to upstream 0.2
23f808
23f808
* Thu Apr 4 2019 François Cami <fcami@redhat.com> - 0.1-2
23f808
- Explicitly list dependencies
23f808
23f808
* Tue Apr 2 2019 François Cami <fcami@redhat.com> - 0.1-1
23f808
- Initial package import