File nitro-enclave-alive.spec of Package nitro-enclave-alive

# SPDX-License-Identifier: MIT
#
# Nitro Enclave Alive tool
# Copyright (c) 2024 Alexander Graf
#

Name:           nitro-enclave-alive
Version:        1.0
Release:        0%{?dist}
Summary:        Nitro Enclave Alive Tool

License:        MIT
URL:            https://example.com
Source0:        nitro-enclave-alive.c
Source1:        Makefile
Source2:        nitro-enclave-alive.service

BuildRequires:  gcc
BuildRequires:  make
BuildRequires:  systemd-rpm-macros
%{?systemd_ordering}

%description
Nitro Enclave Alive Tool establishes a vsock connection to CID 3 port 9000
and submits the byte 0xb7. It waits until it receives 0xb7 as response
and then exits successfully.

Add this tool to your boot environment when you want to run as a Nitro
Enclave. It is not necessary inside the parent.

%prep
%setup -q -c -T

%build
cp %SOURCE0 .
cp %SOURCE1 .
cp %SOURCE2 .
%make_build

%install
%make_install

%post
%systemd_post nitro-enclave-alive.service

%preun
%systemd_preun nitro-enclave-alive.service

%postun
%systemd_postun nitro-enclave-alive.service

%files
%{_bindir}/nitro-enclave-alive
%{_unitdir}/nitro-enclave-alive.service

%changelog
* Wed Sep 11 2024 Neal Gompa <neal@gompa.dev> - 1.0
- Replace SUSE-isms with portable packaging constructs

* Tue Aug 19 2024 Alexander Graf <graf@amazon.com> - 1.0
- Initial release
openSUSE Build Service is sponsored by