Christian Glombek 9778fb8
Name:               greenboot
20789e3
Version:            0.11
20789e3
Release:            1%{?dist}
Christian Glombek 9778fb8
Summary:            Generic Health Check Framework for systemd
Christian Glombek 9778fb8
License:            LGPLv2+
3c21b9a
c130f13
%global repo_owner  fedora-iot
3c21b9a
%global repo_name   %{name}
3c21b9a
%global repo_tag    v%{version}
3c21b9a
3c21b9a
URL:                https://github.com/%{repo_owner}/%{repo_name}
3c21b9a
Source0:            https://github.com/%{repo_owner}/%{repo_name}/archive/%{repo_tag}.tar.gz
Christian Glombek 9778fb8
Christian Glombek 9778fb8
BuildArch:          noarch
3c21b9a
BuildRequires:      systemd-rpm-macros
Christian Glombek 9778fb8
%{?systemd_requires}
Christian Glombek 9778fb8
Requires:           systemd
Christian Glombek 9778fb8
Christian Glombek 9778fb8
%description
Christian Glombek 9778fb8
%{summary}.
Christian Glombek 9778fb8
420646f
%package auto-update-fallback
420646f
Summary:            Automatic updates and failure fallback for rpm-ostree-based system 
420646f
Requires:           %{name} = %{version}-%{release}
420646f
Requires:           %{name}-reboot = %{version}-%{release}
420646f
Requires:           %{name}-rpm-ostree-grub2 = %{version}-%{release}
420646f
420646f
%description auto-update-fallback
420646f
%{summary}.
420646f
3c21b9a
%package status
Christian Glombek 9778fb8
Summary:            Message of the Day updater for greenboot
Christian Glombek 9778fb8
Requires:           %{name} = %{version}-%{release}
420646f
# PAM is required to programatically read motd messages from /etc/motd.d/*
3c21b9a
Requires:           pam >= 1.3.1-15
420646f
# While not strictly necessary to generate the motd, the main use-case of this package is to display it on SSH login
420646f
Recommends:         openssh
Christian Glombek 9778fb8
3c21b9a
%description status
Christian Glombek 9778fb8
%{summary}.
Christian Glombek 9778fb8
420646f
%package rpm-ostree-grub2
420646f
Summary:            Scripts for greenboot on rpm-ostree-based systems using the Grub2 bootloader
Christian Glombek 9778fb8
Requires:           %{name} = %{version}-%{release}
Christian Glombek 9778fb8
Requires:           %{name}-grub2 = %{version}-%{release}
42e641c
Requires:           rpm-ostree
Christian Glombek 9778fb8
420646f
%description rpm-ostree-grub2
Christian Glombek 9778fb8
%{summary}.
Christian Glombek 9778fb8
Christian Glombek 9778fb8
%package grub2
Christian Glombek 9778fb8
Summary:            Grub2 specific scripts for greenboot
Christian Glombek 9778fb8
Requires:           %{name} = %{version}-%{release}
42e641c
Requires:           grub2-tools-minimal
Christian Glombek 9778fb8
Christian Glombek 9778fb8
%description grub2
Christian Glombek 9778fb8
%{summary}.
Christian Glombek 9778fb8
Christian Glombek 9778fb8
%package reboot
Christian Glombek 9778fb8
Summary:            Reboot on red status for greenboot
Christian Glombek 9778fb8
Requires:           %{name} = %{version}-%{release}
Christian Glombek 9778fb8
Christian Glombek 9778fb8
%description reboot
Christian Glombek 9778fb8
%{summary}.
Christian Glombek 9778fb8
Christian Glombek 9778fb8
%prep
42e641c
%setup -q
Christian Glombek 9778fb8
Christian Glombek 9778fb8
%build
Christian Glombek 9778fb8
Christian Glombek 9778fb8
%install
c130f13
mkdir -p %{buildroot}%{_exec_prefix}/lib/motd.d/
c130f13
mkdir -p %{buildroot}%{_libexecdir}/%{name}
Christian Glombek 9778fb8
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/check/required.d
Christian Glombek 9778fb8
mkdir    %{buildroot}%{_sysconfdir}/%{name}/check/wanted.d
Christian Glombek 9778fb8
mkdir    %{buildroot}%{_sysconfdir}/%{name}/green.d
Christian Glombek 9778fb8
mkdir    %{buildroot}%{_sysconfdir}/%{name}/red.d
420646f
mkdir -p %{buildroot}%{_unitdir}
c130f13
mkdir -p %{buildroot}%{_tmpfilesdir}
c130f13
install -DpZm 0755 usr/libexec/greenboot/* %{buildroot}%{_libexecdir}/%{name}
420646f
install -DpZm 0644 usr/lib/motd.d/boot-status %{buildroot}%{_exec_prefix}/lib/motd.d/boot-status
420646f
install -DpZm 0644 usr/lib/systemd/system/* %{buildroot}%{_unitdir}
420646f
install -DpZm 0644 usr/lib/tmpfiles.d/greenboot-status-motd.conf %{buildroot}%{_tmpfilesdir}/greenboot-status-motd.conf
420646f
install -DpZm 0755 etc/greenboot/check/required.d/* %{buildroot}%{_sysconfdir}/%{name}/check/required.d
420646f
install -DpZm 0755 etc/greenboot/check/wanted.d/* %{buildroot}%{_sysconfdir}/%{name}/check/wanted.d
Christian Glombek 9778fb8
Christian Glombek 9778fb8
%post
Christian Glombek 9778fb8
%systemd_post greenboot-healthcheck.service
59cb840
%systemd_post greenboot-task-runner.service
59cb840
%systemd_post redboot-task-runner.service
420646f
%systemd_post redboot.target
420646f
420646f
%post grub2
420646f
%systemd_post greenboot-grub2-set-counter.service
420646f
%systemd_post greenboot-grub2-set-success.service
420646f
420646f
%post reboot
420646f
%systemd_post redboot-auto-reboot.service
420646f
420646f
%post rpm-ostree-grub2
420646f
%systemd_post greenboot-rpm-ostree-grub2-check-fallback.service
Christian Glombek 9778fb8
3c21b9a
%post status
3c21b9a
%systemd_post greenboot-status.service
Christian Glombek 5328322
Christian Glombek 9778fb8
%preun
Christian Glombek 9778fb8
%systemd_preun greenboot-healthcheck.service
59cb840
%systemd_preun greenboot-task-runner.service
59cb840
%systemd_preun redboot-task-runner.service
420646f
%systemd_preun redboot.target
420646f
420646f
%preun grub2
420646f
%systemd_preun greenboot-grub2-set-counter.service
420646f
%systemd_preun greenboot-grub2-set-success.service
420646f
420646f
%preun rpm-ostree-grub2
420646f
%systemd_preun greenboot-rpm-ostree-grub2-check-fallback.service
Christian Glombek 9778fb8
3c21b9a
%preun status
3c21b9a
%systemd_preun greenboot-status.service
Christian Glombek 5328322
Christian Glombek 9778fb8
%postun
420646f
%systemd_postun greenboot-healthcheck.service
59cb840
%systemd_postun greenboot-task-runner.service
59cb840
%systemd_postun redboot-task-runner.service
420646f
%systemd_postun redboot.target
420646f
420646f
%postun grub2
420646f
%systemd_postun greenboot-grub2-set-counter.service
420646f
%systemd_postun greenboot-grub2-set-success.service
420646f
420646f
%postun rpm-ostree-grub2
420646f
%systemd_postun greenboot-rpm-ostree-grub2-check-fallback.service
Christian Glombek 9778fb8
3c21b9a
%postun status
3c21b9a
%systemd_postun greenboot-status.service
Christian Glombek 5328322
Christian Glombek 9778fb8
%files
Christian Glombek 9778fb8
%doc README.md
Christian Glombek 9778fb8
%license LICENSE
Christian Glombek 9778fb8
%dir %{_libexecdir}/%{name}
3c21b9a
%{_libexecdir}/%{name}/%{name}
Christian Glombek 9778fb8
%{_unitdir}/greenboot-healthcheck.service
59cb840
%{_unitdir}/greenboot-task-runner.service
59cb840
%{_unitdir}/redboot-task-runner.service
420646f
%{_unitdir}/redboot.target
Christian Glombek 9778fb8
%dir %{_sysconfdir}/%{name}
Christian Glombek 9778fb8
%dir %{_sysconfdir}/%{name}/check
Christian Glombek 9778fb8
%dir %{_sysconfdir}/%{name}/check/required.d
Christian Glombek 9778fb8
%{_sysconfdir}/%{name}/check/required.d/00_required_scripts_start.sh
Christian Glombek 9778fb8
%dir %{_sysconfdir}/%{name}/check/wanted.d
Christian Glombek 9778fb8
%{_sysconfdir}/%{name}/check/wanted.d/00_wanted_scripts_start.sh
Christian Glombek 9778fb8
%dir %{_sysconfdir}/%{name}/green.d
Christian Glombek 9778fb8
%dir %{_sysconfdir}/%{name}/red.d
Christian Glombek 9778fb8
3c21b9a
%files status
3c21b9a
%{_exec_prefix}/lib/motd.d/boot-status
3c21b9a
%{_libexecdir}/%{name}/greenboot-status
420646f
%{_tmpfilesdir}/greenboot-status-motd.conf
3c21b9a
%{_unitdir}/greenboot-status.service
Christian Glombek 9778fb8
420646f
%files rpm-ostree-grub2
420646f
%{_libexecdir}/%{name}/greenboot-rpm-ostree-grub2-check-fallback
420646f
%{_unitdir}/greenboot-rpm-ostree-grub2-check-fallback.service
Christian Glombek 9778fb8
Christian Glombek 9778fb8
%files grub2
420646f
%{_libexecdir}/%{name}/greenboot-grub2-set-counter
420646f
%{_unitdir}/greenboot-grub2-set-success.service
420646f
%{_unitdir}/greenboot-grub2-set-counter.service
Christian Glombek 9778fb8
Christian Glombek 9778fb8
%files reboot
c130f13
%{_libexecdir}/%{name}/redboot-auto-reboot
420646f
%{_unitdir}/redboot-auto-reboot.service
Christian Glombek 9778fb8
Christian Glombek 9778fb8
%changelog
20789e3
* Thu Aug 13 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.11.0-1
20789e3
- Update to 0.11.0
06a8329
286f007
* Thu Jun 11 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 0.10.3-2
286f007
- Update changelog
286f007
286f007
* Fri Jun 05 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.10.3-1
286f007
- Update to 0.10.3
286f007
286f007
* Wed Jun 03 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.10.2-1
286f007
- Update to 0.10.2
286f007
286f007
* Wed May 27 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.10-1
286f007
- Update to 0.10
286f007
42e641c
* Mon May 04 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.9-2
42e641c
- Added missing requires to grub2 and rpm-ostree-grub2 packages
42e641c
- Run %%setup quietly
42e641c
c130f13
* Fri Apr 03 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.9-1
c130f13
- Update to v0.9
42e641c
- Update repo_owner
c130f13
b26fc11
* Wed Feb 05 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.8-1
b26fc11
- Update to v0.8
b26fc11
- Add guard against bootlooping in redboot-auto-reboot.service
b26fc11
420646f
* Mon Apr 01 2019 Christian Glombek <lorbus@fedoraproject.org> - 0.7-1
420646f
- Update to v0.7
420646f
- Rename ostree-grub2 subpackage to  rpm-ostree-grub2 to be more explicit
420646f
- Add auto-update-fallback meta subpackage
420646f
3c21b9a
* Wed Feb 13 2019 Christian Glombek <lorbus@fedoraproject.org> - 0.6-1
3c21b9a
- Update to v0.6
3c21b9a
- Integrate with systemd's boot-complete.target
3c21b9a
- Rewrite motd sub-package and rename to status
4709b21
Christian Glombek 5328322
* Fri Oct 19 2018 Christian Glombek <lorbus@fedoraproject.org> - 0.5-1
Christian Glombek 5328322
- Update to v0.5
Christian Glombek 5328322
Christian Glombek 9778fb8
* Tue Oct 02 2018 Christian Glombek <lorbus@fedoraproject.org> - 0.4-2
Christian Glombek 9778fb8
- Spec Review
Christian Glombek 9778fb8
Christian Glombek 9778fb8
* Thu Jun 14 2018 Christian Glombek <lorbus@fedoraproject.org> - 0.4-1
Christian Glombek 9778fb8
- Initial Package