fix(rpm): use product name for output package (#9974)

* fix(rpm): use product name for output package

ref: https://github.com/tauri-apps/tauri/pull/9375
ref: https://github.com/tauri-apps/tauri/pull/9375#issuecomment-2144997488

* use kebab-case product-name for rpm

* fmt
This commit is contained in:
Amr Bashir
2024-06-05 19:57:32 +03:00
committed by GitHub
parent 27abecd6e5
commit de7da04a62
2 changed files with 10 additions and 3 deletions

View File

@@ -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.

View File

@@ -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;
@@ -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");
@@ -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%.