Initial commit
This commit is contained in:
43
rpm/edh-keygen.spec
Normal file
43
rpm/edh-keygen.spec
Normal file
@@ -0,0 +1,43 @@
|
||||
Name: edh-keygen
|
||||
Version: 1.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Automated Diffie-Hellman key generation and service management
|
||||
|
||||
License: MIT
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
Script for automated Diffie-Hellman key generation, service management and flexible key syncing with custom permissions.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}/opt/edh-keygen
|
||||
install -m 750 opt/edh-keygen/edh-keygen.sh %{buildroot}/opt/edh-keygen/
|
||||
install -m 640 opt/edh-keygen/edh-keygen.conf %{buildroot}/opt/edh-keygen/
|
||||
|
||||
# Set permissions explicitly
|
||||
chmod 750 %{buildroot}/opt/edh-keygen
|
||||
|
||||
%preun
|
||||
# If uninstalling (not upgrading)
|
||||
if [ "$1" = 0 ] && ls /opt/edh-keygen/*.local >/dev/null 2>&1; then
|
||||
rm -f /opt/edh-keygen/edh-keygen.sh /opt/edh-keygen/edh-keygen.conf
|
||||
exit 0
|
||||
fi
|
||||
|
||||
%postun
|
||||
rmdir --ignore-fail-on-non-empty /opt/edh-keygen 2>/dev/null || :
|
||||
|
||||
%files
|
||||
%dir %attr(750,root,root) /opt/edh-keygen
|
||||
%attr(750,root,root) /opt/edh-keygen/edh-keygen.sh
|
||||
%attr(640,root,root) /opt/edh-keygen/edh-keygen.conf
|
||||
%ghost /opt/edh-keygen/edh-keygen.local
|
||||
|
||||
%changelog
|
||||
* Sun May 18 2025 Ivo Noack, Stephan Düsterhaupt <mail@opensource-technology.de> - 1.0-1
|
||||
- Initial RPM release with preservation of .local files on uninstall
|
||||
Reference in New Issue
Block a user