[Rpm-maint] [rpm-software-management/rpm] directive to provided file by RPM but keep file after RPM uninstallation? (Discussion #2520)
realsobek
notifications at github.com
Mon May 22 15:21:46 UTC 2023
Hi,
is there an RPM directive that tells RPM to leave a file in place (even if it is unchanged), when the RPM that provided the file is uninstalled? I want to use it for distribution of a custom support script (setup and introduction of/for new users in their session) with RPM (no configuration management system present). I searched for a SPEC directive no avail:
http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html
https://rpm-software-management.github.io/rpm/manual/spec.html
https://docs.fedoraproject.org/en-US/packaging-guidelines/AutoProvidesAndRequiresFiltering/
config and ghost were the best I could find, but they do not match my requirements.
I am inexperienced with creation of RPM files. I got it to work with a custom SPEC file, RPM package that:
- defines "%global FILE4 /usr/local/NAME.bash" below the SPEC header
- uses %{FILE4}.temp:
````
%install
mkdir -p %{buildroot}/usr/local
install -m 0755 /.../NAME.bash %{buildroot}%{FILE4}.temp
%files
%{FILE4}.temp
````
- in "%post -p /bin/bash" section runs:
````
if [[ "%{FILE4}.temp" -nt "%{FILE4}" ]]; then
mv "%{FILE4}.temp" "%{FILE4}"
fi
````
to write only on updates, and make sure the file remains in place even when the RPM is uninstalled.
It is OK if you say this does not exist and will not be implemented. Thank you for your input. :)
Would this be better served with a configuration management system (Ansible, ...)? For on-site and off-site clients?
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/2520
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/repo-discussions/2520 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230522/7700715c/attachment-0001.html>
More information about the Rpm-maint
mailing list