@@ -78,6 +78,8 @@ impl Default for WindowUrl {
78
78
pub enum BundleType {
79
79
/// The debian bundle (.deb).
80
80
Deb ,
81
+ /// The RPM bundle (.rpm).
82
+ Rpm ,
81
83
/// The AppImage bundle (.appimage).
82
84
AppImage ,
83
85
/// The Microsoft Installer bundle (.msi).
@@ -99,6 +101,7 @@ impl Display for BundleType {
99
101
"{}" ,
100
102
match self {
101
103
Self :: Deb => "deb" ,
104
+ Self :: Rpm => "rpm" ,
102
105
Self :: AppImage => "appimage" ,
103
106
Self :: Msi => "msi" ,
104
107
Self :: Nsis => "nsis" ,
@@ -127,6 +130,7 @@ impl<'de> Deserialize<'de> for BundleType {
127
130
let s = String :: deserialize ( deserializer) ?;
128
131
match s. to_lowercase ( ) . as_str ( ) {
129
132
"deb" => Ok ( Self :: Deb ) ,
133
+ "rpm" => Ok ( Self :: Rpm ) ,
130
134
"appimage" => Ok ( Self :: AppImage ) ,
131
135
"msi" => Ok ( Self :: Msi ) ,
132
136
"nsis" => Ok ( Self :: Nsis ) ,
@@ -284,6 +288,49 @@ pub struct DebConfig {
284
288
pub changelog : Option < PathBuf > ,
285
289
}
286
290
291
+ /// Configuration for RPM bundles.
292
+ #[ skip_serializing_none]
293
+ #[ derive( Debug , PartialEq , Eq , Clone , Deserialize , Serialize ) ]
294
+ #[ cfg_attr( feature = "schema" , derive( JsonSchema ) ) ]
295
+ #[ serde( rename_all = "camelCase" , deny_unknown_fields) ]
296
+ pub struct RpmConfig {
297
+ /// The package's license identifier. If not set, defaults to the license from
298
+ /// the Cargo.toml file.
299
+ pub license : Option < String > ,
300
+ /// The list of RPM dependencies your application relies on.
301
+ pub depends : Option < Vec < String > > ,
302
+ /// The RPM release tag.
303
+ #[ serde( default = "default_release" ) ]
304
+ pub release : String ,
305
+ /// The RPM epoch.
306
+ #[ serde( default ) ]
307
+ pub epoch : u32 ,
308
+ /// The files to include on the package.
309
+ #[ serde( default ) ]
310
+ pub files : HashMap < PathBuf , PathBuf > ,
311
+ /// Path to a custom desktop file Handlebars template.
312
+ ///
313
+ /// Available variables: `categories`, `comment` (optional), `exec`, `icon` and `name`.
314
+ pub desktop_template : Option < PathBuf > ,
315
+ }
316
+
317
+ impl Default for RpmConfig {
318
+ fn default ( ) -> Self {
319
+ Self {
320
+ license : None ,
321
+ depends : None ,
322
+ release : default_release ( ) ,
323
+ epoch : 0 ,
324
+ files : Default :: default ( ) ,
325
+ desktop_template : None ,
326
+ }
327
+ }
328
+ }
329
+
330
+ fn default_release ( ) -> String {
331
+ "1" . into ( )
332
+ }
333
+
287
334
fn de_minimum_system_version < ' de , D > ( deserializer : D ) -> Result < Option < String > , D :: Error >
288
335
where
289
336
D : Deserializer < ' de > ,
@@ -681,7 +728,7 @@ pub struct BundleConfig {
681
728
/// Whether Tauri should bundle your application or just output the executable.
682
729
#[ serde( default ) ]
683
730
pub active : bool ,
684
- /// The bundle targets, currently supports ["deb", "appimage", "nsis", "msi", "app", "dmg", "updater"] or "all".
731
+ /// The bundle targets, currently supports ["deb", "rpm", " appimage", "nsis", "msi", "app", "dmg", "updater"] or "all".
685
732
#[ serde( default ) ]
686
733
pub targets : BundleTarget ,
687
734
/// The application identifier in reverse domain name notation (e.g. `com.tauri.example`).
@@ -719,6 +766,9 @@ pub struct BundleConfig {
719
766
/// Configuration for the Debian bundle.
720
767
#[ serde( default ) ]
721
768
pub deb : DebConfig ,
769
+ /// Configuration for the RPM bundle.
770
+ #[ serde( default ) ]
771
+ pub rpm : RpmConfig ,
722
772
/// Configuration for the macOS bundles.
723
773
#[ serde( rename = "macOS" , default ) ]
724
774
pub macos : MacConfig ,
@@ -3546,6 +3596,7 @@ mod build {
3546
3596
let long_description = quote ! ( None ) ;
3547
3597
let appimage = quote ! ( Default :: default ( ) ) ;
3548
3598
let deb = quote ! ( Default :: default ( ) ) ;
3599
+ let rpm = quote ! ( Default :: default ( ) ) ;
3549
3600
let macos = quote ! ( Default :: default ( ) ) ;
3550
3601
let external_bin = opt_vec_str_lit ( self . external_bin . as_ref ( ) ) ;
3551
3602
let windows = & self . windows ;
@@ -3565,6 +3616,7 @@ mod build {
3565
3616
long_description,
3566
3617
appimage,
3567
3618
deb,
3619
+ rpm,
3568
3620
macos,
3569
3621
external_bin,
3570
3622
windows
@@ -4007,6 +4059,7 @@ mod test {
4007
4059
long_description : None ,
4008
4060
appimage : Default :: default ( ) ,
4009
4061
deb : Default :: default ( ) ,
4062
+ rpm : Default :: default ( ) ,
4010
4063
macos : Default :: default ( ) ,
4011
4064
external_bin : None ,
4012
4065
windows : Default :: default ( ) ,
0 commit comments