f2a40f
%if 0%{?rhel}
f2a40f
%global prefix ipa
f2a40f
%global productname IPA
f2a40f
%global alt_prefix freeipa
f2a40f
%else
f2a40f
# Fedora
f2a40f
%global prefix freeipa
f2a40f
%global productname FreeIPA
f2a40f
%global alt_prefix ipa
f2a40f
%endif
f2a40f
%global debug_package %{nil}
f2a40f
%global python3dir %{_builddir}/python3-%{name}-%{version}-%{release}
f2a40f
%{!?python3_sitelib: %global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
f2a40f
%global alt_name %{alt_prefix}-healthcheck
f2a40f
f2a40f
%bcond_without tests
f2a40f
f2a40f
Name:           %{prefix}-healthcheck
5ff961
Version:        0.12
5ff961
Release:        1%{?dist}
f2a40f
Summary:        Health check tool for %{productname}
f2a40f
BuildArch:      noarch
f2a40f
License:        GPLv3
f2a40f
URL:            https://github.com/freeipa/freeipa-healthcheck
f2a40f
Source0:        https://github.com/freeipa/freeipa-healthcheck/archive/%{version}.tar.gz
f2a40f
Source1:        ipahealthcheck.conf
f2a40f
f2a40f
Patch0001:      0001-Remove-ipaclustercheck.patch
5ff961
Patch0002:      0002-Disable-two-failing-tests.patch
f2a40f
f2a40f
Requires:       %{name}-core = %{version}-%{release}
f2a40f
Requires:       %{prefix}-server
f2a40f
Requires:       python3-ipalib
f2a40f
Requires:       python3-ipaserver
f2a40f
Requires:       python3-lib389 >= 1.4.2.14-1
f2a40f
# cronie-anacron provides anacron
f2a40f
Requires:       anacron
f2a40f
Requires:       logrotate
f2a40f
Requires(post): systemd-units
f2a40f
Requires:       %{name}-core = %{version}-%{release}
f2a40f
BuildRequires:  python3-devel
f2a40f
BuildRequires:  python3-setuptools
f2a40f
BuildRequires:  systemd-devel
f2a40f
%{?systemd_requires}
f2a40f
# packages for make check
f2a40f
%if %{with tests}
f2a40f
BuildRequires:  python3-pytest
f2a40f
BuildRequires:  python3-ipalib
f2a40f
BuildRequires:  python3-ipaserver
f2a40f
%endif
f2a40f
BuildRequires:  python3-lib389
f2a40f
BuildRequires:  python3-libsss_nss_idmap
f2a40f
f2a40f
# Cross-provides for sibling OS
f2a40f
Provides:       %{alt_name} = %{version}
f2a40f
Conflicts:      %{alt_name}
f2a40f
Obsoletes:      %{alt_name} < %{version}
f2a40f
f2a40f
%description
f2a40f
The %{productname} health check tool provides a set of checks to
f2a40f
proactively detect defects in a FreeIPA cluster.
f2a40f
f2a40f
f2a40f
%package -n %{name}-core
f2a40f
Summary: Core plugin system for healthcheck
f2a40f
f2a40f
# Cross-provides for sibling OS
f2a40f
Provides:       %{alt_name}-core = %{version}
f2a40f
Conflicts:      %{alt_name}-core
f2a40f
Obsoletes:      %{alt_name}-core < %{version}
f2a40f
f2a40f
f2a40f
%description -n %{name}-core
f2a40f
Core plugin system for healthcheck, usable standalone with other
f2a40f
packages.
f2a40f
f2a40f
f2a40f
%prep
f2a40f
%autosetup -p1  -n freeipa-healthcheck-%{version}
f2a40f
f2a40f
f2a40f
%build
f2a40f
%py3_build
f2a40f
f2a40f
f2a40f
%install
f2a40f
%py3_install
f2a40f
f2a40f
mkdir -p %{buildroot}%{_sysconfdir}/ipahealthcheck
f2a40f
install -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/ipahealthcheck
f2a40f
f2a40f
mkdir -p %{buildroot}/%{_unitdir}
f2a40f
install -p -m644 %{_builddir}/freeipa-healthcheck-%{version}/systemd/ipa-healthcheck.service %{buildroot}%{_unitdir}
f2a40f
install -p -m644 %{_builddir}/freeipa-healthcheck-%{version}/systemd/ipa-healthcheck.timer %{buildroot}%{_unitdir}
f2a40f
f2a40f
mkdir -p %{buildroot}/%{_libexecdir}/ipa
f2a40f
install -p -m755 %{_builddir}/freeipa-healthcheck-%{version}/systemd/ipa-healthcheck.sh %{buildroot}%{_libexecdir}/ipa/
f2a40f
f2a40f
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
f2a40f
install -p -m644 %{_builddir}/freeipa-healthcheck-%{version}/logrotate/ipahealthcheck %{buildroot}%{_sysconfdir}/logrotate.d
f2a40f
f2a40f
mkdir -p %{buildroot}/%{_localstatedir}/log/ipa/healthcheck
f2a40f
f2a40f
mkdir -p %{buildroot}/%{_mandir}/man8
f2a40f
mkdir -p %{buildroot}/%{_mandir}/man5
f2a40f
install -p -m644 %{_builddir}/freeipa-healthcheck-%{version}/man/man8/ipa-healthcheck.8  %{buildroot}%{_mandir}/man8/
f2a40f
install -p -m644 %{_builddir}/freeipa-healthcheck-%{version}/man/man5/ipahealthcheck.conf.5  %{buildroot}%{_mandir}/man5/
f2a40f
f2a40f
(cd %{buildroot}/%{python3_sitelib}/ipahealthcheck && find . -type f  | \
f2a40f
    grep -v '^./core' | \
f2a40f
    grep -v 'opt-1' | \
f2a40f
    sed -e 's,\.py.*$,.*,g' | sort -u | \
f2a40f
    sed -e 's,\./,%%{python3_sitelib}/ipahealthcheck/,g' ) >healthcheck.list
f2a40f
f2a40f
f2a40f
%if %{with tests}
f2a40f
%check
f2a40f
PYTHONPATH=src PATH=$PATH:$RPM_BUILD_ROOT/usr/bin pytest-3 tests/test_*
f2a40f
%endif
f2a40f
f2a40f
f2a40f
%post
f2a40f
%systemd_post ipa-healthcheck.service
f2a40f
f2a40f
f2a40f
%preun
f2a40f
%systemd_preun ipa-healthcheck.service
f2a40f
f2a40f
f2a40f
%postun
f2a40f
%systemd_postun_with_restart ipa-healthcheck.service
f2a40f
f2a40f
f2a40f
%files -f healthcheck.list
f2a40f
%{!?_licensedir:%global license %%doc}
f2a40f
%license COPYING
f2a40f
%doc README.md
f2a40f
%{_bindir}/ipa-healthcheck
f2a40f
%dir %{_sysconfdir}/ipahealthcheck
f2a40f
%dir %{_localstatedir}/log/ipa/healthcheck
f2a40f
%config(noreplace) %{_sysconfdir}/ipahealthcheck/ipahealthcheck.conf
f2a40f
%config(noreplace) %{_sysconfdir}/logrotate.d/ipahealthcheck
f2a40f
%{python3_sitelib}/ipahealthcheck-%{version}-*.egg-info/
f2a40f
%{python3_sitelib}/ipahealthcheck-%{version}-*-nspkg.pth
f2a40f
%{_unitdir}/*
f2a40f
%{_libexecdir}/*
f2a40f
%{_mandir}/man8/*
f2a40f
%{_mandir}/man5/*
f2a40f
f2a40f
f2a40f
%files -n %{name}-core
f2a40f
%{!?_licensedir:%global license %%doc}
f2a40f
%license COPYING
f2a40f
%doc README.md
f2a40f
%{python3_sitelib}/ipahealthcheck/core/
f2a40f
f2a40f
f2a40f
%changelog
5ff961
* Thu Dec 01 2022 Rob Crittenden <rcritten@redhat.com> - 0.12-1
5ff961
- Update to upstream 0.12 (#2139531)
5ff961
7ff681
* Wed Jul 06 2022 Rob Crittenden <rcritten@redhat.com> - 0.9-9
7ff681
- Add support for the DNS URI type (#2104495)
7ff681
7ff681
* Wed May 18 2022 Rob Crittenden <rcritten@redhat.com> - 0.9-8
7ff681
- Validate that a known output type has been selected (#2079698)
7ff681
7ff681
* Wed May 04 2022 Rob Crittenden <rcritten@redhat.com> - 0.9-7
7ff681
- debug='True' in ipahealthcheck.conf doesn't enable debug output (#2079861)
7ff681
- Validate value formats in the ipahealthcheck.conf file (#2079739)
7ff681
- Validate output_type options from ipahealthcheck.conf file (#2079698)
7ff681
7ff681
* Thu Apr 28 2022 Rob Crittenden <rcritten@redhat.com> - 0.9-6
7ff681
- Allow multiple file modes in the FileChecker (#2072708)
7ff681
7ff681
* Wed Apr 06 2022 Rob Crittenden <rcritten@redhat.com> - 0.9-5
7ff681
- Add CLI options to healthcheck configuration file (#2070981)
7ff681
7ff681
* Wed Mar 30 2022 Rob Crittenden <rcritten@redhat.com> - 0.9-4
7ff681
- Use the subject base from the IPA configuration, not REALM (#2067213) 
7ff681
255cba
* Tue Oct 12 2021 Rob Crittenden <rcritten@redhat.com> - 0.9-3
255cba
- IPATrustControllerServiceCheck doesn't handle HIDDEN_SERVICE (#1976878)
255cba
f2a40f
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.9-2
f2a40f
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
f2a40f
  Related: rhbz#1991688
f2a40f
f2a40f
* Thu Jun 17 2021 Rob Crittenden <rcritten@redhat.com> - 0.9-1
f2a40f
- Rebase to upstream 0.9 (#1969539)
f2a40f
f2a40f
* Thu Apr 22 2021 Rob Crittenden <rcritten@redhat.com> - 0.8-7.2
f2a40f
- rpminspect: specname match on suffix to allow for differing
f2a40f
  spec/package naming (#1951733)
f2a40f
f2a40f
* Mon Apr 19 2021 Rob Crittenden <rcritten@redhat.com> - 0.8-7.1
f2a40f
- Switch from tox to pytest as the test runner. tox is being deprecated
f2a40f
  in some distros. (#1942157)
f2a40f
f2a40f
* Mon Apr 19 2021 Rob Crittenden <rcritten@redhat.com> - 0.8-7
f2a40f
- Add check to validate the KRA Agent is correct (#1894781)
f2a40f
f2a40f
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 0.8-6.1
f2a40f
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
f2a40f
f2a40f
* Fri Mar 12 2021 Alexander Bokovoy <abokovoy@redhat.com> - 0.8-5.1
f2a40f
- Re-enable package self-tests after bootstrap
f2a40f
f2a40f
* Mon Mar  8 2021 François Cami <fcami@redhat.com> - 0.8-5
f2a40f
- Make the spec file distribution-agnostic (rhbz#1935773).
f2a40f
f2a40f
* Tue Mar  2 2021 Alexander Scheel <ascheel@redhat.com> - 0.8-4
f2a40f
- Make the spec file more distribution-agnostic
f2a40f
- Use tox as the test runner when tests are enabled
f2a40f
f2a40f
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-3
f2a40f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
f2a40f
f2a40f
* Mon Jan 18 2021 Rob Crittenden <rcritten@redhat.com> - 0.8-2
f2a40f
- A bad file group was reported as a python list, not a string
f2a40f
f2a40f
* Wed Jan 13 2021 Rob Crittenden <rcritten@redhat.com> - 0.8-1
f2a40f
- Update to upstream 0.8
f2a40f
- Fix FTBFS in F34/rawhide (#1915256)
f2a40f
f2a40f
* Wed Dec 16 2020 Rob Crittenden <rcritten@redhat.com> - 0.7-3
f2a40f
- Include upstream patch to fix parsing input from json files
f2a40f
f2a40f
* Tue Nov 17 2020 Rob Crittenden <rcritten@redhat.com> - 0.7-2
f2a40f
- Include upstream patch to fix collection of AD trust domains
f2a40f
- Include upstream patch to fix failing not-valid-after test
f2a40f
f2a40f
* Thu Oct 29 2020 Rob Crittenden <rcritten@redhat.com> - 0.7-1
f2a40f
- Update to upstream 0.7
f2a40f
f2a40f
* Wed Jul 29 2020 Rob Crittenden <rcritten@redhat.com> - 0.6-4
f2a40f
- Set minimum Requires on python3-lib389
f2a40f
- Don't assume that all users of healthcheck-core provide the same
f2a40f
  set of options.
f2a40f
f2a40f
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-3
f2a40f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
f2a40f
f2a40f
* Fri Jul 24 2020 Rob Crittenden <rcritten@redhat.com> - 0.6-2
f2a40f
- Don't collect IPA servers in MetaCheck
f2a40f
- Skip if dirsrv not available in IPAMetaCheck
f2a40f
f2a40f
* Wed Jul  1 2020 Rob Crittenden <rcritten@redhat.com> - 0.6-1
f2a40f
- Update to upstream 0.6
f2a40f
- Don't include cluster checking yet
f2a40f
f2a40f
* Tue Jun 23 2020 Rob Crittenden <rcritten@redhat.com> - 0.5-5
f2a40f
- Add BuildRequires on python3-setuptools
f2a40f
f2a40f
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.5-4
f2a40f
- Rebuilt for Python 3.9
f2a40f
f2a40f
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-3
f2a40f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
f2a40f
f2a40f
* Mon Jan 27 2020 Rob Crittenden <rcritten@redhat.com> - 0.5-2
f2a40f
- Rebuild
f2a40f
f2a40f
* Thu Jan  2 2020 Rob Crittenden <rcritten@redhat.com> - 0.5-1
f2a40f
- Update to upstream 0.5
f2a40f
f2a40f
* Mon Dec 2 2019 François Cami <fcami@redhat.com> - 0.4-2
f2a40f
- Create subpackage to split out core processing (#1771710)
f2a40f
f2a40f
* Mon Dec 2 2019 François Cami <fcami@redhat.com> - 0.4-1
f2a40f
- Update to upstream 0.4
f2a40f
- Change Source0 to something "spectool -g" can use. 
f2a40f
- Correct URL (#1773512)
f2a40f
- Errors not translated to strings (#1752849)
f2a40f
- JSON output not indented by default (#1729043)
f2a40f
- Add dependencies to checks to avoid false-positives (#1727900)
f2a40f
- Verify expected DNS records (#1695125
f2a40f
f2a40f
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.3-3
f2a40f
- Rebuilt for Python 3.8.0rc1 (#1748018)
f2a40f
f2a40f
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.3-2
f2a40f
- Rebuilt for Python 3.8
f2a40f
f2a40f
* Thu Jul 25 2019 François Cami <fcami@redhat.com> - 0.3-1
f2a40f
- Update to upstream 0.3
f2a40f
- Add logrotate configs + depend on anacron and logrotate
f2a40f
f2a40f
* Thu Jul 25 2019 François Cami <fcami@redhat.com> - 0.2-6
f2a40f
- Fix permissions
f2a40f
f2a40f
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.2-5
f2a40f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
f2a40f
f2a40f
* Thu Jul 11 2019 François Cami <fcami@redhat.com> - 0.2-4
f2a40f
- Fix ipa-healthcheck.sh installation path (rhbz#1729188)
f2a40f
- Create and own log directory (rhbz#1729188)
f2a40f
f2a40f
* Tue Apr 30 2019 François Cami <fcami@redhat.com> - 0.2-3
f2a40f
- Add python3-lib389 to BRs
f2a40f
f2a40f
* Tue Apr 30 2019 François Cami <fcami@redhat.com> - 0.2-2
f2a40f
- Fix changelog
f2a40f
f2a40f
* Thu Apr 25 2019 Rob Crittenden <rcritten@redhat.com> - 0.2-1
f2a40f
- Update to upstream 0.2
f2a40f
f2a40f
* Thu Apr 4 2019 François Cami <fcami@redhat.com> - 0.1-2
f2a40f
- Explicitly list dependencies
f2a40f
f2a40f
* Tue Apr 2 2019 François Cami <fcami@redhat.com> - 0.1-1
f2a40f
- Initial package import