File tree Expand file tree Collapse file tree 4 files changed +25
-1
lines changed
Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 860860 "additionalProperties" : {
861861 "type" : " string"
862862 }
863+ },
864+ "packageName" : {
865+ "description" : " Overwrite package name just for deb." ,
866+ "type" : [
867+ " string" ,
868+ " null"
869+ ]
863870 }
864871 },
865872 "additionalProperties" : false
Original file line number Diff line number Diff line change 860860 "additionalProperties" : {
861861 "type" : " string"
862862 }
863+ },
864+ "packageName" : {
865+ "description" : " Overwrite package name just for deb." ,
866+ "type" : [
867+ " string" ,
868+ " null"
869+ ]
863870 }
864871 },
865872 "additionalProperties" : false
Original file line number Diff line number Diff line change @@ -231,6 +231,9 @@ pub struct DebianConfig {
231231 /// List of custom files to add to the deb package.
232232 /// Maps a dir/file to a dir/file inside the debian package.
233233 pub files : Option < HashMap < String , String > > ,
234+ /// Overwrite package name just for deb.
235+ #[ serde( alias = "package-name" , alias = "package_name" ) ]
236+ pub package_name : Option < String >
234237}
235238
236239impl DebianConfig {
Original file line number Diff line number Diff line change @@ -302,7 +302,14 @@ fn generate_control_file(
302302 // https://www.debian.org/doc/debian-policy/ch-controlfields.html
303303 let dest_path = control_dir. join ( "control" ) ;
304304 let mut file = util:: create_file ( & dest_path) ?;
305- writeln ! ( file, "Package: {}" , AsKebabCase ( & config. product_name) ) ?;
305+
306+ let pkg_name = AsKebabCase ( & config. product_name ) . to_string ( ) ;
307+ let pkg_name: String = config
308+ . deb ( )
309+ . map ( |x| x. package_name . clone ( ) . unwrap_or ( pkg_name. clone ( ) ) )
310+ . unwrap_or ( pkg_name) ;
311+
312+ writeln ! ( file, "Package: {}" , pkg_name) ?;
306313 writeln ! ( file, "Version: {}" , & config. version) ?;
307314 writeln ! ( file, "Architecture: {}" , arch) ?;
308315 // Installed-Size must be divided by 1024, see https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size
You can’t perform that action at this time.
0 commit comments