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