Blame keylime.spec

dbd4687
%global srcname keylime
dbd4687
dbd4687
Name:    keylime
f24e892
Version: 6.4.0
07fa712
Release: 1%{?dist}
dbd4687
Summary: Open source TPM software for Bootstrapping and Maintaining Trust
dbd4687
dbd4687
BuildArch:      noarch
dbd4687
dbd4687
URL:            https://github.com/keylime/keylime
1295186
Source0:        https://github.com/keylime/keylime/archive/refs/tags/v%{version}.tar.gz
1295186
dbd4687
# Main program: BSD
dbd4687
# Icons: MIT
bb12acf
License: ASL 2.0 and MIT
dbd4687
1295186
BuildRequires: git-core
dbd4687
BuildRequires: swig
dbd4687
BuildRequires: openssl-devel
dbd4687
BuildRequires: python3-devel
d1fb6d8
BuildRequires: python3-dbus
1295186
BuildRequires: python3-setuptools
dbd4687
BuildRequires: systemd-rpm-macros
dbd4687
1295186
Requires: python3-%{srcname} = %{version}-%{release}
1295186
Requires: %{srcname}-base = %{version}-%{release}
1295186
Requires: %{srcname}-verifier = %{version}-%{release}
1295186
Requires: %{srcname}-registrar = %{version}-%{release}
1295186
Requires: %{srcname}-tenant = %{version}-%{release}
1295186
Requires: %{srcname}-webapp = %{version}-%{release}
1295186
Requires: %{srcname}-tools = %{version}-%{release}
1295186
1295186
# Agent.
1295186
Requires: keylime-agent
1295186
Suggests: python3-%{srcname}-agent
1295186
1295186
# Conflicts with the monolithic versions of the package, before the split.
1295186
Conflicts: keylime < 6.3.0-3
1295186
1295186
%{?python_enable_dependency_generator}
1295186
%description
1295186
Keylime is a TPM based highly scalable remote boot attestation
1295186
and runtime integrity measurement solution.
1295186
1295186
%package base
1295186
Summary: The base package contains the default configuration
1295186
License: MIT
1295186
2e877b5
# Conflicts with the monolithic versions of the package, before the split.
2e877b5
Conflicts: keylime < 6.3.0-3
2e877b5
1295186
Requires(pre): shadow-utils
1295186
Requires: efivar-libs
dbd4687
Requires: procps-ng
1295186
Requires: tpm2-tss
1295186
Requires: tpm2-tools
1295186
1295186
1295186
%description base
1295186
The base package contains the Keylime default configuration
1295186
1295186
%package -n python3-%{srcname}
1295186
Summary: The Python Keylime module
1295186
License: MIT
1295186
2e877b5
# Conflicts with the monolithic versions of the package, before the split.
2e877b5
Conflicts: keylime < 6.3.0-3
2e877b5
1295186
Requires: %{srcname}-base = %{version}-%{release}
1295186
%{?python_provide:%python_provide python3-%{srcname}}
1295186
1295186
1295186
%description -n python3-%{srcname}
1295186
The python3-keylime module implements the functionality used
1295186
by Keylime components.
1295186
1295186
%package verifier
1295186
Summary: The Python Keylime Verifier component
1295186
License: MIT
1295186
2e877b5
# Conflicts with the monolithic versions of the package, before the split.
2e877b5
Conflicts: keylime < 6.3.0-3
1295186
1295186
Requires: %{srcname}-base = %{version}-%{release}
1295186
Requires: python3-%{srcname} = %{version}-%{release}
1295186
1295186
Requires: python3-tornado
1295186
Requires: python3-sqlalchemy
1295186
Requires: python3-alembic
1295186
Requires: python3-cryptography
1295186
Requires: python3-pyyaml
1295186
Requires: python3-packaging
1295186
Requires: python3-requests
1295186
Requires: python3-zmq
1295186
Requires: python3-gnupg
f24e892
Requires: python3-lark-parser
1295186
1295186
1295186
%description verifier
1295186
The Keylime Verifier continuously verifies the integrity state
1295186
of the machine that the agent is running on.
1295186
1295186
%package registrar
1295186
Summary: The Keylime Registrar component
1295186
License: MIT
2e877b5
2e877b5
# Conflicts with the monolithic versions of the package, before the split.
2e877b5
Conflicts: keylime < 6.3.0-3
2e877b5
1295186
Requires: %{srcname}-base = %{version}-%{release}
1295186
Requires: python3-%{srcname} = %{version}-%{release}
1295186
1295186
Requires: python3-tornado
1295186
Requires: python3-sqlalchemy
d1fb6d8
Requires: python3-alembic
1295186
Requires: python3-cryptography
1295186
Requires: python3-pyyaml
1295186
Requires: python3-packaging
1295186
Requires: python3-requests
1295186
Requires: python3-zmq
abc6f58
Requires: python3-gnupg
f24e892
Requires: python3-lark-parser
1295186
1295186
1295186
%description registrar
1295186
The Keylime Registrar is a database of all agents registered
1295186
with Keylime and hosts the public keys of the TPM vendors.
1295186
1295186
%package -n python3-%{srcname}-agent
1295186
Summary: The Python Keylime Agent
1295186
License: MIT
1295186
2e877b5
# Conflicts with the monolithic versions of the package, before the split.
2e877b5
Conflicts: keylime < 6.3.0-3
2e877b5
1295186
Requires: %{srcname}-base = %{version}-%{release}
1295186
Requires: python3-%{srcname} = %{version}-%{release}
1295186
1295186
# Virtual Provides to support swapping between Python and Rust implementation.
1295186
Provides:  keylime-agent
1295186
Conflicts: keylime-agent
1295186
1295186
Requires: python3-psutil
1295186
Requires: python3-tornado
1295186
Requires: python3-cryptography
dbd4687
Requires: python3-pyyaml
1295186
Requires: python3-packaging
1295186
Requires: python3-requests
1295186
Requires: python3-zmq
1295186
Requires: python3-gnupg
f24e892
Requires: python3-lark-parser
1295186
1295186
1295186
%description -n python3-%{srcname}-agent
1295186
The Keylime Agent is deployed to the remote machine that is to be
1295186
measured or provisioned with secrets stored within an encrypted
1295186
payload released once trust is established.
1295186
1295186
%package tenant
1295186
Summary: The Python Keylime Tenant
1295186
License: MIT
1295186
2e877b5
# Conflicts with the monolithic versions of the package, before the split.
2e877b5
Conflicts: keylime < 6.3.0-3
2e877b5
1295186
Requires: %{srcname}-base = %{version}-%{release}
1295186
Requires: python3-%{srcname} = %{version}-%{release}
1295186
1295186
1295186
%description tenant
1295186
The Keylime Tenant can be used to provision a Keylime Agent.
1295186
1295186
%package webapp
1295186
Summary: The Python Keylime WebApp GUI
1295186
License: MIT
1295186
2e877b5
# Conflicts with the monolithic versions of the package, before the split.
2e877b5
Conflicts: keylime < 6.3.0-3
2e877b5
1295186
Requires: %{srcname}-base = %{version}-%{release}
1295186
Requires: python3-%{srcname} = %{version}-%{release}
1295186
1295186
Requires: python3-tornado
dbd4687
Requires: python3-cryptography
1295186
Requires: python3-pyyaml
1295186
Requires: python3-packaging
1295186
Requires: python3-requests
1295186
Requires: python3-zmq
1295186
Requires: python3-gnupg
1295186
2e877b5
# Conflicts with the monolithic versions of the package, before the split.
2e877b5
Conflicts: keylime < 6.3.0-3
2e877b5
1295186
1295186
%description webapp
1295186
The Keylime WebApp GUI interface can be used to provision a Keylime Agent.
1295186
1295186
%package tools
1295186
Summary: Keylime tools
1295186
License: MIT
1295186
2e877b5
# Conflicts with the monolithic versions of the package, before the split.
2e877b5
Conflicts: keylime < 6.3.0-3
2e877b5
1295186
Requires: %{srcname}-base = %{version}-%{release}
1295186
Requires: python3-%{srcname} = %{version}-%{release}
1295186
dbd4687
Requires: python3-tornado
1295186
Requires: python3-cryptography
1295186
Requires: python3-pyyaml
1295186
Requires: python3-packaging
dbd4687
Requires: python3-requests
dbd4687
Requires: python3-zmq
1295186
Requires: python3-gnupg
dbd4687
1295186
1295186
%description tools
1295186
The keylime tools package includes tools like the IMA emulator.
dbd4687
dbd4687
%prep
1295186
%autosetup -S git -n %{srcname}-%{version}
dbd4687
dbd4687
%build
dbd4687
%py3_build
dbd4687
dbd4687
%install
dbd4687
%py3_install
1295186
mkdir -p %{buildroot}/%{_sharedstatedir}/%{srcname}
1295186
mkdir -p --mode=0700 %{buildroot}/%{_rundir}/%{srcname}
1295186
mkdir -p --mode=0700 %{buildroot}/%{_localstatedir}/log/%{srcname}
dbd4687
5e00802
# Setting up the agent to use keylime user/group.
5e00802
sed -e 's/^run_as.*/run_as = %{srcname}:%{srcname}/g' -i %{srcname}.conf
07fa712
install -Dpm 600 %{srcname}.conf \
dbd4687
    %{buildroot}%{_sysconfdir}/%{srcname}.conf
