%global crate aws-nitro-enclaves-nsm-api Name: libnsm Version: 0.5.1 Release: %{autorelease} Summary: C library for AWS Nitro Secure Module (NSM) API License: Apache-2.0 URL: https://github.com/aws/%{crate} Source0: %{url}/archive/v%{version}/%{crate}-%{version}.tar.gz BuildRequires: cargo-rpm-macros BuildRequires: make BuildRequires: patchelf BuildRequires: (crate(libc/default) >= 0.2.0 with crate(libc/default) < 0.3.0~) %global _description %{expand: C library for Nitro Secure Module (NSM).} %description %{summary}. %package devel Summary: Header files and library for libnsm development Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The libnsm-devel package containes the library and headers needed to develop programs that use the libnsm Nitro Secure Module (NSM) C library. # The static library is required by the libkrun-awsnitro init binary. The init # binary runs as an initramfs within constrained environments and requires # libnsm before a root file system (and thus a libnsm shared library) is # available. %package static Summary: Header files and static library for libnsm development Requires: %{name}-devel%{?_isa} = %{version}-%{release} %description static The libnsm-static package contains the static version of the libsnm Nitro Secure Module (NSM) C library. %prep %autosetup -n %{crate}-%{version} %{cargo_prep} %generate_buildrequires %cargo_generate_buildrequires %build %make_build nsm-lib %install %make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} INCLUDEDIR=%{_includedir} STATIC=1 %files %license LICENSE %{_libdir}/libnsm.so.%{version} %{_libdir}/libnsm.so.0 %files devel %{_includedir}/nsm.h %{_libdir}/pkgconfig/libnsm.pc %{_libdir}/libnsm.so %files static %{_libdir}/libnsm.a %changelog %{autochangelog}