2021-05-06 15:06:32 +00:00
|
|
|
#
|
|
|
|
# spec file for package rust-keylime
|
|
|
|
#
|
2022-03-04 17:16:17 +00:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2021-05-06 15:06:32 +00:00
|
|
|
#
|
|
|
|
# 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 https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
%global rustflags '-Clink-arg=-Wl,-z,relro,-z,now'
|
2022-07-15 13:19:45 +00:00
|
|
|
# Consolidate _distconfdir and _sysconfdir
|
|
|
|
%if 0%{?_distconfdir:1}
|
|
|
|
%define _config_norepl %{nil}
|
|
|
|
%else
|
|
|
|
%define _distconfdir %{_sysconfdir}
|
|
|
|
%define _config_norepl %config(noreplace)
|
|
|
|
%endif
|
2021-05-06 15:06:32 +00:00
|
|
|
Name: rust-keylime
|
2022-08-10 15:04:54 +00:00
|
|
|
Version: 0.1.0+git.1659977521.0186093
|
2021-05-06 15:06:32 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Rust implementation of the keylime agent
|
2021-07-28 13:39:06 +00:00
|
|
|
License: Apache-2.0 AND MIT
|
2021-05-06 15:06:32 +00:00
|
|
|
URL: https://github.com/keylime/rust-keylime
|
|
|
|
Source: rust-keylime-%{version}.tar.xz
|
|
|
|
Source1: vendor.tar.xz
|
|
|
|
Source2: cargo_config
|
2022-07-15 13:19:45 +00:00
|
|
|
Source3: keylime.xml
|
|
|
|
Source4: keylime-user.conf
|
|
|
|
Source5: tmpfiles.keylime
|
2022-08-10 15:04:54 +00:00
|
|
|
# PATCH-FIX-OPENSUSE keylime-agent.conf.diff
|
|
|
|
Patch1: keylime-agent.conf.diff
|
|
|
|
# PATCH-FIX-OPENSUSE bindgen.patch
|
|
|
|
Patch2: bindgen.patch
|
2021-05-06 15:06:32 +00:00
|
|
|
BuildRequires: cargo
|
2022-08-10 15:04:54 +00:00
|
|
|
BuildRequires: clang
|
2021-07-28 13:39:06 +00:00
|
|
|
BuildRequires: firewall-macros
|
|
|
|
BuildRequires: libarchive-devel
|
2021-05-06 15:06:32 +00:00
|
|
|
BuildRequires: rust
|
2022-07-15 13:19:45 +00:00
|
|
|
BuildRequires: sysuser-tools
|
2021-05-06 15:06:32 +00:00
|
|
|
BuildRequires: tpm2-0-tss-devel
|
2021-07-28 13:39:06 +00:00
|
|
|
BuildRequires: zeromq-devel
|
2022-06-22 09:04:26 +00:00
|
|
|
Requires: libtss2-tcti-device0
|
|
|
|
Requires: logrotate
|
2022-07-15 13:19:45 +00:00
|
|
|
Requires: tpm2.0-abrmd
|
2021-05-06 15:06:32 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Rust implementation of keylime agent. Keylime is system integrity
|
|
|
|
monitoring system.
|
|
|
|
|
|
|
|
%prep
|
2021-11-25 15:22:45 +00:00
|
|
|
%autosetup -a1 -p1
|
2021-05-06 15:06:32 +00:00
|
|
|
mkdir .cargo
|
|
|
|
cp %{SOURCE2} .cargo/config
|
|
|
|
|
|
|
|
%build
|
2022-06-22 09:04:26 +00:00
|
|
|
RUSTFLAGS=%{rustflags} cargo build --release --no-default-features --features "with-zmq"
|
2022-07-15 13:19:45 +00:00
|
|
|
%sysusers_generate_pre %{SOURCE4} keylime keylime-user.conf
|
2021-05-06 15:06:32 +00:00
|
|
|
|
|
|
|
%install
|
2022-06-22 11:05:42 +00:00
|
|
|
RUSTFLAGS=%{rustflags} cargo install --frozen --no-default-features --features "with-zmq" --root=%{buildroot}%{_prefix} --path .
|
2021-05-06 15:06:32 +00:00
|
|
|
|
2022-07-15 13:19:45 +00:00
|
|
|
# TODO: move the configuration file into _distconfdir
|
2022-08-10 15:04:54 +00:00
|
|
|
install -Dpm 0600 keylime-agent.conf %{buildroot}%{_sysconfdir}/keylime-agent.conf
|
2022-07-15 13:19:45 +00:00
|
|
|
install -Dpm 0644 ./dist/systemd/system/keylime_agent.service %{buildroot}%{_unitdir}/keylime_agent.service
|
|
|
|
install -Dpm 0644 ./dist/systemd/system/var-lib-keylime-secure.mount %{buildroot}%{_unitdir}/var-lib-keylime-secure.mount
|
|
|
|
|
|
|
|
install -Dpm 0644 %{SOURCE3} %{buildroot}%{_prefix}/lib/firewalld/services/keylime.xml
|
|
|
|
install -Dpm 0644 %{SOURCE4} %{buildroot}%{_sysusersdir}/keylime-user.conf
|
|
|
|
install -Dpm 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/keylime.conf
|
2022-06-22 09:04:26 +00:00
|
|
|
install -d %{buildroot}%{_localstatedir}/log/keylime
|
2022-07-15 13:19:45 +00:00
|
|
|
install -d %{buildroot}%{_libexecdir}/keylime
|
2021-05-06 15:06:32 +00:00
|
|
|
|
2022-03-04 17:16:17 +00:00
|
|
|
# Create work directory
|
2022-07-15 13:19:45 +00:00
|
|
|
mkdir -p %{buildroot}%{_sharedstatedir}/keylime
|
2022-03-04 17:16:17 +00:00
|
|
|
|
2021-05-06 15:06:32 +00:00
|
|
|
rm %{buildroot}%{_prefix}/.crates.toml
|
|
|
|
rm %{buildroot}%{_prefix}/.crates2.json
|
|
|
|
|
2021-07-28 13:39:06 +00:00
|
|
|
%pre
|
|
|
|
%service_add_pre keylime_agent.service
|
2022-07-15 13:19:45 +00:00
|
|
|
%service_add_pre var-lib-keylime-secure.mount
|
2021-07-28 13:39:06 +00:00
|
|
|
|
|
|
|
%post
|
|
|
|
%firewalld_reload
|
2022-07-15 13:19:45 +00:00
|
|
|
%tmpfiles_create keylime.conf
|
2021-07-28 13:39:06 +00:00
|
|
|
%service_add_post keylime_agent.service
|
2022-07-15 13:19:45 +00:00
|
|
|
%service_add_post var-lib-keylime-secure.mount
|
2021-07-28 13:39:06 +00:00
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun keylime_agent.service
|
2022-07-15 13:19:45 +00:00
|
|
|
%service_del_preun var-lib-keylime-secure.mount
|
2021-07-28 13:39:06 +00:00
|
|
|
|
|
|
|
%postun
|
|
|
|
%service_del_postun keylime_agent.service
|
2022-07-15 13:19:45 +00:00
|
|
|
%service_del_postun var-lib-keylime-secure.mount
|
2021-07-28 13:39:06 +00:00
|
|
|
|
2021-05-06 15:06:32 +00:00
|
|
|
%files
|
2021-07-28 13:39:06 +00:00
|
|
|
%doc README.md
|
|
|
|
%license LICENSE
|
2021-05-06 15:06:32 +00:00
|
|
|
%{_bindir}/keylime_agent
|
2021-11-25 15:22:45 +00:00
|
|
|
%{_bindir}/keylime_ima_emulator
|
2022-08-10 15:04:54 +00:00
|
|
|
%config(noreplace) %attr (0600,keylime,tss) %{_sysconfdir}/keylime-agent.conf
|
2022-07-15 13:19:45 +00:00
|
|
|
%{_unitdir}/keylime_agent.service
|
|
|
|
%{_unitdir}/var-lib-keylime-secure.mount
|
2021-07-28 13:39:06 +00:00
|
|
|
%dir %{_prefix}/lib/firewalld
|
|
|
|
%dir %{_prefix}/lib/firewalld/services
|
|
|
|
%{_prefix}/lib/firewalld/services/keylime.xml
|
2022-07-15 13:19:45 +00:00
|
|
|
%{_sysusersdir}/keylime-user.conf
|
|
|
|
%{_tmpfilesdir}/keylime.conf
|
|
|
|
%dir %attr(0750,keylime,tss) %{_localstatedir}/log/keylime
|
|
|
|
%dir %attr(0750,keylime,tss) %{_libexecdir}/keylime
|
|
|
|
%dir %attr(0700,keylime,tss) %{_sharedstatedir}/keylime
|
2022-03-04 17:16:17 +00:00
|
|
|
|
2021-05-06 15:06:32 +00:00
|
|
|
%changelog
|