dbd4687
07fa712
install -Dpm 644 ./services/%{srcname}_agent.service \
dbd4687
    %{buildroot}%{_unitdir}/%{srcname}_agent.service
dbd4687
5e00802
install -Dpm 644 ./services/%{srcname}_agent_secure.mount \
5e00802
    %{buildroot}%{_unitdir}/%{srcname}_agent_secure.mount
5e00802
07fa712
install -Dpm 644 ./services/%{srcname}_verifier.service \
dbd4687
    %{buildroot}%{_unitdir}/%{srcname}_verifier.service
dbd4687
07fa712
install -Dpm 644 ./services/%{srcname}_registrar.service \
dbd4687
    %{buildroot}%{_unitdir}/%{srcname}_registrar.service
dbd4687
563905a
cp -r ./tpm_cert_store %{buildroot}%{_sharedstatedir}/keylime/
563905a
1295186
%pre base
1295186
getent group %{srcname} >/dev/null || groupadd -r %{srcname} &>/dev/null
1295186
getent passwd %{srcname} >/dev/null || \
1295186
     useradd -r -g %{srcname} -d %{_localstatedir}/lib/%{srcname} -s /usr/sbin/nologin \
1295186
     -c "Keylime agent unprivileged user" %{srcname} &>/dev/null
