diff --git a/.gitignore b/.gitignore index 40388b4..cecc6aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /freeipa-healthcheck-0.1.tar.gz +/freeipa-healthcheck-0.2.tar.gz diff --git a/0001-add-ipahealthcheck.ipa-package.patch b/0001-add-ipahealthcheck.ipa-package.patch deleted file mode 100644 index 362c29d..0000000 --- a/0001-add-ipahealthcheck.ipa-package.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/setup.py b/setup.py -index d8c80f6..d350e04 100644 ---- a/setup.py -+++ b/setup.py -@@ -9,7 +9,8 @@ setup( - packages=[ - 'ipahealthcheck.core', - 'ipahealthcheck.dogtag', -- 'ipahealthcheck.ipa' -+ 'ipahealthcheck.ipa', -+ 'ipahealthcheck.meta' - ], - entry_points={ - # creates bin/ipahealthcheck diff --git a/0002-installutils_realm_to_serverid.patch b/0002-installutils_realm_to_serverid.patch deleted file mode 100644 index fece6ac..0000000 --- a/0002-installutils_realm_to_serverid.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/src/ipahealthcheck/ipa/plugin.py b/src/ipahealthcheck/ipa/plugin.py -index 5c540b2..3a735f6 100644 ---- a/src/ipahealthcheck/ipa/plugin.py -+++ b/src/ipahealthcheck/ipa/plugin.py -@@ -3,7 +3,7 @@ - # - - from ipalib import api, errors --from ipapython.ipaldap import realm_to_serverid -+#from ipapython.ipaldap import realm_to_serverid - from ipaserver.install import cainstance - from ipaserver.install import dsinstance - from ipaserver.install import httpinstance -@@ -20,7 +20,7 @@ class IPAPlugin(Plugin): - host_name=api.env.host) - self.http = httpinstance.HTTPInstance() - self.ds = dsinstance.DsInstance() -- self.serverid = realm_to_serverid(api.env.realm) -+ self.serverid = installutils.realm_to_serverid(api.env.realm) - self.conn = api.Backend.ldap2 - - diff --git a/freeipa-healthcheck.spec b/freeipa-healthcheck.spec index 1f6e339..d2e14ad 100644 --- a/freeipa-healthcheck.spec +++ b/freeipa-healthcheck.spec @@ -1,6 +1,3 @@ -# remaining issues -# * man page for ipa-healthcheck - %global project freeipa %global shortname healthcheck %global longname ipa%{shortname} @@ -10,20 +7,25 @@ Name: %{project}-%{shortname} -Version: 0.1 -Release: 2%{?dist} +Version: 0.2 +Release: 1%{?dist} Summary: Health check tool for FreeIPA BuildArch: noarch License: GPLv3 URL: https://github.com/%{project}/%{name} Source0: https://github.com/%{project}/%{name}/archive/release-%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: %{longname}.conf -Patch0: 0001-add-ipahealthcheck.ipa-package.patch -Patch1: 0002-installutils_realm_to_serverid.patch Requires: freeipa-server Requires: python3-ipalib Requires: python3-ipaserver +Requires(post): systemd-units BuildRequires: python3-devel +BuildRequires: systemd-devel +%{?systemd_requires} +# packages for make check +BuildRequires: python3-pytest-runner +BuildRequires: python3-ipalib +BuildRequires: python3-ipaserver %description @@ -32,7 +34,7 @@ proactively detect defects in a FreeIPA cluster. %prep -%autosetup -p1 -n %{project}-%{shortname}-release-%{version} +%autosetup -p1 -n %{project}-%{shortname}-%{version} %build @@ -43,12 +45,32 @@ proactively detect defects in a FreeIPA cluster. %py3_install mkdir -p %{buildroot}%{_sysconfdir}/%{longname} install -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{longname} +mkdir -p %{buildroot}/%{_unitdir} +install -p -m755 %{_builddir}/%{project}-%{shortname}-%{version}/systemd/ipa-%{shortname}.service %{buildroot}%{_unitdir} +install -p -m755 %{_builddir}/%{project}-%{shortname}-%{version}/systemd/ipa-%{shortname}.timer %{buildroot}%{_unitdir} +mkdir -p %{buildroot}/%{_libexecdir} +install -p -m755 %{_builddir}/%{project}-%{shortname}-%{version}/systemd/ipa-%{shortname}.sh %{buildroot}%{_libexecdir}/ + +mkdir -p %{buildroot}/%{_mandir}/man1 +mkdir -p %{buildroot}/%{_mandir}/man5 +install -p -m755 %{_builddir}/%{project}-%{shortname}-%{version}/man/man1/ipa-%{shortname}.1 %{buildroot}%{_mandir}/man1/ +install -p -m755 %{_builddir}/%{project}-%{shortname}-%{version}/man/man5/%{longname}.conf.5 %{buildroot}%{_mandir}/man5/ %check %{__python3} setup.py test +%post +%systemd_post ipa-%{shortname}.service + +%preun +%systemd_preun ipa-%{shortname}.service + +%postun +%systemd_postun_with_restart ipa-%{shortname}.service + + %files %{!?_licensedir:%global license %%doc} %license COPYING @@ -59,9 +81,16 @@ install -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{longname} %{python3_sitelib}/%{longname}/ %{python3_sitelib}/%{longname}-%{version}-*.egg-info/ %{python3_sitelib}/%{longname}-%{version}-*-nspkg.pth +%{_unitdir}/* +%{_libexecdir}/* +%{_mandir}/man1/* +%{_mandir}/man5/* %changelog +* Wed Apr 25 2019 Rob Crittenden - 0.2-1 +- Update to upstream 0.2 + * Thu Apr 4 2019 François Cami - 0.1-2 - Explicitly list dependencies diff --git a/sources b/sources index 4a66cc6..1fa5a5d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (freeipa-healthcheck-0.1.tar.gz) = 943c9778b2062876d1b812963787845c0acccf03034bc17039e2b4bc49f65c799ed121d009f6cef4abc3de71feafe0a23890d09df07c9e782d9fce401db0ac0c +SHA512 (freeipa-healthcheck-0.2.tar.gz) = f2a7fc840ed9ffaa1d771dbfb4be130cc3bd3feebe9e926512d1f105619d355f7c1e741c7fd9066b710985e7c4a3d4617407ffa8c97c58e286db8382d8969cc2