I have to create 3 RPMs like this:
- key.rpm : Does an rpm import of the RPM GPG public key(/etc/sw-key/gpg.key) in it's post-install script.
- software1.rpm : Requires key.rpm and signed by /etc/sw-key/gpg.key's private key.
- software2.rpm : Requires key.rpm and signed by /etc/sw-key/gpg.key's private key.
The intention behind the above is, I want to install all the 3 RPMs at once using the DNF with gpgcheck enabled. The dependancy created above, would allow the key.rpm to get installed first and then followed by the installation of the remaining 2 RPMs. But, the installation of the key.rpm itself fails because I am doing an "rpm --import" in it's post-install script. The rpm import is failing to acquire a transaction lock. I understand that the post-install script is called within the context of the main RPM command and hence the rpm import is failing while acquiring the lock.
Is there any other way to achieve what I am trying to do above? I want to install all the signed RPMs in a single DNF command, with one among those RPMs carrying and installing the RPM GPG key needed by others.