Skip to content

Commit

Permalink
fix(rpm): use product name for output package (#9974)
Browse files Browse the repository at this point in the history
* fix(rpm): use product name for output package

ref: #9375
ref: #9375 (comment)

* use kebab-case product-name for rpm

* fmt
  • Loading branch information
amrbashir authored Jun 5, 2024
1 parent 27abecd commit de7da04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changes/bundler-rpm-filename.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"tauri-bundler": "patch:bug"
---

Use the `productName` for `rpm` package name instead of main binary name, to be consistent with other bundle types.

7 changes: 4 additions & 3 deletions tooling/bundler/src/bundle/linux/rpm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use super::freedesktop;
/// Bundles the project.
/// Returns a vector of PathBuf that shows where the RPM was created.
pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
let name = settings.main_binary_name();
let product_name = settings.product_name();
let version = settings.version_string();
let release = settings.rpm().release.as_str();
let epoch = settings.rpm().epoch;
Expand All @@ -30,7 +30,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {

let summary = settings.short_description().trim();

let package_base_name = format!("{name}-{version}-{release}.{arch}");
let package_base_name = format!("{product_name}-{version}-{release}.{arch}");
let package_name = format!("{package_base_name}.rpm");

let base_dir = settings.project_out_directory().join("bundle/rpm");
Expand All @@ -45,7 +45,8 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
log::info!(action = "Bundling"; "{} ({})", package_name, package_path.display());

let license = settings.license().unwrap_or_default();
let mut builder = rpm::PackageBuilder::new(name, version, &license, arch, summary)
let name = heck::AsKebabCase(settings.product_name()).to_string();
let mut builder = rpm::PackageBuilder::new(&name, version, &license, arch, summary)
.epoch(epoch)
.release(release)
// This matches .deb compression. On a 240MB source binary the bundle will be 100KB larger than rpm's default while reducing build times by ~25%.
Expand Down

0 comments on commit de7da04

Please sign in to comment.