-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,10 +57,21 @@ install -m 644 %{_builddir}/files/securedrop-release-signing-pubkey-2021.asc %{b | |
/etc/yum.repos.d/securedrop-workstation-dom0.repo | ||
|
||
%post | ||
# TODO | ||
# If installing: import key | ||
# If upgrading: remove key from rpm and reimport key | ||
# If removing: remove key from rpm | ||
# New install | ||
if [ $1 -eq 1 ] ; then | ||
systemd-run --on-active=2min rpm --import /etc/pki/rpm-gpg/RPM-GPG-securedrop-workstation ||: | ||
fi | ||
# Upgrade. Uninstall old key then install new key | ||
if [ $1 -gt 1 ] ; then | ||
systemd-run --on-active=2min rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n' | grep 'SecureDrop Release Signing Key' | cut -f1 | xargs sudo rpm -e ||: | ||
systemd-run --on-active=2min rpm --import /etc/pki/rpm-gpg/RPM-GPG-securedrop-workstation ||: | ||
fi | ||
|
||
%posttrans | ||
# Uninstall | ||
if [ $1 -eq 0 ] ; then | ||
systemd-run --on-active=2min rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n' | grep 'SecureDrop Release Signing Key' | cut -f1 | xargs sudo rpm -e ||: | ||
fi | ||
|
||
%changelog | ||
* Mon Dec 2 2024 13:12:00 SecureDrop Team <[email protected]> - 0.1.0 | ||
|