1295186
# Add keylime user to tss group.
1295186
if getent group tss >/dev/null && ! groups %{srcname} | grep -q "\btss\b"; then
1295186
    usermod -a -G tss %{srcname} &>/dev/null
1295186
fi
5e00802
exit 0
5e00802
5e00802
%posttrans base
5e00802
[ -f %{_sysconfdir}/%{srcname}.conf ] && \
f24e892
    chmod 600 %{_sysconfdir}/%{srcname}.conf && \
f24e892
    chown %{srcname} %{_sysconfdir}/%{srcname}.conf
f24e892
[ -d %{_sharedstatedir}/%{srcname} ] && \
f24e892
    chown -R %{srcname} %{_sharedstatedir}/%{srcname}/
f24e892
[ -d %{_localstatedir}/log/%{srcname} ] && \
f24e892
    chown -R %{srcname} %{_localstatedir}/log/%{srcname}/
1295186
exit 0
dbd4687
1295186
%post verifier
1295186
%systemd_post %{srcname}_verifier.service
dbd4687
1295186
%post registrar
1295186
%systemd_post %{srcname}_registrar.service
dbd4687
1295186
%post -n python3-%{srcname}-agent
1295186
%systemd_post %{srcname}_agent.service
1295186
1295186
%preun verifier
1295186
%systemd_preun %{srcname}_verifier.service
1295186
1295186
%preun registrar
1295186
%systemd_preun %{srcname}_registrar.service
1295186
1295186
%preun -n python3-%{srcname}-agent
1295186
%systemd_preun %{srcname}_agent.service
1295186
1295186
%postun verifier
1295186
%systemd_postun_with_restart %{srcname}_verifier.service
1295186
1295186
%postun registrar
1295186
%systemd_postun_with_restart %{srcname}_registrar.service
1295186
1295186
%postun -n python3-%{srcname}-agent
1295186
%systemd_postun_with_restart %{srcname}_agent.service
1295186
1295186
%files verifier
1295186
%license LICENSE
dbd4687
%{_bindir}/%{srcname}_verifier
1295186
%{_bindir}/%{srcname}_ca
1295186
%{_bindir}/%{srcname}_migrations_apply
1295186
%{_unitdir}/keylime_verifier.service
1295186
1295186
%files registrar
1295186
%license LICENSE
dbd4687
%{_bindir}/%{srcname}_registrar
1295186
%{_unitdir}/keylime_registrar.service
1295186
1295186
%files -n python3-%{srcname}-agent
1295186
%license LICENSE
dbd4687
%{_bindir}/%{srcname}_agent
5e00802
%{_unitdir}/%{srcname}_agent.service
5e00802
%{_unitdir}/%{srcname}_agent_secure.mount
1295186
%{_bindir}/%{srcname}_ima_emulator
1295186
1295186
%files tenant
1295186
%license LICENSE
dbd4687
%{_bindir}/%{srcname}_tenant
1295186
1295186
%files webapp
1295186
%license LICENSE
1295186
%{_bindir}/%{srcname}_webapp
1295186
1295186
%files -n python3-%{srcname}
1295186
%license LICENSE
1295186
%{python3_sitelib}/%{srcname}-*.egg-info/
1295186
%{python3_sitelib}/%{srcname}
1295186
1295186
%files tools
1295186
%license LICENSE
dbd4687
%{_bindir}/%{srcname}_userdata_encrypt
1295186
1295186
%files base
1295186
%license LICENSE keylime/static/icons/ICON-LICENSE
1295186
%doc README.md
1295186
%config(noreplace) %attr(600,%{srcname},%{srcname}) %{_sysconfdir}/%{srcname}.conf
1295186
%attr(700,%{srcname},%{srcname}) %dir %{_rundir}/%{srcname}
1295186
%attr(700,%{srcname},%{srcname}) %dir %{_localstatedir}/log/%{srcname}
1295186
%attr(700,%{srcname},%{srcname}) %{_sharedstatedir}/%{srcname}
1295186
1295186
%files
1295186
%license LICENSE
dbd4687
dbd4687
%changelog
f24e892
* Wed May 04 2022 Sergio Correia <scorreia@redhat.com> - 6.4.0-1
f24e892
- Updating for Keylime release v6.4.0
f24e892
5e00802
* Wed Apr 06 2022 Sergio Correia <scorreia@redhat.com> - 6.3.2-1
5e00802
- Updating for Keylime release v6.3.2
5e00802
07fa712
* Mon Feb 14 2022 Sergio Correia <scorreia@redhat.com> - 6.3.1-1
07fa712
- Updating for Keylime release v6.3.1
07fa712
2e877b5
* Tue Feb 08 2022 Sergio Correia <scorreia@redhat.com> - 6.0.3-4
2e877b5
- Add Conflicts clauses for the subpackages
2e877b5
1295186
* Mon Feb 07 2022 Sergio Correia <scorreia@redhat.com> - 6.3.0-3
1295186
- Split keylime into subpackages
1295186
  Related: rhbz#2045874 - Keylime subpackaging and agent alternatives
