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