Blame SPECS/greenboot.spec

071e4a
%global debug_package %{nil}
071e4a
071e4a
Name:               greenboot
45c341
Version:            0.15.1
45c341
Release:            1%{?dist}
071e4a
Summary:            Generic Health Check Framework for systemd
071e4a
License:            LGPLv2+
071e4a
071e4a
%global repo_owner  fedora-iot
071e4a
%global repo_name   %{name}
071e4a
%global repo_tag    v%{version}
071e4a
071e4a
URL:                https://github.com/%{repo_owner}/%{repo_name}
45c341
Source0:            https://github.com/%{repo_owner}/%{repo_name}/archive/%{repo_tag}.tar.g#/%{name}-%{version}.tar.gz
071e4a
071e4a
ExcludeArch: s390x
071e4a
BuildRequires:      systemd-rpm-macros
071e4a
%{?systemd_requires}
071e4a
Requires:           systemd
bd3d92
Requires:           grub2-tools-minimal
bd3d92
Requires:           rpm-ostree
071e4a
# PAM is required to programatically read motd messages from /etc/motd.d/*
bd3d92
# This causes issues with RHEL-8 as the fix isn't there an el8 is on pam-1.3.x
071e4a
Requires:           pam
071e4a
# While not strictly necessary to generate the motd, the main use-case of this package is to display it on SSH login
071e4a
Recommends:         openssh
bd3d92
Provides:           greenboot-auto-update-fallback
bd3d92
Obsoletes:          greenboot-auto-update-fallback <= 0.12.0
bd3d92
Provides:           greenboot-grub2
bd3d92
Obsoletes:          greenboot-grub2 <= 0.12.0
bd3d92
Provides:           greenboot-reboot
bd3d92
Obsoletes:          greenboot-reboot <= 0.12.0
bd3d92
Provides:           greenboot-status
bd3d92
Obsoletes:          greenboot-status <= 0.12.0
bd3d92
Provides:           greenboot-rpm-ostree-grub2
bd3d92
Obsoletes:          greenboot-rpm-ostree-grub2 <= 0.12.0
071e4a
bd3d92
%description
071e4a
%{summary}.
071e4a
bd3d92
%package default-health-checks
bd3d92
Summary:            Series of optional and curated health checks
071e4a
Requires:           %{name} = %{version}-%{release}
bd3d92
Requires:           util-linux
bd3d92
Requires:           jq
bd3d92
Provides:           greenboot-update-platforms-check
bd3d92
Obsoletes:          greenboot-update-platforms-check <= 0.12.0
071e4a
bd3d92
%description default-health-checks
071e4a
%{summary}.
071e4a
071e4a
%prep
071e4a
%setup -q
071e4a
071e4a
%build
071e4a
071e4a
%install
071e4a
mkdir -p %{buildroot}%{_exec_prefix}/lib/motd.d/
071e4a
mkdir -p %{buildroot}%{_libexecdir}/%{name}
071e4a
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/check/required.d
071e4a
mkdir    %{buildroot}%{_sysconfdir}/%{name}/check/wanted.d
071e4a
mkdir    %{buildroot}%{_sysconfdir}/%{name}/green.d
071e4a
mkdir    %{buildroot}%{_sysconfdir}/%{name}/red.d
bd3d92
mkdir -p %{buildroot}%{_prefix}/lib/%{name}/check/required.d
bd3d92
mkdir    %{buildroot}%{_prefix}/lib/%{name}/check/wanted.d
bd3d92
mkdir    %{buildroot}%{_prefix}/lib/%{name}/green.d
bd3d92
mkdir    %{buildroot}%{_prefix}/lib/%{name}/red.d
071e4a
mkdir -p %{buildroot}%{_unitdir}
bd3d92
mkdir -p %{buildroot}%{_unitdir}/greenboot-healthcheck.service.d
071e4a
mkdir -p %{buildroot}%{_tmpfilesdir}
071e4a
install -DpZm 0755 usr/libexec/greenboot/* %{buildroot}%{_libexecdir}/%{name}
071e4a
install -DpZm 0644 usr/lib/motd.d/boot-status %{buildroot}%{_exec_prefix}/lib/motd.d/boot-status
bd3d92
install -DpZm 0644 usr/lib/systemd/system/greenboot-healthcheck.service.d/10-network-online.conf %{buildroot}%{_unitdir}/greenboot-healthcheck.service.d/10-network-online.conf
bd3d92
install -DpZm 0644 usr/lib/systemd/system/*.target %{buildroot}%{_unitdir}
bd3d92
install -DpZm 0644 usr/lib/systemd/system/*.service %{buildroot}%{_unitdir}
071e4a
install -DpZm 0644 usr/lib/tmpfiles.d/greenboot-status-motd.conf %{buildroot}%{_tmpfilesdir}/greenboot-status-motd.conf
bd3d92
install -DpZm 0755 usr/lib/greenboot/check/required.d/* %{buildroot}%{_prefix}/lib/%{name}/check/required.d
bd3d92
install -DpZm 0755 usr/lib/greenboot/check/wanted.d/* %{buildroot}%{_prefix}/lib/%{name}/check/wanted.d
45c341
install -DpZm 0644 etc/greenboot/greenboot.conf %{buildroot}%{_sysconfdir}/%{name}/greenboot.conf
071e4a
071e4a
%post
071e4a
%systemd_post greenboot-healthcheck.service
bd3d92
%systemd_post greenboot-loading-message.service
071e4a
%systemd_post greenboot-task-runner.service
071e4a
%systemd_post redboot-task-runner.service
071e4a
%systemd_post redboot.target
bd3d92
%systemd_post greenboot-status.service
071e4a
%systemd_post greenboot-grub2-set-counter.service
071e4a
%systemd_post greenboot-grub2-set-success.service
071e4a
%systemd_post greenboot-rpm-ostree-grub2-check-fallback.service
bd3d92
%systemd_post redboot-auto-reboot.service
45c341
%systemd_post greenboot-service-monitor.service
071e4a
bd3d92
%post default-health-checks
bd3d92
%systemd_post greenboot-loading-message.service
071e4a
071e4a
%preun
071e4a
%systemd_preun greenboot-healthcheck.service
bd3d92
%systemd_preun greenboot-loading-message.service
071e4a
%systemd_preun greenboot-task-runner.service
071e4a
%systemd_preun redboot-task-runner.service
071e4a
%systemd_preun redboot.target
bd3d92
%systemd_preun greenboot-status.service
071e4a
%systemd_preun greenboot-grub2-set-counter.service
071e4a
%systemd_preun greenboot-grub2-set-success.service
071e4a
%systemd_preun greenboot-rpm-ostree-grub2-check-fallback.service
45c341
%systemd_preun greenboot-service-monitor.service
071e4a
bd3d92
%preun default-health-checks
bd3d92
%systemd_preun greenboot-loading-message.service
071e4a
071e4a
%postun
071e4a
%systemd_postun greenboot-healthcheck.service
bd3d92
%systemd_postun greenboot-loading-message.service
071e4a
%systemd_postun greenboot-task-runner.service
071e4a
%systemd_postun redboot-task-runner.service
071e4a
%systemd_postun redboot.target
bd3d92
%systemd_postun greenboot-status.service
071e4a
%systemd_postun greenboot-grub2-set-counter.service
071e4a
%systemd_postun greenboot-grub2-set-success.service
071e4a
%systemd_postun greenboot-rpm-ostree-grub2-check-fallback.service
45c341
%systemd_postun greenboot-service-monitor.service
071e4a
bd3d92
%postun default-health-checks
bd3d92
%systemd_postun greenboot-loading-message.service
071e4a
071e4a
%files
071e4a
%doc README.md
071e4a
%license LICENSE
071e4a
%dir %{_libexecdir}/%{name}
071e4a
%{_libexecdir}/%{name}/%{name}
bd3d92
%{_libexecdir}/%{name}/greenboot-loading-message
071e4a
%{_unitdir}/greenboot-healthcheck.service
bd3d92
%{_unitdir}/greenboot-loading-message.service
071e4a
%{_unitdir}/greenboot-task-runner.service
071e4a
%{_unitdir}/redboot-task-runner.service
071e4a
%{_unitdir}/redboot.target
bd3d92
%dir %{_prefix}/lib/%{name}
bd3d92
%dir %{_prefix}/lib/%{name}/check
bd3d92
%dir %{_prefix}/lib/%{name}/check/required.d
bd3d92
%{_prefix}/lib/%{name}/check/required.d/00_required_scripts_start.sh
bd3d92
%dir %{_prefix}/lib/%{name}/check/wanted.d
bd3d92
%{_prefix}/lib/%{name}/check/wanted.d/00_wanted_scripts_start.sh
bd3d92
%dir %{_prefix}/lib/%{name}/green.d
bd3d92
%dir %{_prefix}/lib/%{name}/red.d
071e4a
%dir %{_sysconfdir}/%{name}
071e4a
%dir %{_sysconfdir}/%{name}/check
071e4a
%dir %{_sysconfdir}/%{name}/check/required.d
071e4a
%dir %{_sysconfdir}/%{name}/check/wanted.d
071e4a
%dir %{_sysconfdir}/%{name}/green.d
071e4a
%dir %{_sysconfdir}/%{name}/red.d
071e4a
%{_exec_prefix}/lib/motd.d/boot-status
071e4a
%{_libexecdir}/%{name}/greenboot-status
071e4a
%{_tmpfilesdir}/greenboot-status-motd.conf
071e4a
%{_unitdir}/greenboot-status.service
071e4a
%{_libexecdir}/%{name}/greenboot-grub2-set-counter
071e4a
%{_unitdir}/greenboot-grub2-set-success.service
071e4a
%{_unitdir}/greenboot-grub2-set-counter.service
bd3d92
%{_libexecdir}/%{name}/greenboot-rpm-ostree-grub2-check-fallback
bd3d92
%{_unitdir}/greenboot-rpm-ostree-grub2-check-fallback.service
071e4a
%{_libexecdir}/%{name}/redboot-auto-reboot
071e4a
%{_unitdir}/redboot-auto-reboot.service
45c341
%{_libexecdir}/%{name}/greenboot-service-monitor
45c341
%{_unitdir}/greenboot-service-monitor.service
45c341
%{_sysconfdir}/%{name}/greenboot.conf
071e4a
bd3d92
%files default-health-checks
bd3d92
%{_prefix}/lib/%{name}/check/required.d/01_repository_dns_check.sh
bd3d92
%{_prefix}/lib/%{name}/check/wanted.d/01_update_platforms_check.sh
bd3d92
%{_unitdir}/greenboot-healthcheck.service.d/10-network-online.conf
bd3d92
%{_prefix}/lib/%{name}/check/required.d/02_watchdog.sh
bd3d92
071e4a
%changelog
45c341
* Tue Aug 09 2022 Peter Robinson <pbrobinson@fedoraproject.org> - 0.15.1-1
45c341
- Add conf during installation
45c341
45c341
* Thu Jul 21 2022 Sayan Paul <saypaul@fedoraproject.org> - 0.15.0-1
45c341
- The 0.15.0 release
45c341
- Add service-monitor
45c341
- Resolves: rhbz#2053469
45c341
bd3d92
* Tue Jan 18 2022 Peter Robinson <pbrobinson@fedoraproject.org> - 0.14.0-3
bd3d92
- Obsolete greenboot-status
bd3d92
bd3d92
* Wed Dec 15 2021 Peter Robinson <pbrobinson@redhat.com> - 0.14.0-2
bd3d92
- Fix systemd version
bd3d92
bd3d92
* Thu Nov 18 2021 Packit Service <user-cont-team+packit-service@redhat.com> - 0.14.0-1
bd3d92
- Release 0.14.0 (Peter Robinson)
bd3d92
- Updated testing documentation (Jose Noguera)
bd3d92
- README updated with TOC and improved explanations (Jose Noguera)
bd3d92
- Add watchdog-triggered boot check #2 (Jose Noguera)
bd3d92
- Update specfile and README to reflect changes in subpackage layout. (Jose Noguera)
bd3d92
- Ensure all required health checks are run #52 (Jose Noguera)
bd3d92
bd3d92
* Wed Nov 10 2021 Packit Service <user-cont-team+packit-service@redhat.com> - 0.13.1-1
bd3d92
- tag 0.31.1 (Peter Robinson)
bd3d92
bd3d92
* Mon Jul 26 2021 Jose Noguera <jnoguera@redhat.com> - 0.12.0-1
bd3d92
- Update to 0.12.0
bd3d92
- Add ability to configure maximum number of boot attempts via env var and config file.
bd3d92
- Add How does it work section to README.
bd3d92
- Add CI via GitHub Actions and unit testing with BATS.
bd3d92
- Add update platforms DNS resolutiona and connection checker as health checks out of the box
bd3d92
bd3d92
* Sat Jan 16 2021 Peter Robinson <pbrobinson@fedoraproject.org> - 0.11.0-2
bd3d92
- Make arch specific due to grub availability on s390x
bd3d92
- Resolves: rhbz#1915241
bd3d92
071e4a
* Thu Aug 20 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 0.11-1
071e4a
- Update to 0.11.0
071e4a
- Resolves: rhbz#1815140
071e4a
071e4a
* Thu Jul 23 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 0.10.3-5
071e4a
- Make package arch specific to work around lack of grub2 on s390x
071e4a
- Resolves: rhbz#1815140
071e4a
071e4a
* Thu Jun 11 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 0.10.3-3
071e4a
- Make motd status page optional
071e4a
- Resolves: rhbz#1815140
071e4a
071e4a
* Thu Jun 11 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 0.10.3-2
071e4a
- Update changelog
071e4a
- Resolves: rhbz#1815140
071e4a
071e4a
* Fri Jun 05 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.10.3-1
071e4a
- Update to 0.10.3
071e4a
071e4a
* Wed Jun 03 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.10.2-1
071e4a
- Update to 0.10.2
071e4a
071e4a
* Wed May 27 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.10-1
071e4a
- Update to 0.10
071e4a
071e4a
* Mon May 04 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.9-2
071e4a
- Added missing requires to grub2 and rpm-ostree-grub2 packages
071e4a
- Run %%setup quietly
071e4a
071e4a
* Fri Apr 03 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.9-1
071e4a
- Update to v0.9
071e4a
- Update repo_owner
071e4a
071e4a
* Wed Feb 05 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.8-1
071e4a
- Update to v0.8
071e4a
- Add guard against bootlooping in redboot-auto-reboot.service
071e4a
071e4a
* Mon Apr 01 2019 Christian Glombek <lorbus@fedoraproject.org> - 0.7-1
071e4a
- Update to v0.7
071e4a
- Rename ostree-grub2 subpackage to  rpm-ostree-grub2 to be more explicit
071e4a
- Add auto-update-fallback meta subpackage
071e4a
071e4a
* Wed Feb 13 2019 Christian Glombek <lorbus@fedoraproject.org> - 0.6-1
071e4a
- Update to v0.6
071e4a
- Integrate with systemd's boot-complete.target
071e4a
- Rewrite motd sub-package and rename to status
071e4a
071e4a
* Fri Oct 19 2018 Christian Glombek <lorbus@fedoraproject.org> - 0.5-1
071e4a
- Update to v0.5
071e4a
071e4a
* Tue Oct 02 2018 Christian Glombek <lorbus@fedoraproject.org> - 0.4-2
071e4a
- Spec Review
071e4a
071e4a
* Thu Jun 14 2018 Christian Glombek <lorbus@fedoraproject.org> - 0.4-1
071e4a
- Initial Package