@@ -78,6 +78,8 @@ impl Default for WindowUrl {
7878pub enum BundleType {
7979 /// The debian bundle (.deb).
8080 Deb ,
81+ /// The RPM bundle (.rpm).
82+ Rpm ,
8183 /// The AppImage bundle (.appimage).
8284 AppImage ,
8385 /// The Microsoft Installer bundle (.msi).
@@ -99,6 +101,7 @@ impl Display for BundleType {
99101 "{}" ,
100102 match self {
101103 Self :: Deb => "deb" ,
104+ Self :: Rpm => "rpm" ,
102105 Self :: AppImage => "appimage" ,
103106 Self :: Msi => "msi" ,
104107 Self :: Nsis => "nsis" ,
@@ -127,6 +130,7 @@ impl<'de> Deserialize<'de> for BundleType {
127130 let s = String :: deserialize ( deserializer) ?;
128131 match s. to_lowercase ( ) . as_str ( ) {
129132 "deb" => Ok ( Self :: Deb ) ,
133+ "rpm" => Ok ( Self :: Rpm ) ,
130134 "appimage" => Ok ( Self :: AppImage ) ,
131135 "msi" => Ok ( Self :: Msi ) ,
132136 "nsis" => Ok ( Self :: Nsis ) ,
@@ -282,6 +286,49 @@ pub struct DebConfig {
282286 pub desktop_template : Option < PathBuf > ,
283287}
284288
289+ /// Configuration for RPM bundles.
290+ #[ skip_serializing_none]
291+ #[ derive( Debug , PartialEq , Eq , Clone , Deserialize , Serialize ) ]
292+ #[ cfg_attr( feature = "schema" , derive( JsonSchema ) ) ]
293+ #[ serde( rename_all = "camelCase" , deny_unknown_fields) ]
294+ pub struct RpmConfig {
295+ /// The package's license identifier. If not set, defaults to the license from
296+ /// the Cargo.toml file.
297+ pub license : Option < String > ,
298+ /// The list of RPM dependencies your application relies on.
299+ pub depends : Option < Vec < String > > ,
300+ /// The RPM release tag.
301+ #[ serde( default = "default_release" ) ]
302+ pub release : String ,
303+ /// The RPM epoch.
304+ #[ serde( default ) ]
305+ pub epoch : u32 ,
306+ /// The files to include on the package.
307+ #[ serde( default ) ]
308+ pub files : HashMap < PathBuf , PathBuf > ,
309+ /// Path to a custom desktop file Handlebars template.
310+ ///
311+ /// Available variables: `categories`, `comment` (optional), `exec`, `icon` and `name`.
312+ pub desktop_template : Option < PathBuf > ,
313+ }
314+
315+ impl Default for RpmConfig {
316+ fn default ( ) -> Self {
317+ Self {
318+ license : None ,
319+ depends : None ,
320+ release : default_release ( ) ,
321+ epoch : 0 ,
322+ files : Default :: default ( ) ,
323+ desktop_template : None ,
324+ }
325+ }
326+ }
327+
328+ fn default_release ( ) -> String {
329+ "1" . into ( )
330+ }
331+
285332/// Position coordinates struct.
286333#[ derive( Default , Debug , PartialEq , Eq , Clone , Deserialize , Serialize ) ]
287334#[ cfg_attr( feature = "schema" , derive( JsonSchema ) ) ]
@@ -885,7 +932,7 @@ pub struct BundleConfig {
885932 /// Whether Tauri should bundle your application or just output the executable.
886933 #[ serde( default ) ]
887934 pub active : bool ,
888- /// The bundle targets, currently supports ["deb", "appimage", "nsis", "msi", "app", "dmg", "updater"] or "all".
935+ /// The bundle targets, currently supports ["deb", "rpm", " appimage", "nsis", "msi", "app", "dmg", "updater"] or "all".
889936 #[ serde( default ) ]
890937 pub targets : BundleTarget ,
891938 /// The application identifier in reverse domain name notation (e.g. `com.tauri.example`).
@@ -925,6 +972,9 @@ pub struct BundleConfig {
925972 /// Configuration for the Debian bundle.
926973 #[ serde( default ) ]
927974 pub deb : DebConfig ,
975+ /// Configuration for the RPM bundle.
976+ #[ serde( default ) ]
977+ pub rpm : RpmConfig ,
928978 /// DMG-specific settings.
929979 #[ serde( default ) ]
930980 pub dmg : DmgConfig ,
@@ -2518,6 +2568,7 @@ mod build {
25182568 let long_description = quote ! ( None ) ;
25192569 let appimage = quote ! ( Default :: default ( ) ) ;
25202570 let deb = quote ! ( Default :: default ( ) ) ;
2571+ let rpm = quote ! ( Default :: default ( ) ) ;
25212572 let dmg = quote ! ( Default :: default ( ) ) ;
25222573 let macos = quote ! ( Default :: default ( ) ) ;
25232574 let external_bin = opt_vec_str_lit ( self . external_bin . as_ref ( ) ) ;
@@ -2542,6 +2593,7 @@ mod build {
25422593 long_description,
25432594 appimage,
25442595 deb,
2596+ rpm,
25452597 dmg,
25462598 macos,
25472599 external_bin,
@@ -2851,6 +2903,7 @@ mod test {
28512903 long_description : None ,
28522904 appimage : Default :: default ( ) ,
28532905 deb : Default :: default ( ) ,
2906+ rpm : Default :: default ( ) ,
28542907 dmg : Default :: default ( ) ,
28552908 macos : Default :: default ( ) ,
28562909 external_bin : None ,
0 commit comments