1295186
616454e
* Thu Jan 27 2022 Sergio Correia <scorreia@redhat.com> - 6.3.0-2
616454e
- Fix permissions of config file
616454e
727405f
* Thu Jan 27 2022 Sergio Correia <scorreia@redhat.com> - 6.3.0-1
727405f
- Updating for Keylime release v6.3.0
727405f
c361f2c
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 6.1.0-5
c361f2c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
c361f2c
00a241e
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.1.0-4
00a241e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
00a241e
05dc419
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 6.1.0-3
05dc419
- Rebuilt for Python 3.10
05dc419
abc6f58
* Thu Mar 25 2021 Luke Hinds <lhinds@redhat.com> 6.0.1-1
abc6f58
- Updating for Keylime release v6.1.0
abc6f58
d63e4f1
* Wed Mar 03 2021 Luke Hinds <lhinds@redhat.com> 6.0.1-1
d63e4f1
- Updating for Keylime release v6.0.1
d63e4f1
5fafaed
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 6.0.0-2
5fafaed
- Rebuilt for updated systemd-rpm-macros
5fafaed
  See https://pagure.io/fesco/issue/2583.
5fafaed
4ecb4ea
* Wed Feb 24 2021 Luke Hinds <lhinds@redhat.com> 6.0.0-1
4ecb4ea
- Updating for Keylime release v6.0.0
4ecb4ea
23a0237
* Tue Feb 02 2021 Luke Hinds <lhinds@redhat.com> 5.8.1-1
23a0237
- Updating for Keylime release v5.8.1
23a0237
f52f1ae
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.8.0-2
f52f1ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
f52f1ae
d1fb6d8
* Sat Jan 23 2021 Luke Hinds <lhinds@redhat.com> 5.8.0-1
d1fb6d8
- Updating for Keylime release v5.8.0
066f1bf
bb12acf
* Fri Jul 17 2020 Luke Hinds <lhinds@redhat.com> 5.7.2-1
bb12acf
- Updating for Keylime release v5.7.2
bb12acf
bb12acf
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 5.6.2-2
bb12acf
- Rebuilt for Python 3.9
bb12acf
368e70c
* Fri May 01 2020 Luke Hinds <lhinds@redhat.com> 5.6.2-1
368e70c
- Updating for Keylime release v5.6.2
368e70c
563905a
* Thu Feb 06 2020 Luke Hinds <lhinds@redhat.com> 5.5.0-1
563905a
- Updating for Keylime release v5.5.0
563905a
ecd4116
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.1-2
ecd4116
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
ecd4116
dbd4687
* Thu Dec 12 2019 Luke Hinds <lhinds@redhat.com> 5.4.1-1
dbd4687
– Initial Packaging