File ec2-hibernate-linux-agent.spec of Package ec2-hibernate-linux-agent
#
# spec file for ec2-hibernate-linux-agent
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: ec2-hibernate-linux-agent
Version: 1.0.0
Release: 0
Summary: Hibernating Agent for Linux on Amazon EC2
Group: System/Management
License: MIT
URL: https://github.com/aws/ec2-hibernate-linux-agent
Source0: ec2-hibernate-linux-agent-%{version}.zip
Source1: ec2-hibernate-linux-agent.service
Patch0: ehla_handle-missing-grub-legacy.patch
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: unzip
BuildRequires: systemd-rpm-macros
BuildArch: noarch
%description
Hibernating Agent for Linux on Amazon EC2
This agent does several things:
1. Upon startup it checks for sufficient swap space to allow hibernate
and fails if it's present but there's not enough of it.
2. If there's no swap space, it creates it and launches a background
thread to touch all of its blocks to make sure that EBS volumes
are pre-warmed.
3. It updates the offset of the swap file in the kernel using
SNAPSHOT_SET_SWAP_AREA ioctl.
4. It daemonizes and starts a polling thread to listen for instance
termination notifications.
%prep
%setup -q -n ec2-hibernate-linux-agent-%{version}
%patch0 -p1
%build
python3 setup.py build
%install
python3 setup.py install --root=%{buildroot} --prefix=%{_prefix} --install-lib=%{python3_sitelib}
install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/ec2-hibernate-linux-agent.service
rm -rf %{buildroot}/%{_sysconfdir}/init.d/hibagent
%pre
%service_add_pre ec2-hibernate-linux-agent.service
%post
%service_add_post ec2-hibernate-linux-agent.service
%preun
%service_del_preun ec2-hibernate-linux-agent.service
%postun
%service_del_postun ec2-hibernate-linux-agent.service
%files
%defattr(-,root,root)
%doc README.md
%license LICENSE.txt
%{_sysconfdir}/hibagent-config.cfg
%{_bindir}/hibagent
%{_bindir}/enable-ec2-spot-hibernation
%{_unitdir}/ec2-hibernate-linux-agent.service
%{python3_sitelib}/*
%changelog