RPM
Esta página aún no está disponible en tu idioma.
Packaging for RPM
This guide covers how to distribute and manage RPM packages, including retrieving package information, configuring scripts, setting dependencies, and signing packages.
Configuring the RPM package
Tauri allows you to configure the RPM package by adding scripts, setting dependencies, adding a license, including custom files, and more. For detailed information about configurable options, please refer to: RpmConfig.
Add post, pre-install/remove script to the package
The RPM package manager allows you to run scripts before or after the installation or removal of the package. For example, you can use these scripts to start a service after the package is installed.
Here’s an example of how to add these scripts:
- Create a folder named
scripts
in thesrc-tauri
directory in your project.
- Create the script files in the folder.
Now if we look inside /src-tauri/scripts
we will see:
- Add some content to the scripts
- Add the scripts to the
tauri.conf.json
file
Setting the Conflict, Provides, Depends, Files, Obsoletes, DesktopTemplate, and Epoch
-
conflict: Prevents the installation of the package if it conflicts with another package. For example, if you update an RPM package that your app depends on and the new version is incompatible with your app.
-
provides: Lists the RPM dependencies that your application provides.
-
depends: Lists the RPM dependencies that your application needs to run.
-
files: Specifies which files to include in the package.
-
obsoletes: Lists the RPM dependencies that your application obsoletes.
-
desktopTemplate: Adds a custom desktop file to the package.
-
epoch: Defines weighted dependencies based on version numbers.
To use these options, add the following to your tauri.conf.json
:
Add a license to the package
To add a license to the package, add the following to the src-tauri/cargo.toml
or in the src-tauri/tauri.conf.json
file:
And for src-tauri/tauri.conf.json
Building the RPM package
To build the RPM package, you can use the following command:
This command will build the RPM package in the src-tauri/target/release/bundle/rpm
directory.
Signing the RPM package
Tauri allows you to sign the package with the key you have in your system during the build process. To do this, you will need to generate a GPG key.
Generate a GPG key
To generate a GPG key you can use the following command:
Follow the instruction to generate the key.
Once the key is generated, you will need to add it to your environment variable. You can do this by adding the following to your .bashrc or .zshrc file or just export it in the terminal:
If you have a passphrase for the key, you can add it to the environment variable:
Now you can build the package with the following command:
Verify the signature
Before verifying the signature, you will need to create and import the public key to the RPM database:
Now that the key is imported, we have to edit the ~/.rpmmacros
file to utilize the key.
Finally, you can verify the package using the following command:
Debugging the RPM package
In this section, we will see how to debug the RPM package by checking the content of the package and getting information about the package.
Getting information about the package
To get information about your package, such as the version, release, and architecture, use the following command:
Query specific information about the package
For example, if you want to get the name, version, release, architecture, and size of the package, use the following command:
Checking the content of the package
To check the content of the package, use the following command:
This command will list all the files that are included in the package.
Debugging scripts
To debug post/pre-install/remove scripts, use the following command:
This command will print the content of the scripts.
Checking dependencies
To check the dependencies of the package, use the following command:
List packages that depend on a specific package
To list the packages that depend on a specific package, use the following command:
Debugging Installation Issues
If you encounter issues during the installation of an RPM package,
you can use the -vv
(very verbose) option to get detailed output:
Or for an already installed package:
© 2024 Tauri Contributors. CC-BY / MIT